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

Fix gdb error "read_memory not defined" #54

Merged
merged 2 commits into from
Mar 21, 2022
Merged

Conversation

jodojodo
Copy link
Contributor

Somehow the gef read_memory function does not exist anymore.
Therefore, I changed the function call to use the gdb's function
directly.

@@ -69,7 +69,7 @@ def do_invoke(self, argv):
return

try:
memory_data = read_memory(start_addr, size)
memory_data = gdb.selected_inferior().read_memory(start_addr, size).tobytes()
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
memory_data = gdb.selected_inferior().read_memory(start_addr, size).tobytes()
memory_data = gef.memory.read(start_addr, size).tobytes()

See https://github.com/hugsy/gef/blob/dev/docs/api/gef.md#function-gefmemorymanagerread

The gef.memory.read(start_addr, size) directly provides bytes.
@jodojodo jodojodo requested a review from hugsy March 16, 2022 23:11
@hugsy hugsy merged commit 79b7b0a into hugsy:dev Mar 21, 2022
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.

None yet

2 participants