Skip to content

Linux memory information ctypes might be too small #16

@cromachina

Description

@cromachina

See here:
https://github.com/JeanExtreme002/PyMemoryEditor/blob/master/PyMemoryEditor/linux/types.py#L14

When printing out base addresses of a process's regions from this struct, I noticed they were truncated to 32 bits after comparing to the smaps under /proc.

The c_int types can be 32 bit instead of 64 bit, even on a 64 bit machine, and should probably instead be c_uint64.
Alternatively, don't use a ctypes structure here because it does not seem to be used by any C functions anyway, and instead use a regular class or namedtuple.

Since the wrapping dictionary contains the base address as the unaltered python int, that is a workaround for reading that specific field.

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