1. Qinglai Xiao
  2. armexec

Overview

HTTPS SSH
Native Android Runtime Emulation
================================

License
-------

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. 

ABC
---

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

    fp = fopen("your_shared_lib.so", "r");

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

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

    /* Thread-friendly printf */
    setbuf(stdout,NULL);
    setbuf(stderr,NULL);

    /* Set breakpoint if needec */
    //exec_set_breakpoint(0xc62);
    //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.