"Think you can’t interpose static binaries with LD_PRELOAD? Think again!"

https://balintreczey.hu/blog/think-you-cant-interpose-static-binaries-with-ld_preload-think-again/

I pray that we never have to use this in @yoctoproject!

h/t @fanf

Think you can’t interpose static binaries with LD_PRELOAD? Think again! - Obsessed with reality

Well, you are right, you can't. At least not directly. This is well documented in many projects relying on interposing binaries, like faketime. But what if we could write something that would take a static binary, replace at least the direct syscalls with ones going through libc and load it with the dynamic linker? We are in luck, because the…

Obsessed with reality