13
GitHub - maiyao1988/ExAndroidNativeEmu: An improved version of AndroidNativeEmu,...
source link: https://github.com/maiyao1988/ExAndroidNativeEmu
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
ExAndroidNativeEmu
This a personal improved version of AndroidNativeEmu.Allow running android elf code on pc.
Difference between AndroidNativeEmu
- Rewrite memory mapping module, fully support jemalloc
- More debug utils, pretty printing for instruction and memory.
- Some misc bug fix
- Stop all runing when getting exception instead of just skiping one emulator runing for easily bug detecting...
- Support ELF DT_INIT call
- Auto Load dependency so.
- auto generate /proc/[pid]/maps according to current memory map
- fix R_ARM_ABS32 relocation bug.
TODO
- Simulate linker TLS initialization.
- Support well known virtual file like /proc/self/maps...
- Get rid of dependency on Section Header when loading ELF.
Usage
In the future this will be possible through pypi.
Make sure you are using python 3.7.
- Clone the repository
- Run
pip install -r requirements.txt
- Run
python example_jni.py
If you have trouble getting the
keystone-engine
dependency on Windows (as I did):
- Clone their repository
- Open a terminal in
bindings/python
- Run
python setup.py install
(Make sure you are using python 3.7)- Download their
Windows - Core engine
package here for your python arch.- Put the
keystone.dll
inC:\location_to_python\Lib\site-packages\keystone\
.
Dependencies
Text sources
- https://greek0.net/elf.html
- https://stackoverflow.com/questions/13908276/loading-elf-file-in-c-in-user-space
- https://programtalk.com/python-examples/pyelftools.elftools.elf.relocation.Relocation/
- http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf
- https://wiki.osdev.org/ELF_Tutorial
- https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html
- https://android.googlesource.com/platform/dalvik/+/donut-release/vm/Jni.c
Code sources
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK