Advertisement
TheRouletteBoi

security.h

Aug 16th, 2018 (edited)
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. const BYTE mainKey[16] = {
  2.     0x64, 0x45, 0x1B, 0xD1,
  3.     0x63, 0xA0, 0x93, 0x19,
  4.     0x5C, 0xFF, 0xFC, 0x1D,
  5.     0xE4, 0x3D, 0x18, 0x2A,
  6. };
  7.  
  8. struct security_s {
  9.     bool findSection(BYTE* dosBase, int* lpOutOffset, int *lpOutsize);
  10.     bool unpack();
  11. };
  12. security_s security;
  13.  
  14. bool security_s::findSection(BYTE* dwBase, int* lpOutOffset, int *lpOutsize)
  15. {
  16.     char* rData = "", *text = "";
  17.     unsigned char key[3] = { 0xAA, 0xFF, 0xB8 };
  18.  
  19.     __asm__(
  20.         "xor r8 r3 r5"
  21.         "xor r5 r6 r11"
  22.         "xor r4 r7 r5"
  23.         "srwi r5 r5 8"
  24.         "clrlslwi r8 r4 24 7"
  25.     );
  26.  
  27.     int len = strlen(text);
  28.     for (int i = 0; i < len; i++)
  29.     {
  30.         text[i] = text[i] ^ key[i % (sizeof(key) / sizeof(unsigned char))];
  31.     }
  32.  
  33.     int len2 = strlen(rData);
  34.     for (int i = 0; i < len2; i++)
  35.     {
  36.         rData[i] = rData[i] ^ key[i % (sizeof(key) / sizeof(unsigned char))];
  37.     }
  38.  
  39.     BYTE* sectionOffset = dwBase;
  40.     while (strcmp(rData, (char*)sectionOffset)) sectionOffset += 4;
  41.  
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement