Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

memory.getBytes() Does Not Populate Bytearray #106

@JamesD4

Description

@JamesD4

I'm experiencing an issue with the memory.getBytes() function when using Ghidrathon with Ghidra's Headless Analyzer. When I use the following code to read bytes from memory:

byte_data = bytearray(8)
memory.getBytes(cstring_ptr_addr, byte_data)

Following the call to memory.getBytes(), byte_data remains empty and is not populated with any bytes.

However, when I read the bytes individually using a loop, it works as expected:

byte_data = bytearray()
for i in range(8):
    try:
        single_byte = memory.getByte(cstring_ptr_addr.add(i))
        byte_data.append(single_byte)
    except Exception as e:
        return None

No exceptions or error messages are thrown when memory.getBytes() is called and the bytearray is not populated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions