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

Add documentation for ROP magic register properties and setRegisters #1894

Merged
merged 3 commits into from May 26, 2021

Conversation

heapcrash
Copy link
Collaborator

No description provided.

@heapcrash
Copy link
Collaborator Author

This also needs to document this neat way of setting registers that I just learned from another issue. Apparently you can do:

    >>> context.clear(arch='amd64')
    >>> assembly = 'pop rax; pop rdi; pop rsi; ret; pop rax; ret;'
    >>> e = ELF.from_assembly(assembly)
    >>> r = ROP(e)
    >>> r(rax=0xdead, rdi=0xbeef, rsi=0xcafe) <----------------- MAGIC
    >>> print(r.dump())
    0x0000:       0x10000000 pop rax; pop rdi; pop rsi; ret
    0x0008:           0xdead
    0x0010:           0xbeef
    0x0018:           0xcafe

@heapcrash
Copy link
Collaborator Author

This is a documentation change, so no CHANGELOG.md is necessary.

@heapcrash heapcrash requested a review from Arusekk May 18, 2021 03:52
@Arusekk Arusekk merged commit ef37e99 into Gallopsled:dev May 26, 2021
@Arusekk
Copy link
Member

Arusekk commented May 26, 2021

On the second thought we could also document the setattr magics as well (r.rax = 0xdead is equivalent to r(rax=0xdead)).

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