• 0 Posts
  • 6 Comments
Joined 1 year ago
cake
Cake day: June 4th, 2025

help-circle





  • LD_PRELOAD - you can override library functions (if the program is dynamically linked), and change their behavior. Like add adblocking to libcurl, or fix the RNG, or such.

    A somewhat similar trick works with virtual functions from C++ (or function pointers in C, but these are rare) - you read the original function pointer outta the vtable, then substitute yours, add some fun behavior, then call the original behavior in the end. Note that this might not be possible these days as code might live in a read-only region of memory.