Native Android Runtime Emulation


GNU General Public License

Why not using the offcial Android emulator

* Slow. An old laptop is pushed to its limit even when running a headless emu.
* Restricted. UDP multicast, for instance, is not supported in emu.
* Broken. The offcial gdbserver erroneously sends SIGILL.
* Bionic. It is the synonym of Broken.

What is offered by this tool

* Full stack support for ELF built by Android NDK.
* Seeminglessly native gdb support.
* Link and load shared library.
* Open to extension of different architecture and C runtime. 


    FILE *fp;
    struct armld ld;
    struct elf *elf;
    struct vm *vm;
    int ret;
    uint32_t args[4] = {0};

    fp = fopen("", "r");

    vm = vm_init();
    elf = elf_load(vm, fp);
    vm_set_elf(vm, elf);

    ld.vm = vm;
    ld.elf = elf;

    /* Thread-friendly printf */

    /* Set breakpoint if needec */
    //vm_set_mem_watch(0x79490, 1);

    /* Set up the arguments of called function */
    args[0] = 1;
    args[1] = 2;

    /* 0xc60 is entry of the called subroutine */
    ret = arm_exec(&ld, 0xc60, 0, args, 4);

    /* ret is return value of called subroutine */
    printf("return: %d\n", ret);

See main.c for an example of loading shared lib.