linux-inject icon indicating copy to clipboard operation
linux-inject copied to clipboard

Injecting library to a multithreaded process causes it to segfault

Open korcankaraokcu opened this issue 7 years ago • 3 comments

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

korcankaraokcu avatar Jun 03 '16 21:06 korcankaraokcu

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

ar1a avatar Jul 10 '16 09:07 ar1a

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);

jm33-m0 avatar Aug 17 '20 07:08 jm33-m0

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

gordon0001 avatar Mar 12 '21 08:03 gordon0001