Skip to content

Correct behavior for reading memory on linux #52

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

Merged
merged 9 commits into from
Jul 30, 2020

Conversation

JJendryka
Copy link
Contributor

@JJendryka JJendryka commented Jul 27, 2020

Implements #50

  • Use ptrace as a fallback for process_vm_readv
  • Handle cross page read correctly
  • Fix tests so that ptrace can be used inside them
  • Restructure the code to be more readable

@JJendryka JJendryka force-pushed the ptrace_read_fallback branch from 4df1db1 to 52b3654 Compare July 28, 2020 19:12
@JJendryka JJendryka force-pushed the ptrace_read_fallback branch from 52b3654 to ea0cb58 Compare July 28, 2020 19:15
@JJendryka JJendryka force-pushed the ptrace_read_fallback branch from ea0cb58 to 67521ed Compare July 30, 2020 16:44
@JJendryka JJendryka changed the title Correct behavior for reading memory on linux [WIP] Correct behavior for reading memory on linux Jul 30, 2020
@JJendryka JJendryka force-pushed the ptrace_read_fallback branch from 7907252 to 9b75dee Compare July 30, 2020 18:30
@JJendryka
Copy link
Contributor Author

As far as I know /proc/<pid>/maps is always sorted by address.

I've also thought so, however I cannot find any resource that states so.

Copy link
Member

@nbaksalyar nbaksalyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this looks great! I left a small comment about the use of sort_by for memory maps.

@JJendryka JJendryka force-pushed the ptrace_read_fallback branch from edde071 to d5390a3 Compare July 30, 2020 22:53
@nbaksalyar nbaksalyar merged commit 371e1b3 into headcrab-rs:master Jul 30, 2020
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