Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. {$STRICT}
  2.  
  3. {$lua}
  4.  
  5. if syntaxcheck then return end
  6.  
  7. [ENABLE]
  8.  
  9. function aobscanex( aob, p, a, n, s, e, pb )
  10. local p, a, n, s, e = p or '*X*W', a or fsmNotAligned, n or '0', s or 0x0, e or 0xffffffffffffffff
  11. local ms = pb and createMemScan( pb ) or createMemScan()
  12. local fl = createFoundList( ms )
  13. ms.firstScan( soExactValue, vtByteArray, nil, aob, nil, s, e, p, a, n, true, false, false, false )
  14. ms.waitTillDone()
  15. fl.initialize()
  16. local result = nil
  17. if fl ~= nil and fl.getCount() > 0 then
  18. result = createStringlist()
  19. for i = 1, fl.getCount() do result.add( fl.getAddress( i - 1 ) ) end
  20. end
  21. fl.destroy()
  22. ms.destroy()
  23. return result
  24. end
  25.  
  26. local aob_toUCheatManagerGetPrivateStaticClass = "E8????????41B83D00000048"
  27. local aob_APlayerControllerAddCheats = "405356574883EC??488B010FB6DA4889CF"
  28.  
  29. local lst_result = aobscanex( aob_toUCheatManagerGetPrivateStaticClass, nil, nil, nil, getAddress( process ), getAddress( process ) + getModuleSize( process ) )
  30. local t = tonumber( lst_result[0], 16 )
  31. local UCheatManager_GetPrivateStaticClass = t + readInteger( t + 0x1, true ) + 0x5
  32. lst_result = aobscanex( aob_APlayerControllerAddCheats, nil, nil, nil, getAddress( process ), getAddress( process ) + getModuleSize( process ) )
  33. local APlayerController_AddCheats = tonumber( lst_result[0], 16 )
  34.  
  35. local SwPlayerController = getAddressSafe( "SwPlayerController" )
  36. if SwPlayerController ~= nil then
  37. SwPlayerController = readQword( SwPlayerController )
  38. if SwPlayerController ~= nil then
  39. local CheatManager = readQword( SwPlayerController + 0x480 )
  40. if CheatManager == 0 then
  41. local CheatManagerClass = executeCode( UCheatManager_GetPrivateStaticClass )
  42. writeQword( SwPlayerController + 0x488, CheatManagerClass )
  43. executeCodeEx( 0, nil, APlayerController_AddCheats, SwPlayerController, 0 )
  44. end
  45. end
  46. end
  47.  
  48. [DISABLE]
  49.  
  50. {$asm}
  51.  
  52. unregistersymbol( APlayerController_AddCheats )
  53. unregistersymbol( UCheatManager_GetPrivateStaticClass )