Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Base pointer address for Duckstation (Hopefully it doesn't remove as updates more)
- local basePointer = "Ram"
- -- List of offsets (example values provided, replace with actual offsets)
- local offsets = {
- "801D1568",
- }
- -- Iterate through each offset and create a memory record
- for i, offset in ipairs(offsets) do
- local memrec = getAddressList().createMemoryRecord()
- memrec.Description = "Address " .. i
- -- Set the base address
- memrec.Address = basePointer
- -- Mark as pointer
- memrec.IsPointer = true
- -- Set the number of offsets
- memrec.OffsetCount = 1 -- Assuming one offset per memory record
- -- Slice the offset to remove the first 2 characters
- local trimmedOffset = offset:sub(3) -- Get substring from index 3 to end
- local decimalOffset = tonumber(trimmedOffset, 16) -- Convert to decimal from hex
- if decimalOffset == nil then
- print("Error converting offset: " .. offset)
- else
- print("Hex Offset: " .. offset .. " | Trimmed Hex Offset: " .. trimmedOffset .. " | Decimal: " .. decimalOffset)
- memrec.Offset[0] = decimalOffset -- Set the offset value
- end
- -- Set the value type
- memrec.Type = vtDword -- vtByte = 00 | vtWord = 0000 | vtDword = 00000000 | vtQword = 0000000000000000
- -- Display address in hexadecimal format or switch to false for Decimal
- memrec.ShowAsHex = true
- end
Advertisement