Advertisement
amgineyoc

Untitled

Aug 30th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. // size & 0x80 Dump: http://pastebin.com/b18JfBFK || size & 0x7F Dump: http://pastebin.com/THZjZJfs
  2. std::vector<unsigned char> encrypt(std::vector<unsigned char> decryptedBuf)
  3. {
  4.     std::vector<unsigned char> vector;
  5.  
  6.     unsigned int offset = 0, decryptedStringLength = 0;
  7.  
  8.     while (offset < decryptedBuf.size())
  9.     {
  10.         if (decryptedBuf[offset] == 0x0D)
  11.         {
  12.             vector.push_back(0xFF);
  13.             offset++;
  14.             continue;
  15.         }
  16.  
  17.         decryptedStringLength = decryptedBuf.size() - 1; // <--- to edit if encrypt works
  18.  
  19.         vector.push_back(decryptedStringLength); // <--- i'm not sure it will be interpreted right
  20.  
  21.         if (decryptedStringLength < 0x80) // < '128' Xor 33
  22.         {
  23.             vector.push_back(decryptedBuf[offset++] ^ 0x33);
  24.         }
  25.         else // >= '128' Table
  26.         {
  27.             decryptedStringLength -= 0x80; // & 0x7F
  28.  
  29.  
  30.         }
  31.     }
  32.  
  33.     return vector;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement