javascriptmigrationfrida

Frida 17: Module.getExportByName - TypeError: not a function


When using older scripts with Frida 17 and newer you get an error like TypeError: not a function and a line-number that points to a line like

var openFunction = Module.getExportByName(null, "open"); 

What is necessary to migrate such scripts to make them work on Frida 17?


Solution

  • Frida 17 introduced some breaking changes which includes renaming some functions.

    To migrate such scripts you need to apply these changes:

    Frida command before 17 Frida command for 17+
    Module.getGlobalExportByName(null, "open"); Module.getExportByName("open");
    Module.findExportByName(null, "open"); Module.getExportByName("open");
    Module.getSymbolByName(null, 'open') Module.getGlobalExportByName('open')
    Module.getExportByName('libc.so', 'open') Process.getModuleByName('libc.so').getExportByName('open')
    Module.getBaseAddress("libc.so") Process.getModuleByName('libc.so').base
    Memory.readCString(somePtr) somePtr.readCString()
    Memory.readUtf8String(somePtr) somePtr.readUtf8String()
    Memory.readUtf16String(somePtr) somePtr.readUtf16String()
    Memory.readAnsiString(somePtr) somePtr.readAnsiString()
    Memory.readInt(somePtr) somePtr.readInt()
    Memory.writeUInt(somePtr) somePtr.writeUInt()

    See also https://frida.re/news/2025/05/17/frida-17-0-0-released/ and https://frida.re/docs/javascript-api/