4 ms·
What are uses of LD_PRELOAD that make us keep it?
by benob 2y ago
What are uses of LD_PRELOAD that make us keep it?
- worthless-trash 2y agoFixing bugs in a function in a library. Overriding libraries.
- freeone3000 2y agoPatching the binary seems like a better way to do this.
- worthless-trash 2y agoBetter long term,but also much harder. Some anti cheat software will be tripped if you do this as they checksum the binaries on disk, that of course can be worked around so its just a matter of understanding your adversary.
- saagarjha 2y agoPatching libraries is error-prone and annoying.
- deleted 2y ago[deleted]
- viraptor 2y agoReplacing allocators https://github.com/jemalloc/jemalloc/wiki/Getting-Started https://github.com/jemalloc/jemalloc/wiki/Getting-Started Pretending you're running on a remote system https://github.com/viraptor/libremotec https://github.com/viraptor/libremotec Cheat in games https://github.com/ProfessionallyEvil/LD_PRELOAD-rand-Hijack-Example https://github.com/ProfessionallyEvil/LD_PRELOAD-rand-Hijack... Fixing bugs where the upstream can't do it.
- LukeShu 2y agoSome uses of LD_PRELOAD off the top of my head: - GNU stdbuf (BSDs use an env-var instead of hijacking libc) - fakeroot - gprofng's data collector - For a long time it was necessary to use LD_PRELOADto hack around a bug in flashplayer because flashplayer used memcpy when it should have used memmove.
- mappu 2y agoDo you mean the functionality itself (inherent in the capabilities of a dynamic ELF loader) or specifically that it uses an environment variable? Maybe moving it to static configuration in ld.so.conf would cut down on abuse.
- xioxox 2y agotsocks is quite useful for proxying a program's network access over ssh using SOCKS. I use it for accessing geo-blocked servers using command line tools without a full VPN.