0

Given a Windows environment...

I know it is possible to use DLL or reflective DLL injection to load shared libraries (DLLs in the case of Windows) at runtime. As stated quite clearly here; http://blog.opensecurityresearch.com/2013/01/windows-dll-injection-basics.html?m=1

But what about statically linked .lib or .a files?

Where do .lib or .a files go in the PE file when they've been statically linked at compile time? Is it possible to "link" them at runtime like common DLL injection? Should I be looking at the format of a .lib or .a file for clues?

Steve Mucci
  • 212
  • 1
  • 11
  • Short answer: you cannot link .lib or .a files at runtime. – Jabberwocky Jul 17 '17 at 13:54
  • I could copy relevant data (function code) from a .lib or .a into a process and use DLL injection techniques that call on the data (functions) and run their code though right? – Steve Mucci Jul 17 '17 at 18:18

1 Answers1

0

You cannot static link at runtime.

To solve your problem, convert the lib to a DLL and inject it.

GuidedHacking
  • 3,628
  • 1
  • 9
  • 59