Skip to content

Illegal pop instruction output in arm32 #211

@Rosayxy

Description

@Rosayxy

When I was doing a ctf chall lately, I tried to run ROPgadget with the following command ROPgadget --binary sp33d5 --only "pop|ret"|grep r0.
The output is as below

Image

The output contains pop instructions that pops the sp register, but these instructions are invalid, according to this documentation, which states that "ARM POP instructions cannot have SP but can have PC in the reglist".

When such a gadget is used in a ropchain, the system will give an error of "illegal instruction" and result in sending a sigkill signal.

Thanks in advance for looking into this. Please let me know if I can provide any additional information or assist with fixing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions