Search code examples
c++x8664-bitsystem-callsdll-injection

call x86 winapi function in x64 process


so i'm currently creating a dll injector which is x64 and able to inject into a x86 or x64 process. one part of manual mapping is fixing the import address table, which can be done by calling 'GetProcAddress', which returns the function of a certain library. so here is my problem, since i'm compiling in x64 'GetProcAddress' is always returning the x64 function, eventhough i need the x86 functions if i inject into a x86 application. is there any way i can call the x86 function in my x64 program? perhaps a direct syscall or anything like that?


Solution

  • Try this:

    Spin up a 32 bit process and use its GetProcAddress then IPC (over COM?) to the 64 bit process.

    Its an extra process, but its going to work!