PluginBench
Skill
Fail
Audit score 45

frida-17

yfe404/frida-17-skill

Detect and fix Frida 17 API breaking changes in JavaScript scripts.

What is frida-17?

Frida 17 JavaScript API compatibility checker that identifies deprecated APIs removed in Frida 17 (May 2025) and provides correct replacements. Use when writing, reviewing, or migrating Frida scripts to ensure compatibility with static Module/Memory method removals, legacy enumeration APIs, and reserved function name conflicts.

  • Detects removed static Module methods (findBaseAddress, getBaseAddress, findExportByName, enumerateExports, enumerateSymbols) and suggests Process/instance method replacements
  • Identifies static Memory methods (readU32, writeU32) that must be converted to NativePointer instance methods
  • Flags legacy callback-style enumeration APIs (enumerateModules with onMatch/onComplete) that now return arrays directly
  • Warns about reserved function names (hexdump, ptr, NULL) that conflict with built-in Frida functions
  • Provides NativePointer API reference including valid read/write methods, pointer arithmetic, and conversion functions
  • Includes Java byte array handling patterns and common Frida 17 scripting patterns

How to install frida-17

npx skills add https://github.com/yfe404/frida-17-skill --skill frida-17
Prerequisites
  • Frida 17.0.0 or later installed
  • Basic knowledge of Frida JavaScript API and dynamic instrumentation
Claude Code
Cursor
Windsurf
Cline

How to use frida-17

  1. 1.After installing, review your Frida script against the breaking changes checklist in the skill documentation
  2. 2.Replace all static Module.* calls with Process.findModuleByName() or Process.getModuleByName() followed by instance methods
  3. 3.Convert static Memory.read*/write* calls to NativePointer instance methods (e.g., ptr.readU32())
  4. 4.Rename any custom functions conflicting with reserved names (hexdump → dumpHex)
  5. 5.Update legacy Process.enumerateModules() callback patterns to use the new array-based return value
  6. 6.Test the updated script against Frida 17 to verify compatibility

Use cases

Good for
  • Migrating Frida scripts from pre-17 versions to Frida 17 by identifying all breaking API changes
  • Reviewing new Frida scripts to catch deprecated API usage before deployment
  • Fixing runtime errors caused by removed static methods or reserved name conflicts
  • Converting legacy callback-based enumeration code to array-based patterns
  • Validating Java interop code for byte array handling compatibility
Who it's for
  • Mobile security researchers using Frida for Android/iOS instrumentation
  • Reverse engineers writing Frida scripts for dynamic analysis
  • DevSecOps engineers maintaining Frida-based security testing tools
  • Developers migrating existing Frida codebases to Frida 17

frida-17 FAQ

What's the main difference between Module and Process APIs in Frida 17?

Module static methods were removed entirely. Use Process.findModuleByName() or Process.getModuleByName() to get a Module instance, then call methods like .findExportByName() or .enumerateExports() on that instance.

Why can't I use toUInt32() anymore?

toUInt32() never existed in Frida; use toInt32() instead. For values larger than 2^31, use readU64()/writeU64() or convert via toNumber().

How do I handle Java byte arrays with writeByteArray()?

Java byte arrays cannot be passed directly to writeByteArray(). Manually iterate and convert: loop through the array, mask each byte with 0xff, and build a hex string or JavaScript array.

What reserved names will cause 'cannot define variable' errors?

hexdump, ptr, and NULL are built-in Frida functions. Use alternative names like dumpHex for custom functions to avoid conflicts.

How do I wait for a library to load in Frida 17?

Use Process.findModuleByName() in a polling loop with setInterval(). When it returns non-null, the library is loaded and ready to hook.

Full instructions (SKILL.md)

Source of truth, from yfe404/frida-17-skill.


name: frida-17 description: Frida 17 JavaScript API compatibility checker and fixer. Use when writing, reviewing, or fixing Frida scripts, especially when migrating from older Frida versions. Detects deprecated APIs removed in Frida 17 (May 2025) and provides correct replacements. Covers Module, Memory, Process APIs and common naming conflicts.

Frida 17 Scripting Guide

This skill helps write and fix Frida scripts compatible with Frida 17.0.0 (released May 2025).

Breaking Changes in Frida 17

1. Static Module Methods - REMOVED

// OLD - No longer works in Frida 17
Module.findBaseAddress('libriver.so')
Module.getBaseAddress('libriver.so')
Module.findExportByName(null, 'open')
Module.findExportByName('libc.so', 'open')
Module.getExportByName(null, 'open')
Module.ensureInitialized('libc.so')
Module.enumerateExports('libc.so')
Module.enumerateSymbols('libc.so')

// NEW - Use Process and instance methods instead
var lib = Process.findModuleByName('libriver.so');  // returns Module or null
var lib = Process.getModuleByName('libriver.so');   // throws if not found
lib.base                                             // module base address
lib.findExportByName('open')                        // returns address or null
lib.getExportByName('open')                         // throws if not found
lib.enumerateExports()                              // returns array
lib.enumerateSymbols()                              // returns array

2. Static Memory Methods - REMOVED

// OLD - No longer works
Memory.readU32(ptr)
Memory.writeU32(ptr, value)

// NEW - Use NativePointer instance methods
ptr.readU32()
ptr.writeU32(value)

3. Legacy Enumeration APIs - REMOVED

// OLD - Callback style removed
Process.enumerateModules({ onMatch: fn, onComplete: fn })
Process.enumerateModulesSync()

// NEW - Returns array directly
Process.enumerateModules()

4. Reserved Function Names - DO NOT OVERRIDE

The following are built-in Frida functions. Defining custom functions with these names causes: TypeError: cannot define variable 'hexdump'

Reserved names:

  • hexdump - Use dumpHex instead for custom hex dump functions
  • ptr - pointer constructor shorthand
  • NULL - null pointer constant
// BAD - conflicts with built-in
function hexdump(ptr, len) { ... }

// GOOD - use different name
function dumpHex(ptr, len) { ... }

NativePointer Methods (Valid in Frida 17)

Conversion:

  • toInt32() - cast to signed 32-bit integer
  • toNumber() - convert to JavaScript number
  • toString([radix]) - convert to string

NOT available:

  • toUInt32() - DOES NOT EXIST, use toInt32() for sizes < 2^31

Memory reading:

  • readU8(), readS8(), readU16(), readS16()
  • readU32(), readS32(), readU64(), readS64()
  • readByteArray(length) - returns ArrayBuffer
  • readPointer(), readCString(), readUtf8String()

Memory writing:

  • writeU8(value), writeS8(value), etc.
  • writeByteArray(bytes) - bytes must be ArrayBuffer or JS array
  • writePointer(ptr), writeUtf8String(str)

Pointer arithmetic:

  • add(rhs), sub(rhs), and(rhs), or(rhs), xor(rhs)
  • shr(n), shl(n), not()
  • isNull(), equals(rhs), compare(rhs)

Java Bridge API (Unchanged in Frida 17)

Java.perform(function() {
    var MyClass = Java.use('com.example.MyClass');

    // Hook with overload
    MyClass.myMethod.overload('int', 'java.lang.String').implementation = function(a, b) {
        console.log('Called with: ' + a + ', ' + b);
        // Call original
        return this.myMethod.overload('int', 'java.lang.String').call(this, a, b);
    };

    // Hook all overloads
    MyClass.myMethod.overloads.forEach(function(overload) {
        overload.implementation = function() {
            return overload.apply(this, arguments);
        };
    });
});

Java byte[] handling: Java byte arrays cannot be passed directly to Memory.alloc().writeByteArray(). Convert manually:

// BAD - throws "expected a buffer-like object"
var hex = dumpHex(Memory.alloc(javaByteArray.length).writeByteArray(javaByteArray), len);

// GOOD - iterate and convert
var hex = "";
for (var i = 0; i < javaByteArray.length; i++) {
    hex += ("0" + (javaByteArray[i] & 0xff).toString(16)).slice(-2);
}

Common Patterns for Frida 17

Waiting for a library to load

function waitForLibrary(libName, callback) {
    var lib = Process.findModuleByName(libName);
    if (lib) {
        callback(lib.base);
        return;
    }
    var pollInterval = setInterval(function() {
        var lib = Process.findModuleByName(libName);
        if (lib) {
            clearInterval(pollInterval);
            callback(lib.base);
        }
    }, 500);
}

Hooking libc functions

var libc = Process.findModuleByName('libc.so');
var open = libc ? libc.findExportByName('open') : null;
if (open) {
    Interceptor.attach(open, {
        onEnter: function(args) {
            console.log('open(' + args[0].readCString() + ')');
        }
    });
}

Custom hex dump function

function dumpHex(ptr, len) {
    if (!ptr || ptr.isNull()) return 'null';
    try {
        var bytes = ptr.readByteArray(len);
        if (!bytes) return 'null';
        var arr = new Uint8Array(bytes);
        var hex = '';
        for (var i = 0; i < arr.length; i++) {
            hex += ('0' + arr[i].toString(16)).slice(-2);
        }
        return hex;
    } catch (e) {
        return 'error: ' + e;
    }
}

Checklist for Frida 17 Compatibility

When reviewing a Frida script, check for:

  1. Module.findBaseAddress() -> Process.findModuleByName().base
  2. Module.getBaseAddress() -> Process.getModuleByName().base
  3. Module.findExportByName(null, name) -> Process.findModuleByName('libc.so').findExportByName(name)
  4. Module.findExportByName(lib, name) -> Process.findModuleByName(lib).findExportByName(name)
  5. Module.enumerateExports(lib) -> Process.getModuleByName(lib).enumerateExports()
  6. Module.enumerateSymbols(lib) -> Process.getModuleByName(lib).enumerateSymbols()
  7. Memory.readU32(ptr) -> ptr.readU32()
  8. toUInt32() -> toInt32() (toUInt32 never existed)
  9. function hexdump() -> function dumpHex() (name conflict)
  10. Java byte[] with writeByteArray() -> manual hex conversion

References