tcmalloc using a "GangBoard" mechanism which need to change some opcodes at the
begining of the hook function.
But at least on 32bit and 64bit windows, there is a more elegant and effective
hook mechanism: we can change the module's (exe or dll) IAT (Import address
table) entry directly to implement the hook.
This method doesn't need the disassembler nor changing any opcode, Just rewrite
the function pointer of corresponding IAT entries.
And because the hooked function will be invocked directly, there is no need to
do a "GangBoard" jump for each call, so it will gains more efficient.
Original issue reported on code.google.com by baiyang@gmail.com on 17 Sep 2013 at 10:56
Original issue reported on code.google.com by
baiyang@gmail.com
on 17 Sep 2013 at 10:56