使用 python 的 trace32:如何解释来自函数 T32_ReadMemoryObj 的 return 数据

trace32 using python: how to interpreat return data from function T32_ReadMemoryObj

代码用于从 32 位地址读取 40 字节的数据:

    size = 40
    addr = 0x02051000
    buffer = (c_uint8 * size)()
    buffer_handle = c_void_p()
    address_handle32 = c_void_p()
    self.t32_api.T32_RequestBufferObj(byref(buffer_handle), 0)
    self.t32_api.T32_RequestAddressObjA32(byref(address_handle32), addr)
    self.t32_api.T32_ReadMemoryObj(buffer, address_handle32, size)
    self.t32_api.T32_CopyDataFromBufferObj(buffer, size, buffer_handle)
    self.t32_api.T32_ReleaseBufferObj(byref(buffer_handle))
    return ''.join(map(str, buffer))

return 数据:000000004000000003213746596610040000000000000000 但在轨迹 32 window 中显示

是否 API return输入的数据不正确?或者我的代码无效?

它以整数格式返回字节大小

从缓冲区获取每个整数并转换为十六进制对我来说也很有效,还有一个代码更改:

    self.t32_api.T32_ReadMemoryObj(buffer_handle, address_handle32, size)

在之前的代码中,我传递了缓冲区而不是 buffer_handle。 添加代码以将每个字节转换为十六进制后得到输出:000000000000000004000100000000027856341200000000000000000000000000000000000000000