Guest User

Untitled

a guest
Jan 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <Windows.h>
  2.  
  3. char key[11] = { 'f', 'u', 'c', 'k', 'b', 'i', 't', 'c', 'h', 'e', 's' };
  4.  
  5. #define START_ENCRYPTION(num) \
  6.     static DWORD pointer##num; \
  7.     static DWORD endpointer##num; \
  8.     static bool encrypted##num; \
  9.     if(encrypted##num) XOR(pointer##num, endpointer##num, key); \
  10.     else \
  11.     { \
  12.         pointer##num = GetCurAddr(); \
  13.     }
  14.  
  15.  
  16. #define END_ENCRYPTION(num) \
  17.     if(!encrypted##num) \
  18.     { \
  19.         endpointer##num = GetCurAddr(); \
  20.     } \
  21.     encrypted##num = true; \
  22.     XOR(pointer##num, endpointer##num, key);
  23.  
  24.  
  25. void XOR(DWORD start, DWORD end, char theKey[11])
  26. {
  27.     for(int i = start; start <= end; i++)
  28.     {
  29.         *(byte*)i ^= theKey[i - start];
  30.     }
  31. }
  32.  
  33. DWORD GetCurAddr()
  34. {
  35.     DWORD result;
  36.  
  37.     __asm
  38.     {
  39.         PUSH EAX
  40. Dicks:
  41.         MOV EAX, Dicks
  42.         MOV result, EAX
  43.         POP EAX
  44.     }
  45.  
  46.     return result;
  47. }
Add Comment
Please, Sign In to add comment