Detours icon indicating copy to clipboard operation
Detours copied to clipboard

hook c library function return 0, but not work by inject dll.

Open LickBag opened this issue 3 years ago • 6 comments

CrashDumpHelper.zip

I hook strcmp function success, and it take effect in app(.exe) code. But it doesn't work if hook strcmp function in dll while inject the dll to app(.exe)

attachment is my code, could you please answer me? thks

LickBag avatar Aug 30 '22 16:08 LickBag

It's possible that the application you are injecting into statically links the CRT, or uses a different (older or newer) version of the CRT.

sylveon avatar Aug 30 '22 21:08 sylveon

It's possible that the application you are injecting into statically links the CRT, or uses a different (older or newer) version of the CRT.

I used the same function and the same header, compile them together with VS. attachment is my code, could you please fix it ?

LickBag avatar Aug 31 '22 00:08 LickBag

I can't check your code because it gets flagged as virus and autodeleted. Can you upload it on GitHub?

sylveon avatar Aug 31 '22 01:08 sylveon

https://github.com/LickBag/DetourDemo

The inject tool Xenos.exe is from here: https://github.com/DarthTon/Xenos

LickBag avatar Aug 31 '22 01:08 LickBag

Any progress @LickBag

barisunsalhn avatar Oct 19 '23 06:10 barisunsalhn

These take effect only in Debug mode

If its working in debug but not in release mode its likely that the function is inlined and not actually called. Just because a function has a header signature doesn't mean its part of the DLL, it could be part of the LIB and the linker can decide whether to inline or call it.

weltkante avatar Oct 19 '23 07:10 weltkante