diff --git a/qiling/os/memory.py b/qiling/os/memory.py index a2f01a2f8..aeb514bda 100644 --- a/qiling/os/memory.py +++ b/qiling/os/memory.py @@ -286,6 +286,9 @@ def restore(self, mem_dict): """Restore saved memory content. """ + # Unmap everything so we start with a clean memory state. + self.unmap_all() + for lbound, ubound, perms, label, data in mem_dict['ram']: self.ql.log.debug(f'restoring memory range: {lbound:#08x} {ubound:#08x} {label}')