我这么写异或出来的代码多了四倍,怎么样让他一组一组的异或呢
\xfc 异或
而不是
\ 异或
x 异或
f 异或
c 异或
[C++] 纯文本查看 复制代码 #include <Windows.h>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
HANDLE cf = CreateFileA("payload.c", GENERIC_ALL, 0, NULL, OPEN_ALWAYS, 0, NULL);
if (cf == INVALID_HANDLE_VALUE)
{
printf("error");
return -1;
}
DWORD dwSize = 0;
DWORD dRead;
dwSize = GetFileSize(cf, 0);
unsigned char* buf = new unsigned char[dwSize+1]{};
ReadFile(cf, buf, dwSize, &dRead ,0);
for(int i=0; i<dwSize; i++)
{
buf[i] = buf[i] ^ 10;
printf("\\x%x", buf[i]);
}
return 0;
} |