This PR adds chunking to the memory dump functions. The core logic is here:
# I changed this so that the BLOCK_SIZE is a parameter instead of a constant
def _get_chunks(addr: int, size: int) -> List:
if size > BLOCK_SIZE:
block_count = size // BLOCK_SIZE
extra_block = size % BLOCK_SIZE
ranges = []
current_address = addr
for i in range(block_count):
ranges.append((current_address, BLOCK_SIZE))
current_address += BLOCK_SIZE
if extra_block != 0:
ranges.append((current_address, extra_block))
return ranges
else:
return [(addr, size)]
The tuple list that's returned is the offset to start dumping from and the size for that block, thus avoiding the 128MiB limit in glib. This hopefully closes #516.
This PR adds chunking to the memory dump functions. The core logic is here:
The tuple list that's returned is the offset to start dumping from and the size for that block, thus avoiding the 128MiB limit in glib. This hopefully closes #516.