Valhalla Legends Forums Archive | General Programming | Calling functions found in IDA

AuthorMessageTime
warz
Howdy,

I've been poking around in a few files, file.exe for reference sake, with IDA, and have found a useful function (usefulfunc()). I need to force file.exe to call usefulfunc() whenever I want. It must be called from within file.exe, not outside its memory. Any ideas ?
December 17, 2002, 7:48 PM
Noodlez
hmm.. just
jmp <address> ?
December 18, 2002, 2:07 AM
warz
What about arguments?  :P
December 18, 2002, 2:19 AM
n00blar
push arg
push arg
push arg
call funcaddr
December 18, 2002, 8:32 AM
Skywing
You'll probably want to do this by loading a DLL into the target process.  As for how you'd call the function, that depends on it's calling convention and prototypes.  If you're using the same compiler as the program in question was compiled with, then you'll usually be able to call the function directly from within the language (assuming C/C++) instead of resorting to a inline assembly to make the transition to the foreign code.
December 18, 2002, 2:52 PM

Search