diff --git a/README.md b/README.md index d3abca8..c89f7b1 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,12 @@ This is done step by step as,\ ### Steps to try: - [Compiling target.dll](#CompilingDll) > g++ -shared -o target.dll target.cpp -Wl,--out-implib,libtdll.a -- [Create shellcode](#usage) - > python shellcode.py +- [Create shellcode](#CreateShellcode) + > python shellcode.py (This step will create shellcode.bin which is shellcode+target.dll) - [Compiling loader.exe](#CompilingExe) > g++ loader.c -o loader.exe -- [Running loader.exe](#CRunningExe) - > loader.exe +- [Running loader.exe](#RunningExe) + > loader.exe shellcode.bin ## Usage diff --git a/loader.c b/loader.c index d7e6b03..0d285b3 100644 --- a/loader.c +++ b/loader.c @@ -3,16 +3,19 @@ #include #include -int main() +int main(int argc, char* argv[]) { DWORD bytesRead; - const TCHAR* filePath; + const char* filePath; BOOL fileReadSuccess, filePermChangeSuccess, processCreateSuccess; - //scanf("Enter the shellcode(shellcode+dll) binary file path: %d", filePath); - filePath = _T("shellcode.bin"); + if(argc < 2) + { + printf("Shellcode file name is required. Usage: loader.exe \n"); + return 0; + } + filePath = argv[1]; printf("Loader started!\n"); - printf("Shellcode path: %s\n", filePath); HANDLE hFile = CreateFile(filePath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); DWORD fileSize = GetFileSize(hFile, NULL); diff --git a/loader.exe b/loader.exe index 21c6b5c..cae4898 100644 Binary files a/loader.exe and b/loader.exe differ