A lightweight Android ELF emulation framework for emulating native algorithm.
Project description
Infernum
Infernum is a lightweight Android ELF emulation framework. It is mainly used to emulate native algorithm, so it will not provide JNI environment or file system support. It only supports arch ARM64 for now.
Requirements
- Python 3.7+
Installation
$ pip install infernum
Examples
Load modules and call functions.
from infernum import Infernum
# Initialize emulator
emulator = Infernum()
# Load modules
emulator.load_module("lib64/libz.so")
# Construct arguments
data = b"infernum"
a1 = 0
a2 = emulator.create_buffer(len(data))
a3 = len(data)
emulator.write_bytes(a2, data)
# Call function
result = emulator.call_symbol("crc32", a1, a2, a3)
print(hex(result))
Trace instructions.
from infernum import Infernum
# Trace all instructions.
emulator = Infernum(trace_all_inst=True)
# Trace instructions in this module.
emulator.load_module("lib64/libz.so", trace_inst=True)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
infernum-0.0.1.tar.gz
(9.6 kB
view hashes)
Built Distribution
infernum-0.0.1-py3-none-any.whl
(10.4 kB
view hashes)