Skip to content
This repository was archived by the owner on Nov 29, 2021. It is now read-only.
This repository was archived by the owner on Nov 29, 2021. It is now read-only.

Unicorn stops emulation when PC = 0x00 #16

@bspdev

Description

@bspdev

Hello,

I recently opened an issue in the Unicorn repository (unicorn-engine#1383), but I believe my problem comes from the AFLplusplus implementation.

My problem is that when I emulate ARM code, unicorn stops when the address 0 is reached.
I tried calling directly to unicorn with uc_emu_start(uc, start_addr, 0, 0, 0) and I got the same behavior, but then calling uc_emu_start(uc, start_addr, 0x12345678, 0, 0) it did NOT stopped at 0x0.

My guess is that uc_afl_emu_start() is eventually passing 0 as third parameter (until) and that's why the emulation stopped. However, I tried to identify that code in the source without success. I see that uc_afl_emu_start() executes uc->vm_start(uc), which if I am not mistaken, is in qemu/cpus.c:44.

I naively expected to find a call like uc_emu_start(uc, addr, 0, xx, xx).
I would like to ask you, how can I prevent AFLplusplus to stop emulation at address 0?
My new guess is that addr_end within struct uc_struct is zero. If that's the case, I can't find a way to modify that variable from the outside since its definition is not exposed.

Thank you in advance and congratulations for the great work done on this project, it is really impressive and useful.

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