Skip to main content

Infernum

build PyPI PyPI - Python Version GitHub license

Infernum is a lightweight Android native library emulation framework based on Unicorn. It is mainly used to execute the encryption algorithm, so it doesn't provide JNI or file system support. It supports arch ARM and ARM64.

Requirements

  • Python 3.7+
  • Unicorn 2.0.0+

Installation

$ pip install infernum

Usage

Load modules and call functions.

from infernum import Infernum
from infernum.const import ARCH_ARM64

# Initialize emulator
emulator = Infernum(ARCH_ARM64)

# Load modules
emulator.load_module("lib64/libz.so")

# Construct arguments
data = b"infernum"

v1 = emulator.create_buffer(len(data))
v2 = len(data)

emulator.write_bytes(v1, data)

# Call function by symbol
emulator.call_symbol("crc32", 0, v1, v2)

# Call function by address
symbol = emulator.find_symbol("crc32")
emulator.call_address(symbol.address, 0, v1, v2)

Emulate arch ARM.

from infernum import Infernum
from infernum.const import ARCH_ARM

emulator = Infernum(ARCH_ARM)

Read/Write data.

# Create buffer
v1 = emulator.create_buffer(64)
v2 = emulator.create_string("infernum")

# Write data
emulator.write_int(v1, 1)
emulator.write_bytes(v1, b"infernum")
emulator.write_string(v2, "infernum")

# Read data
emulator.read_int(v1)
emulator.read_bytes(v1, 8)
emulator.read_string(v2)

Hook instructions.

def hook_code(uc, address, size, user_data):
    emu = user_data["emulator"]

symbol = emulator.find_symbol("zlibVersion")
emulator.add_hook(symbol.address, hook_code)

Trace instructions.

# Trace all instructions
emulator = Infernum(ARCH_ARM64, trace_inst=True)

# Trace instructions in this module
emulator.load_module("lib64/libz.so", trace_inst=True)

Execute initialization functions in section .init_array.

emulator.load_module("lib64/libsample1.so", exec_init_array=True)

Metadata

Release files for infernum 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for infernum 0.1.1
File Size Uploaded Provenance Actions
infernum-0.1.1.tar.gz 12.7 kB Without provenance Details for infernum-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for infernum 0.1.1
File Interpreter ABI Platform Actions
infernum-0.1.1-py3-none-any.whl Python 3 none any Details for infernum-0.1.1-py3-none-any.whl

Total release size: 26.2 kB

Release files / infernum-0.1.1.tar.gz

Download URL infernum-0.1.1.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cb0d19509e2d81a8fd7a97856f9cc1b49626768aa3186f51b45c448465b62c05
BLAKE2b-256 checksum
How to use checksums
240e3e7ab9cd1d06d02f8ac972d01ece8fc5ba51c78e383067a24306c98eadca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / infernum-0.1.1-py3-none-any.whl

Download URL infernum-0.1.1-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d431ac998f7c54b8c6cb601f4cf6efa9e110576635247b728e04226fc6a7e57
BLAKE2b-256 checksum
How to use checksums
cfa4091d2ae9b4ff9d1ce0dd32c35b5a505ce5811c616bb977297b6ece446509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for infernum 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page