Nirvada

Cheat Engine LUA engine to convert Gameshark address to C.E address on Duckstation

Oct 17th, 2024 (edited)
56
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. -- Base pointer address for Duckstation (Hopefully it doesn't remove as updates more)
  2. local basePointer = "Ram"
  3.  
  4. -- List of offsets (example values provided, replace with actual offsets)
  5. local offsets = {
  6. "801D1568",
  7. }
  8.  
  9. -- Iterate through each offset and create a memory record
  10. for i, offset in ipairs(offsets) do
  11. local memrec = getAddressList().createMemoryRecord()
  12. memrec.Description = "Address " .. i
  13.  
  14. -- Set the base address
  15. memrec.Address = basePointer
  16.  
  17. -- Mark as pointer
  18. memrec.IsPointer = true
  19.  
  20. -- Set the number of offsets
  21. memrec.OffsetCount = 1 -- Assuming one offset per memory record
  22.  
  23. -- Slice the offset to remove the first 2 characters
  24. local trimmedOffset = offset:sub(3) -- Get substring from index 3 to end
  25. local decimalOffset = tonumber(trimmedOffset, 16) -- Convert to decimal from hex
  26. if decimalOffset == nil then
  27. print("Error converting offset: " .. offset)
  28. else
  29. print("Hex Offset: " .. offset .. " | Trimmed Hex Offset: " .. trimmedOffset .. " | Decimal: " .. decimalOffset)
  30. memrec.Offset[0] = decimalOffset -- Set the offset value
  31. end
  32.  
  33. -- Set the value type
  34. memrec.Type = vtDword -- vtByte = 00 | vtWord = 0000 | vtDword = 00000000 | vtQword = 0000000000000000
  35.  
  36. -- Display address in hexadecimal format or switch to false for Decimal
  37. memrec.ShowAsHex = true
  38. end
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment