4 ms·
Can anyone provided an explanation of how the binary patch is applied?
by emacsitor 13y ago
Can anyone provided an explanation of how the binary patch is applied?
- f2f 13y agoIf you're familiar with Go you can read the source of the apply function here: the loadKernel function reads in the kernel and builds a symbol table looking for the bsd_ast and current_thread symbols here: https://code.google.com/p/rsc/source/browse/cmd/pprof_mac_fix/main.go#231 https://code.google.com/p/rsc/source/browse/cmd/pprof_mac_fi... then the "apply" func writes the modified binary instructions code: https://code.google.com/p/rsc/source/browse/cmd/pprof_mac_fix/main.go#464 https://code.google.com/p/rsc/source/browse/cmd/pprof_mac_fi...