hasherezade / dll_to_exe Goto Github PK
View Code? Open in Web Editor NEWConverts a DLL into EXE
Home Page: https://hshrzd.wordpress.com/2016/07/21/how-to-turn-a-dll-into-a-standalone-exe/
Converts a DLL into EXE
Home Page: https://hshrzd.wordpress.com/2016/07/21/how-to-turn-a-dll-into-a-standalone-exe/
It closes whenever I push any button, how do I get it to work properly?
Hello @hasherezade ,
I'm a new GitHub user with little to no C++ programming xp. i need to convert a native .dll file into a .exe. In the file finder, there are numerous files (i.e pe_handler.cpp, main.cpp, CMakeLists.txt e.t.c) with varying codes. What does each file do?
If you're free can you walk me through the process on how to convert my native .dll file to .exe like you'd a 13 yr old kid? Thanks
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 ?
Hello,
I was using dll_to_exe on a 64 bit dll
After I convert it to exe and debugged with IDA & Windbg
It gave me the ACCESS_VIOLATION
error (Exception code C0000005
)
After some tracing I found the bug happens to be in the back_stub
for the 64 bit dll:
BYTE back_stub64[] = {
0x65, 0x48, 0x8B, 0x0C, 0x25, 0x60, 0x00, 0x00, 0x00, // mov rcx,qword ptr gs:[0x60]
0x48, 0x8B, 0x4E, 0x10, // mov rcx,qword ptr ds:[rsi+10] <-- ACCESS_VIOLATION error
0x48, 0x8B, 0xF9, // mov rdi, rcx
0xBA, 0x01, 0x00, 0x00, 0x00, // mov edx, 1
0x48, 0x8B, 0xDA, // mov rbx, rdx
0x4C, 0x8B, 0xC0, // mov r8, rax
0xE9, 0xDE, 0xAD, 0xF0, 0x0D, //jmp [ep]
0xC3 //ret
};
The second instruction is mov rcx,qword ptr ds:[rsi+10]
, while rsi
is NULL
, causing the error.
According to your blog, I believe it should be [rcx + 10h]
instead of [rsi + 10h]
?
Also if we're calling DllMain(handle, 1, 0)
, I think the back_stub
should be something like:
BYTE back_stub64[] = {
0x65, 0x48, 0x8B, 0x0C, 0x25, 0x60, 0x00, 0x00, 0x00, // mov rcx,qword ptr gs:[0x60]
0x48, 0x8B, 0x49, 0x10, // mov rcx,qword ptr ds:[rcx+10], 1st arg = handle
0xBA, 0x01, 0x00, 0x00, 0x00, // mov edx, 1, 2nd arg = 1
0x4D, 0x31, 0xC0, // xor r8, r8, 3rd arg = 0 ( at this point rax != 0, which will make r8 non-zero if we use mov r8, rax)
0xE8, 0xDE, 0xAD, 0xF0, 0x0D, // call [ep] instead of jmp [ep]
0xC3 //ret
};
Not sure if we have to set rdi
and rbx
while calling DllMain in 64 bit dll ( I'm not familiar with Windows , please correct me if I misunderstood anything ).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.