Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // size & 0x80 Dump: http://pastebin.com/b18JfBFK || size & 0x7F Dump: http://pastebin.com/THZjZJfs
- std::vector<unsigned char> encrypt(std::vector<unsigned char> decryptedBuf)
- {
- std::vector<unsigned char> vector;
- unsigned int offset = 0, decryptedStringLength = 0;
- while (offset < decryptedBuf.size())
- {
- if (decryptedBuf[offset] == 0x0D)
- {
- vector.push_back(0xFF);
- offset++;
- continue;
- }
- decryptedStringLength = decryptedBuf.size() - 1; // <--- to edit if encrypt works
- vector.push_back(decryptedStringLength); // <--- i'm not sure it will be interpreted right
- if (decryptedStringLength < 0x80) // < '128' Xor 33
- {
- vector.push_back(decryptedBuf[offset++] ^ 0x33);
- }
- else // >= '128' Table
- {
- decryptedStringLength -= 0x80; // & 0x7F
- }
- }
- return vector;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement