gaffe23 / linux-inject

Tool for injecting a shared object into a Linux process
Other
1.11k stars 249 forks source link

Injecting library to a multithreaded process causes it to segfault #7

Open korcankaraokcu opened 8 years ago

korcankaraokcu commented 8 years ago

After executing the code "ptrace_cont(target);" in line 258, target segfaults. The target is Torchlight2

ar1a commented 8 years ago

Can confirm, I have tried with Team fortress 2 and the target segfaults.

jm33-m0 commented 4 years ago

https://github.com/gaffe23/linux-inject/blob/268d4e41bba8b4dfda19d732a3860983c8af563f/inject-x86_64.c#L258

I have tested with sample-target, it throws segmentation fault on ptrace_cont(target);

gordon0001 commented 3 years ago

what do you expect what is happening when you are writing x86_64 instructions to the code section of a x86 process and then run it? segfault

if your game is x86, then you need a x86 shared object and a x86 injector. tf2 is x86, a x86_64 .so+injector won't work. keep in mind. you might need to build a cross compiler for i686/x86 if you are on x86_64 and the game is x86 only to get it working successfully