I want to call the same function more times but with other args, I can't add new instructions, so how can I call it?
1 Answer
The simplest approach would be to use code cave:
- Find some locations with no (or useless) instructions.
- Put in there your function calls and args.
- At the end of your calls, place a jump to the instruction executing next after the original call, according to your screenshot, that would be the address 0x41B417.
- Overwrite the address of the original call (0x41B412) with a jump to your code cave (you've got 5 bytes, plenty of space for a good long jump).
Another approach would be to write a DLL, define the function's prototype, load it and call the function as many times and with any arguments as you want.