Skip to content

Read process memory doesn't retrieve bytes correctly #11

Open
@cromachina

Description

@cromachina

This function https://github.com/JeanExtreme002/PyMemoryEditor/blob/master/PyMemoryEditor/linux/functions.py#L70
(and the similar windows version) are retrieving data.value, which is not correct when you want bytes from ctypes.create_string_buffer.

This should instead be:

    if pytype is str:
        return data.value.decode()
    elif pytype is bytes:
        return bytes(data)
    else:
        return data.value

If you just return value, it returns cut off bytes, as if it's stopping at null terminators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions