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

Call like instructions #2261

Merged
merged 16 commits into from
Jun 26, 2024
Merged

Conversation

OBarronCS
Copy link
Member

This PR adds a "call-like" attribute to instructions. We previously relied on the capstone constant CS_GRP_CALL to identify call instructions, but this misses a handful of instructions that behave like calls, like a handful of "branch-and-link" instructions in MIPS that capstone doesn't label as calls. This makes the stepping through MIPS more clean, and makes things like nextcall work better on MIPS.

This was referenced Jun 26, 2024
@@ -104,7 +102,7 @@ def next_matching_until_branch(address=None, mnemonic=None, op_str=None):
if mnemonic_match and op_str_match:
return ins

if set(ins.groups) & jumps:
if ins.groups_set & ALL_JUMP_GROUPS:
Copy link
Member

Choose a reason for hiding this comment

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

Considering this is called like 3 times in this file I wonder if we should make a property out of it or cache it...

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that caching it as a property would be a good call. I'll look to add some caching decorators on the getter functions of the PwndbgInstruction when we start hammering down on the performance.

@disconnect3d disconnect3d merged commit 83cc8c5 into pwndbg:dev Jun 26, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants