Hi,

How can I call a function when i only know it's address?
Ie. I have an address of some function - for example 00450c2fh-
in other exe file. I want to call it from my program, what
should I do? LoadLibrary? If yes, what next?
In this case the function doesn't have any arguments, but
what if it has?

TIA

all the best...
slinik1@go2.pl
Posted on 2002-01-24 16:22:12 by slonik
If it's in a DLL, try traversing the export section and see if you can
match the address to an export name/ordinal. It's also possible to
call the address directly, but you will have to take into account the
base the DLL is loaded to. If it's in an executable, you cannot call
the function, as you can't LoadLibrary an executable (well, you can,
but relocations aren't applied even if they exist, so it won't work).

Also, your post smells a bit of Reverse Engineering, which is out of
topic on this board. There are other boards that deals with those
issues.
Posted on 2002-01-24 16:44:44 by f0dder
As for this, I suggest this one.
disassembe your executalbe file, and copy it to your src.

if there are too many subroutine, it may be troubled...
Posted on 2002-01-24 19:39:21 by muzidowa