[unicorn-engine] Re: Using unicorn to replace houdini on Android

  • From: Michael Goffioul <michael.goffioul@xxxxxxxxx>
  • To: unicorn-engine@xxxxxxxxxxxxx
  • Date: Wed, 23 Oct 2019 17:09:00 -0400

On Tue, Oct 22, 2019 at 11:15 PM Michael Goffioul <
michael.goffioul@xxxxxxxxx> wrote:

I've also created a repo for the native bridge layer:
https://github.com/goffioul/android_nativebridge_x86
It's mostly some initial plumbing at the moment (most of it coming from
AndroidNativeEmu). The thing I will struggle the most at the moment is to
implement symbol table generation and relocations.  The Android app I'm
testing with uses dynamic relocation and that's not part of
AndroidNativeEmu. I would really appreciate if you could give a hand there:
pseudo-code snippets are enough, I'll get the idea.


Instead of reimplementing a full dynamic linker, I'm experimenting with an
alternate route: using AndroidNativeEmu, I just load 'linker' and
'libdl.so' into the emulator memory, then call 'dlopen' to open the target
native library. At the moment, it chokes on this instruction (or near it,
anyway):

# Tracing instruction at 0xcbbd6fb4, instruction size = 0x4, instruction =
00 0b d0 ed

Objdump of the linker code (based at 0xcbbcb000) shows the surrounding code
as:

    bfac:       eb029bd4        bl      b2f04 <rtld_db_dlactivity+0x8cfa0>
    bfb0:       e5901008        ldr     r1, [r0, #8]
    bfb4:       edd00b00        vldr    d16, [r0]
    bfb8:       edc70b05        vstr    d16, [r7, #20]
    bfbc:       e587101c        str     r1, [r7, #28]

Is there a problem with the "vldr" instruction?

Other related posts: