Skip to content

Suppressing UC_ERR_EXCEPTION when invalid instruction is handled in hook UC_HOOK_INSN_INVALID #2098

@HclX

Description

@HclX

Hi,
I'm emulating some ARM firmware code and noticed that unicorn can not emulate 'msr' or 'mrs' and other 'platform specific' instructions. My solution is to use hook UC_HOOK_INSN_INVALID, and inside of the hook function, I manually emulate the behavior of these instructions, and adjust pc to skip them. However, even if I return "true" from the hook function, the emulation still throws UC_ERR_EXCEPTION. Is there a way to avoid execution flow interruption because of this?

I'm using unicorn-2.1.1 with python binding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions