For a CTF I have a fairly slow recursive function. I just need to cached the previous results in a dictionary and get them instead. I did it but had to reverse engineer the code. I was wondering if there is a better solution.
LD_PRELOAD won't work as it is a static binary. If I could copy the assembly and call the function in a C program with asm I could get it done but is there a better solution or a way to patch the binary and create a function that caches the slow one? We could path the binary or use somethings to hook the function call.