thumb16 thumb32 arm32 inlineHook
ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk NDK_APPLICATION_MK=./Application.mk
#include<stdio.h>#include"inlineHook.h"int (*old_puts)(constchar*) =NULL;
intnew_puts(constchar*string)
{
old_puts("inlineHook success");
}
inthook()
{
if (registerInlineHook((uint32_t) puts, (uint32_t) new_puts, (uint32_t**) &old_puts) !=ELE7EN_OK) {
return-1;
}
if (inlineHook((uint32_t) puts) !=ELE7EN_OK) {
return-1;
}
return0;
}
intunHook()
{
if (inlineUnHook((uint32_t) puts) !=ELE7EN_OK) {
return-1;
}
return0;
}
intmain()
{
puts("test");
hook();
puts("test");
unHook();
puts("test");
}If you find any bugs, please contact me(ele7enxxh@qq.com)