#include <iostream>
#include <Windows.h>
using namespace std;
void XorEncrypt(DWORD orig, DWORD size)
{
__asm
{
push eax
push ecx
mov eax, orig
mov ecx, orig
add ecx, size
enryption_loop:
xor byte ptr [eax], 0x9A
inc eax
cmp eax, ecx
jl enryption_loop
pop eax
pop ecx
}
}
int main()
{
string orig = "Hello World";
DWORD size = orig.size();
XorEncrypt((DWORD)&orig, size);
system("pause");
return 0;
}