mirror of
https://github.com/violet-devsec/win-shellcode-dev
synced 2026-06-06 16:54:33 +00:00
Loader changed
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -3,16 +3,19 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
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 <shellcode_file>\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);
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user