I want to hook some APIs system-wide in 32 and 64 bits systems. I have created the corresponding injector program which contains the following lines:
Code: Select all
LoadInjectionDriver(L"TWAMHkDriver", L"TWAMHk32.sys", L"TWAMHk64.sys")
result32 = InjectLibrary("TWAMHkDriver", "TWAMHk32.dll", ALL_SESSIONS, true, NULL, HOOK_EXCLUDES, NULL);
result64 = InjectLibrary("TWAMHkDriver", "TWAMHk64.dll", ALL_SESSIONS, true, NULL, HOOK_EXCLUDES, NULL);
If I run the 32 bit program on a Win32 machine then result32 is true and result64 is false, so everything is normal.
If I run the 64 bit program on a Win64 machine then result32 is false and result64 is true, but if I’m right I should be getting true on both calls.
What am I doing wrong?
Thank you very much!