address_to_read = bb.getMinAddress()

# Initialize a byte array to store the read bytes

bytes_read = bytearray(bb.size)

print("bytes_read before: ", bytes_read)

currentProgram = getCurrentProgram()

# Attempt to read bytes from the specified address into the byte array

num_bytes_read = currentProgram.getMemory().getBytes(address_to_read, bytes_read)

print("bytes_read after: ", bytes_read)
print("num_bytes_read: ", num_bytes_read)

bytes_read before:

bytearray(b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00')

bytes_read after:

bytearray(b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00')
num_bytes_read: 12

I've tried the following to initialize bytes_read:

  • bytes_read = array.array('b', bytes_read)

  • bytes_read = array.array("b", bytes(bytes_read))

  • bytes_read = array.array('b', repr(bytes(bytes_read))[2:-1])

  • bytes_read = array.array('b', bytes_read.decode('utf-8'))

  • bytes_read = array.array('b', bytes_read.decode())

  • bytes_read = list()*bb.size

  • num_bytes_read = currentProgram.getMemory().getBytes(address_to_read, bytes_read, 0, bb.size)

None of them populate bytes_read.

0

There are 0 answers