Created
September 20, 2021 07:40
-
-
Save JusticeRage/9a7c31208cda1cf086427e50f329d3e9 to your computer and use it in GitHub Desktop.
This file contains 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
unsigned char shellcode[] = "\xCC\x90\x90\x90\x90..."; | |
int main(int argc, char argv) | |
{ | |
auto buffer = ::VirtualAlloc(nullptr, 0x1000, MEM_COMMIT, PAGE_READWRITE); | |
memcpy(buffer, &shellcode, sizeof(shellcode)); | |
DWORD ignored; | |
::VirtualProtect(buffer, sizeof(shellcode), PAGE_EXECUTE_READ, &ignored); | |
auto f = reinterpret_cast<int32_t(*)()>(buffer); | |
f(); | |
::VirtualFree(buffer, 0, MEM_RELEASE); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment