Hasty Briefsbeta

Foreign-dlopen: call dlopen from static programs

7 days ago
  • #ELF-loader
  • #dlopen
  • #static-linking
  • Calling dlopen() from statically-linked binaries is problematic due to conflicts with static linking benefits.
  • Common approach is to avoid dlopen() in static binaries to maintain size and efficiency.
  • Alternative 'FFI model' allows static binaries to interact with external shared libraries without libc conflicts.
  • Proof-of-concept solution involves a custom ELF loader and a helper executable to bridge static and dynamic worlds.
  • Implementation requires building a target helper executable against the desired system's libc and a static sample application.
  • The solution enables static binaries to dynamically load libraries like libc.so.6 and call functions such as printf().
  • Project credits include Paul Sokolovsky for the idea and Mikhail Ilyin for the ELF loader implementation.