dll_to_exe
dll_to_exe copied to clipboard
Convert dll to exe and pass the dll arguments ?
I try to convert notpetya sample to exe, but it must pass the 1 args. so it did'nt run :(
when it still dll, i usually run it like this
rundll32 perfc.dat,#1
any solution ?
Hi! Indeed, Dll to Exe supports only the cases, when the execution of the sample starts in the DllMain
. In the case that you mentioned, the execution starts in the exported function with the ordinal 1. You can still convert it into Exe by another way. Check my article on this topic: https://hshrzd.wordpress.com/2016/07/21/how-to-turn-a-dll-into-a-standalone-exe/ , especially Case 1: meaningful code starts in one of the exported functions
https://github.com/MalwareLu/tools/blob/master/dll2exe.py
@evandrix - this is very easy to implement for the simplest case: if the function does not take any arguments. But we cannot assume that it will be always true. some functions may expect arguments, and if we don't create a stub that would be filling them, it will simply crash.
The reason why I don't want to add this feature to DLL to EXE is, I am worried it will make things more confusing: such simple redirection will work only for some function. And creating a customized stub to cover each scenario would be too laborious.
oh ok