dll_to_exe icon indicating copy to clipboard operation
dll_to_exe copied to clipboard

Convert dll to exe and pass the dll arguments ?

Open MUWASEC opened this issue 5 years ago • 4 comments

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 ?

MUWASEC avatar Jun 07 '19 04:06 MUWASEC

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

hasherezade avatar Jun 09 '19 12:06 hasherezade

https://github.com/MalwareLu/tools/blob/master/dll2exe.py

evandrix avatar Apr 22 '20 15:04 evandrix

@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.

hasherezade avatar Apr 22 '20 15:04 hasherezade

oh ok

evandrix avatar Apr 27 '20 05:04 evandrix