-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxor.c
More file actions
25 lines (20 loc) · 810 Bytes
/
Copy pathxor.c
File metadata and controls
25 lines (20 loc) · 810 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
#include <stdio.h>
#include <Windows.h>
IN PBYTE Xor(IN PBYTE pShellcode, IN SIZE_T sShellsize,IN BYTE Key){
for(size_t i =0;i<sShellsize;i++){
pShellcode[i] = pShellcode[i]^(Key+i);
}
return pShellcode;
}
int main(){
unsigned char Data[] = {
0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x70, 0x6C,
0x61, 0x69, 0x6E, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x73, 0x74, 0x72,
0x69, 0x6E, 0x67, 0x2C, 0x20, 0x77, 0x65, 0x27, 0x6C, 0x6C, 0x20, 0x74,
0x72, 0x79, 0x20, 0x74, 0x6F, 0x20, 0x65, 0x6E, 0x63, 0x72, 0x79, 0x70,
0x74, 0x2F, 0x64, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x20, 0x21
};
printf("Before Encryption: %s \n\n",Data);
IN PBYTE result = Xor(Data,sizeof(Data),0x23);
printf("Result: %s \n\n",result);
}