Renef v0.3.7


New: Memory Allocation API

The Memory global gained a full allocation lifecycle so scripts can build buffers, structs, and strings to feed back into hooks and native/Java calls — no more borrowing existing regions or hand-rolling mmap.

  • Memory.alloc(size [, prot]) — Allocate a fresh anonymous region (page-rounded) and return its base address. prot is an r/w/x string, default "rw-".
  • Memory.allocStr(str) — Allocate a region and copy a NUL-terminated string into it, returning its base address. Shortcut for alloc + write.
  • Memory.protect(addr, size, prot) — Change page protection on an existing region (page-rounded, same as Memory.patch).
  • Memory.free(addr [, size]) — Release a region from alloc/allocStr. The size is looked up automatically from an internal allocation registry, so you normally pass only the address.
local p = Memory.alloc(64, "rwx")   -- executable scratch buffer
Memory.writeU32(p, 0xD503201F)      -- ARM64 NOP

local path = Memory.allocStr("/system/bin/sh")
-- ... pass `path` as a char* argument to a hooked function ...

Memory.free(path)                    -- size resolved automatically
Memory.free(p)

Allocations are tracked in an internal registry so Memory.free(addr) works without the caller remembering the size. Lua API calls are serialized under the agent’s Lua mutex, so the registry needs no extra locking.

See the Memory API reference for full details.


Improved: la No Longer Requires Injection

The la (list apps) command now queries the device package manager directly through renef_server, matching frida-ps -Uai. Previously it required a target PID and forwarded the request into an injected agent — so you had to spawn or attach to an app before you could even list apps.

  • Works with only renef_server running — no spawn, attach, or injection needed
  • Runs on-device in the server process (root), streaming results straight back to the client
  • ~filter substring matching and a Total: N packages summary are preserved
  • Output no longer carries the raw package: prefix

Back to top

Renef - Dynamic Instrumentation Toolkit for Android