Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear memory before restore. #1300

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

LukeSerne
Copy link

This fixes #1136 by unmapping everything before applying the restore operation. This will make sure that after a restore, the memory state will be exactly the same as it was when the memory's save method was called.

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

  • The new code conforms to Qiling Framework naming convention.
  • The imports are arranged properly.
  • Essential comments are added.
  • The reference of the new code is pointed out.

Extra tests?

  • No extra tests are needed for this PR.
  • I have added enough tests for this PR.
  • Tests will be added after some discussion and review.

Changelog?

  • This PR doesn't need to update Changelog.
  • Changelog will be updated after some proper review.
  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing


@chinggg
Copy link
Contributor

chinggg commented Jan 3, 2023

@wtdcode @elicn Do you think mem.restore() should have the semantic to clear all memory?

@elicn
Copy link
Member

elicn commented Jan 4, 2023

That is a good question.
I tend to say "yes", because restore operations are usually used to overwrite an existing state with a previous one. Since we restore the entire memory map here (as opposed to restoring each memory region individually), I think this is expected.

@LukeSerne
Copy link
Author

What is the status of this PR? I see some tests are failing on ubuntu, but I don't really see why. Personally, I think that if the tests assume the old behaviour (where a restore would not clear the memory state), they should be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants