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

msp430: Unify br and jump behaviour #71

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Conversation

Gert-JanG
Copy link
Contributor

Example

init_state.inspect.b('exit', when=angr.BP_BEFORE, action=check_jump)

def check_jump(state):
    addr = state.regs.ip

For jmp, jz, ... instructions 'addr' will contain the value of ip BEFORE THE JMP instruction as they only execute self.jump(...) (https://github.com/angr/angr-platforms/blob/master/angr_platforms/msp430/instrs_msp430.py#L933)

For a branch instruction https://github.com/angr/angr-platforms/blob/master/angr_platforms/msp430/instrs_msp430.py#L660-L661, a value (src) will be returned, which will trigger an immediate commit (https://github.com/angr/pyvex/blob/master/pyvex/lifting/util/instr_helper.py#L132-L134).

In the example above, the br instruction will thus immediately commit the result to the ip, so the 'addr' will contain the ip AFTER THE BR instruction (so 'addr' will contain the ip after the br)

@Gert-JanG Gert-JanG changed the title Unify br and jump behaviour msp430: Unify br and jump behaviour Jun 27, 2024
@twizmwazin twizmwazin merged commit 369ed3c into angr:master Jun 27, 2024
13 checks passed
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