I reverse exe file with IDA, there is a function (that is running some other function) that I don't want to understand how it works, but I want to run it.
How can I run an exe file from a specific offset and give it parameters to some arguments?
I reverse exe file with IDA, there is a function (that is running some other function) that I don't want to understand how it works, but I want to run it.
How can I run an exe file from a specific offset and give it parameters to some arguments?
You can use Ida's Appcall functionality:
Appcall is a mechanism to call functions inside the debugged program from the debugger or your script as if it were a built-in function. Such a mechanism can be used for debugging, fuzzing and testing applications. Appcall mechanism highly depends on the type information of the function to be called. For that reason it is necessary to have a correct function prototype before doing an Appcall, otherwise different or incorrect results may be returned.
I have an example of using Appcall or rolling your own on my blog here.
sub_41C91C
without use IDA ?with CreateRemoteThread
by using lpStartAddress
and how can you pass the file path as a argument to this function
Commented
Dec 27, 2018 at 20:09
If you want to keep it simple, it must not do a lot of syscalls and interactions with the whole memory.
You may be looking for a Unicorn-based IDA plugin such as this one which can achieve emulation of not-too-dependent functions and provide you a view of registers and memory.
Otherwise, you may have to use Unicorns bindings outside of IDA, here are some examples and so you'll be able to emulate syscalls and all the stuff you need.
I'll suggest using LIEF. It has a neat feature add_exported_function
to add a function at an address as exported in a new file. You can have a look at this feature here