Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.97 KB | None | 0 0
  1. #define LOBYTE(x)   (*((BYTE*)&(x)))   // low byte
  2. #define LOWORD(x)   (*((WORD*)&(x)))   // low word
  3. #define LODWORD(x)  (*((DWORD*)&(x)))  // low dword
  4. #define HIBYTE(x)   (*((BYTE*)&(x)+1))
  5. #define HIWORD(x)   (*((WORD*)&(x)+1))
  6. #define HIDWORD(x)  (*((DWORD*)&(x)+1))
  7. #define BYTEn(x, n)   (*((BYTE*)&(x)+n))
  8. #define WORDn(x, n)   (*((WORD*)&(x)+n))
  9. #define BYTE1(x)   BYTEn(x,  1)         // byte 1 (counting from 0)
  10. #define BYTE2(x)   BYTEn(x,  2)
  11. #define BYTE3(x)   BYTEn(x,  3)
  12. #define BYTE4(x)   BYTEn(x,  4)
  13. #define BYTE5(x)   BYTEn(x,  5)
  14. #define BYTE6(x)   BYTEn(x,  6)
  15. #define BYTE7(x)   BYTEn(x,  7)
  16. #define BYTE8(x)   BYTEn(x,  8)
  17. #define BYTE9(x)   BYTEn(x,  9)
  18. #define BYTE10(x)  BYTEn(x, 10)
  19. #define BYTE11(x)  BYTEn(x, 11)
  20. #define BYTE12(x)  BYTEn(x, 12)
  21. #define BYTE13(x)  BYTEn(x, 13)
  22. #define BYTE14(x)  BYTEn(x, 14)
  23. #define BYTE15(x)  BYTEn(x, 15)
  24. #define WORD1(x)   WORDn(x,  1)
  25. #define WORD2(x)   WORDn(x,  2)         // third word of the object, unsigned
  26. #define WORD3(x)   WORDn(x,  3)
  27. #define WORD4(x)   WORDn(x,  4)
  28. #define WORD5(x)   WORDn(x,  5)
  29. #define WORD6(x)   WORDn(x,  6)
  30. #define WORD7(x)   WORDn(x,  7)
  31.  
  32.  
  33.  
  34. __declspec(noinline) BYTE  __ROR1(BYTE  value, int count)
  35. {
  36.     return ROL((BYTE)value, -count);
  37. }
  38. __declspec(noinline) BYTE  __ROL1(BYTE  value, int count)
  39. {
  40.     return ROL((BYTE)value, count);
  41. }
  42. __declspec(noinline) USHORT __ROL2(USHORT value, int count)
  43. {
  44.     return ROL((USHORT)value, count);
  45. }
  46. __declspec(noinline) USHORT __ROR2(USHORT value, int count)
  47. {
  48.     return ROL((USHORT)value, -count);
  49. }
  50. __declspec(noinline) UINT __ROL4(UINT value, int count)
  51. {
  52.     return ROL((UINT)value, count);
  53. }
  54. __declspec(noinline) UINT __ROR4(UINT value, int count)
  55. {
  56.     return ROL((UINT)value, -count);
  57. }
  58. __declspec(noinline) ULONGLONG __ROL8(ULONGLONG value, int count)
  59. {
  60.     return ROL((ULONGLONG)value, count);
  61. }
  62. __declspec(noinline) ULONGLONG __ROR8(ULONGLONG value, int count)
  63. {
  64.     return ROL((ULONGLONG)value, -count);
  65. }
  66.  
  67.  
  68.  
  69.         ULONG_PTR GoodULevel = 0;
  70.         ULONG_PTR ULevelEncryptionPointer = ReadUMPointerNum(g_World + 0x928);
  71.  
  72.         LODWORD(GoodULevel) = (((ULevelEncryptionPointer & 0xFFFF0000 | (unsigned __int16)ULevelEncryptionPointer ^ ((unsigned int)ULevelEncryptionPointer >> 16)) - 1465382696) & 0xFFFF0000 | (unsigned __int16)((ULevelEncryptionPointer ^ WORD1(ULevelEncryptionPointer)) + 2264) ^ ((unsigned __int64)((ULevelEncryptionPointer & 0xFFFF0000 | (unsigned __int16)ULevelEncryptionPointer ^ ((unsigned int)ULevelEncryptionPointer >> 16)) - 1465382696) >> 16)) ^ 0xA8A808D8;
  73.         HIDWORD(GoodULevel) = (((unsigned __int16)__ROR2(
  74.             ((((unsigned __int16)__ROR2(HIDWORD(ULevelEncryptionPointer), 8) << 16) | (unsigned int)(unsigned __int16)__ROL2(WORD2(ULevelEncryptionPointer) ^ HIWORD(ULevelEncryptionPointer), 8))- 1479039016) >> 16,8) << 16) | (unsigned __int16)__ROL2((((((unsigned __int16)__ROR2(HIWORD(ULevelEncryptionPointer), 8) << 16) | (unsigned int)(unsigned __int16)__ROL2(WORD2(ULevelEncryptionPointer) ^ HIWORD(ULevelEncryptionPointer), 8))- 1479039016) >> 16) ^ (__ROL2(WORD2(ULevelEncryptionPointer) ^ HIWORD(ULevelEncryptionPointer),8)- 22568),8)) ^ 0x58285828;
  75.         ///////////////////////////ULEVEL////////////////////////////////////////////////////////
  76.  
  77.         ///////////////////////////ACTOR////////////////////////////////////////////////////////
  78.         ULONG_PTR GoodActorTable = 0;
  79.         ULONG_PTR ActorTableEncryptionPointer = ReadUMPointerNum(GoodULevel + 0x250);
  80.         LODWORD(GoodActorTable) = __ROR4(__ROL4(ActorTableEncryptionPointer + 1673235087, 8) - 2106917424, 16) ^ 0x8FAF7341;
  81.         HIDWORD(GoodActorTable) = __ROR4(__ROR4(HIDWORD(ActorTableEncryptionPointer) - 732113544, 16) + 1912398937, 8) ^ 0xF15FF11F;
  82.         ///////////////////////////ACTOR////////////////////////////////////////////////////////
  83.         debug_lvl1("GoodULevel: [%p] GoodActorTable: [%p] \n", GoodULevel, GoodActorTable);
  84.  
  85.  
  86.  
  87. LOG :
  88. g_World: [00000187B21B2740]
  89. GoodULevel: [D92FA107A0C10780](Not correct) GoodActorTable: [441884A7029C4EB4](Not correct)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement