Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling static library functions in host process from an injected DLL
Ok, so I've got a DLL injected, found some nice injection spots, etc. Now, I'd like to call some static library functions in the host process. The most obvious option would be to find offsets for all functions and call them through that, but that's hugely work intensive and is bound to break badly if host is updated to a different library version. Something I tried to do is to locate and globals in the static library, and try to use the .LIB functions compiled into my DLL on the globals in the host. But I saw limited success since there are several things that can break with such a crude method. Since the DLL is in the host's address space, the most elegant solution would be to somehow use the symbol definitions from the exact .LIB the host compiled with to (hopefully) locate some base offset to which the static library linked to in the host. The question is if such an offset exists or if static library functions are placed irregularly in the output image. I will research the matter further on my own but I wonder if anybody else has a better idea.
can't you use getprocaddress? msdn: Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL).
I believe the library in question is statically compiled, but I'll double check.

Users browsing this thread: 1 Guest(s)