jmpews / Dobby

a lightweight, multi-platform, multi-architecture hook framework.
Apache License 2.0
3.98k stars 822 forks source link

Linux 4.18 not support #55

Closed yuzehome closed 4 years ago

yuzehome commented 5 years ago

I can build in Ubuntu18.04 ,but i can't use!

Debug and found ,ZzReplace has someting error!

ZzReplace->route->Dispatch();-> Prepare();->GenRelocateCode error at this

I debug in Ubuntu 14.0,It running.Linux version is 4.4

jmpews commented 5 years ago

thx, i will try & fix later. (example code?)

yuzehome notifications@github.com 于2019年6月19日周三 下午2:47写道:

I can build in Ubuntu18.04 ,but i can't use!

Debug and found ,ZzReplace has someting error!

ZzReplace->route->Dispatch();-> Prepare();->GenRelocateCode error at this

I debug in Ubuntu 14.0,It running.Linux version is 4.4

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jmpews/HookZz/issues/55?email_source=notifications&email_token=ABDSANN3OER2HSDE4AHS44TP3HJAHA5CNFSM4HZGMYKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2KAUNA, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDSANJM2U5MN2R7VF2ZXUDP3HJAHANCNFSM4HZGMYKA .

yuzehome commented 5 years ago

include

include

include "hookzz.h"

size_t (origin_fread)(void ptr, size_t size, size_t nitems, FILE stream); size_t (fake_fread)(void ptr, size_t size, size_t nitems, FILE * stream) { printf("[FileMonitor|fread|model|%p] >>> %ld, %ld\n", ptr, size, nitems); return origin_fread(ptr, size, nitems, stream); }

void hook_fread() {

int status = ZzReplace((void *)fread, (void *)fake_fread, (void **)&origin_fread); 
int a  =10;

}

int main() { hook_fread(); int t = getpid(); getppid(); FILE* file = fopen("/home/pi/1.txt","r"); char buf[1024] = {0}; size_t n = fread(buf,4,1,file); //fwrite("1234" , 4 , 1 , file); fclose(file);

return 0;

}

yuzehome commented 5 years ago

this is my test code! on ubuntu14.04 Print error! [!] [/home/pi/prj/HookZz-dev/srcxx/InstructionRelocation/x64/X64InstructionRelocation.cc:50:GenRelocateCodeTo] unimplemented code!!! [!] [/home/pi/prj/HookZz-dev/srcxx/InstructionRelocation/x64/X64InstructionRelocation.cc:50:GenRelocateCodeTo] unimplemented code!!!

jmpews commented 4 years ago

fixed