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

Feat/aarch64 #125

Merged
merged 106 commits into from
Jan 24, 2025
Merged

Feat/aarch64 #125

merged 106 commits into from
Jan 24, 2025

Conversation

Kyle-Kyle
Copy link
Collaborator

@Kyle-Kyle Kyle-Kyle commented Jan 24, 2025

bkrl added 30 commits January 15, 2025 17:46
This makes angrop run on aarch64 binaries, but it's not able to do
anything useful yet.
This fixes the handling of gadgets where the address of the next gadget
has to be inserted in the middle instead of just concatenated to the
end. angrop is now able to set registers if there is a gadget that loads
into the register from the stack, and it can also chain gadgets together
as long as each gadget ends with a jump to an address loaded from the
stack.
Prioritize gadgets that result in fewer register dependencies and
gadgets with less instructions.
There appears to be some kind of memory leak in angr that causes the
memory usage to keep going up during gadget finding. This periodically
restarts the worker processes to work around that.
We don't want to go into SimProcedures when finding gadgets since those
are probably not useful.
Some timeouts are normal such as when finding gadgets, so we shouldn't
always print a message. It's also not that useful to print a timeout
message without more information about where it came from so it makes
more sense to do this in exception handlers instead.
SimSolverModeError gets raised when there's a timeout in claripy.
If gadgets access memory outside of the stack, make sure the addresses
are valid so that it doesn't crash.
Turns out that project.factory.blank_state() initializes the ip to the
entry point instead of making it unconstrained.
gadget.block_length is only the size of the first block.
If a gadget pops a value into a register but the value is used in a
branch condition or memory access address, we can't fully control it so
we remove it from the set of popped registers. This also makes
gadget.constraint_regs include registers that affect memory access
addresses.
Backtrack if we've already seen an equivalent chain that is not longer
than our current chain.
Estimate how hard it is to set a register by counting the number of
gadgets that pop the register, and prioritize gadgets that result in
target registers which are easier to set.
If two registers are popped from the same location on the stack, we can
control either one of them but not both.
The gadget filtering code in RegSetter and RegMover tries to compare
every gadget with every other gadget, so it doesn't scale well when
there are a large number of gadgets. Things seem to work fine without
the filtering so I'm removing it for now.
@Kyle-Kyle Kyle-Kyle mentioned this pull request Jan 24, 2025
@Kyle-Kyle Kyle-Kyle force-pushed the feat/aarch64 branch 6 times, most recently from 4ae0ab9 to a734ef5 Compare January 24, 2025 22:55
@Kyle-Kyle Kyle-Kyle merged commit 4f86ccf into master Jan 24, 2025
27 of 28 checks passed
@Kyle-Kyle Kyle-Kyle deleted the feat/aarch64 branch January 24, 2025 23:25
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.

2 participants