mirror of
https://github.com/dobin/ShellcodeObfuscationLab
synced 2026-06-08 13:53:31 +00:00
40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
#include <windows.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
|
|
int main(void)
|
|
{
|
|
|
|
|
|
unsigned char reversed_payload [42] = {0x17, 0x25, 0x17, 0x25, 0x17, 0x78, 0x17, 0x60, 0x17, 0x6d, 0x17, 0x64, 0x17, 0x79, 0x17, 0x7e, 0x17, 0x72, 0x17, 0x78, 0x17, 0x60, 0x17, 0x6d, 0x17, 0x64, 0x17, 0x79, 0x17, 0x7e, 0x17, 0x72, 0x17, 0x63, 0x17, 0x64, 0x17, 0x72, 0x17, 0x63, 0xe9, 0xe8};
|
|
|
|
char shellcode[sizeof(reversed_payload)] = {0};
|
|
unsigned int len = sizeof(reversed_payload);
|
|
int xorkey = 23;
|
|
|
|
// reverse and de-xor our array of ints
|
|
for (int i = 0; i < len; i++)
|
|
{
|
|
char decoded = reversed_payload[len - i - 1] ^ xorkey;
|
|
shellcode[i] = decoded;
|
|
}
|
|
|
|
int idx = 0;
|
|
while (idx < sizeof(reversed_payload))
|
|
{
|
|
if (idx == (sizeof(reversed_payload) - 1))
|
|
{
|
|
printf("0x%02x ", (unsigned char)shellcode[idx]);
|
|
}
|
|
else
|
|
{
|
|
printf("0x%02x, ", (unsigned char)shellcode[idx]);
|
|
}
|
|
idx++;
|
|
}
|
|
|
|
return 0;
|
|
}
|