Skip to content

mr-r3bot/Windows-Position-Independent-Shellcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build

cmake --build <output_dir> --target Windows_PIC -j 14

Extract shellcode from PE file

python scripts/extract.py -f <Windows_PIC.exe> -o output.bin

image

Validate shellcode

LPVOID addressPointer = VirtualAlloc(NULL, sizeof(buf), MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
if (addressPointer) {
	RtlMoveMemory(addressPointer, buf, sizeof(buf));
	HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)addressPointer, NULL, 0, 0);
	if (hThread) {
		WaitForSingleObject(hThread, INFINITE);
	}
}

About

C to assembly to shellcode ( Position independent shellcode )

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published