Advertisement
fdfsfsd

Untitled

Jun 19th, 2017
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. {$lua}
  2. cheat_name = "Remove FOG"
  3. [ENABLE]
  4. local pattern = "80 BF 00 00 80 BF 00 00 80 BF 00 00 80 3F 00 00 80 3F 00 00 80 3F 00 00 80 3F"
  5. local replace = "80 00 00 00 80 00 00 00 80 00 00 00 80 00 00 00 80 00 00 00 80 00 00 00 80 00"
  6. -- edit the name of the cheat
  7. -- edit the pattern to search
  8. -- edit the replacement bytes
  9. -- use ?? to ignore the bytes
  10. -- do not edit the code below
  11. local scans = AOBScan(pattern)
  12. if scans == nil then
  13. showMessage("Unable to find pattern:\n"..pattern)
  14. else
  15. local saved = {}
  16. local length = (#replace + 1) / 3
  17. for i = 0, scans.Count - 1 do
  18. local backup = readBytes(scans[i], length, true)
  19. local bytes = {}
  20. for hex in string.gmatch(replace, "%S+") do
  21. local size = #bytes + 1
  22. if hex == "??" then
  23. bytes[size] = backup[size]
  24. else
  25. bytes[size] = tonumber(hex, 16)
  26. end
  27. end
  28. saved[i] = backup
  29. writeBytes(scans[i], bytes)
  30. end
  31. _G[cheat_name] = {
  32. ["scans"] = scans,
  33. ["saved"] = saved
  34. }
  35. end
  36. [DISABLE]
  37. local vars = _G[cheat_name]
  38. if vars ~= nil then
  39. local scans = vars.scans
  40. local saved = vars.saved
  41. for i = 0, scans.Count - 1 do
  42. writeBytes(scans[i], saved[i])
  43. end
  44. scans.Destroy()
  45. vars.scans = nil
  46. vars.saved = nil
  47. vars = nil
  48. _G[cheat_name] = nil
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement