Dynamic Instrumentation

Instrument Android at Runtime.

Lightweight ARM64 toolkit for security researchers. Hook functions, manipulate memory, and analyze native code — all without ptrace or TCP.

No ptrace
Unix Domain Sockets
Lua 5.4
renef@android

Why Renef?

Less complexity. More control.

Renef was built for researchers who need something minimal, stealthy, and fully controllable.

Challenge

Heavy frameworks are hard to extend

Our Approach

Minimal and focused — easy to understand and modify

Challenge

TCP communication is easily detected

Our Approach

Unix Domain Sockets — process-level isolation

Challenge

ptrace triggers security checks

Our Approach

memfd + shellcode injection avoids detection

Challenge

Limited control over internals

Our Approach

Full ownership — tweak anything you want

Architecture

How Renef Works

A lightweight client-server architecture with memfd-based injection.

Client CLI

macOS / Linux

Server

Android ARM64

Target Process

libagent.so + Lua

ADB:1907
memfd + shellcode
1

Client connects via TCP port 1907 (ADB-forwarded) to the server running on Android

2

Server injects payload using memfd + shellcode — no ptrace required

3

libagent.so executes Lua scripts inside the target process context

Features

Everything you need for ARM64 analysis

A focused toolkit with the capabilities that matter most.

Native Hooking

PLT/GOT and inline trampoline hooks for ARM64. Intercept any native function with Capstone-based disassembly.

Memory Operations

Scan, read, write, and patch memory at runtime. Search for patterns and modify values on the fly.

Lua Scripting

Embedded Lua 5.4 engine with intuitive API. Write powerful instrumentation scripts with minimal boilerplate.

Java Hooks

JNI-based Java method interception. Hook Java methods without touching the native layer.

Stealth Mode

memfd + shellcode injection avoids ptrace. Unix Domain Sockets instead of TCP for on-device communication.

Interactive TUI

Text-based UI for memory scanning operations. Real-time feedback and interactive exploration.

Use Cases

Real-world applications

Battle-tested techniques for security research and reverse engineering.

SSL Pinning Bypass

Intercept and modify certificate validation to analyze encrypted traffic.

hook("SSL_CTX_set_verify", {
  onEnter: (args) => {
    args[1] = SSL_VERIFY_NONE
  }
})
View example

Root Detection Bypass

Hook detection methods to return false and run on rooted devices.

hook("isRooted", {
  onLeave: (retval) => {
    retval.replace(0)
  }
})
View example

Crypto Key Logger

Capture encryption keys at runtime before they're used.

hook("AES_set_encrypt_key", {
  onEnter: (args) => {
    console.log(Memory.read(args[0], 32))
  }
})
View example

Function Tracer

Log all calls to specific functions with arguments and return values.

hook("open", {
  onEnter: (args) => {
    console.log("open:", Memory.readCString(args[0]))
  }
})
View example

Memory Scanner

Find and modify values in memory with pattern matching.

Memory.scan(base, size, "48 65 6c 6c 6f", {
  onMatch: (addr) => {
    console.log("Found at:", addr)
  }
})
View example

Getting Started

Up and running in minutes

Clone, build, and start instrumenting Android apps.

Terminal
# Clone and build
git clone https://github.com/Ahmeth4n/renef
cd renef && make
# Push server to device
adb push server /data/local/tmp/
adb shell chmod +x /data/local/tmp/server
# Start server on device
adb shell /data/local/tmp/server &
# Forward port
adb forward tcp:1907 localabstract:renef
# Connect and start instrumenting
./renef -s com.byteria.keepsafe

Requires: macOS or Linux, ADB, Android device with ARM64 architecture

Ready to instrument?

Renef is open source and free to use. Dive into the code, contribute features, or just use it in your security research.

Open Source
ARM64 Native
Lua Scripting
No ptrace