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?
Frida 17 introduced some breaking changes, which includes refactoring some of these functions.
To migrate such scripts, you will need to apply these changes, if/where applicable:
| Frida command before 17 | Frida command for 17+ |
|---|---|
Module.getGlobalExportByName(null, 'open'); |
Module.getGlobalExportByName('open'); |
Module.findExportByName(null, "open"); |
Module.findGlobalExportByName('open'); |
Module.getSymbolByName(null, 'open') |
Module.getGlobalExportByName('open') |
Module.findExportByName(null, 'open'); |
Module.findGlobalExportByName("open"); |
Module.findExportByName('libc.so', 'open') |
Process.getModuleByName('libc.so').findExportByName('open') |
Module.getExportByName('libc.so', 'open') |
Process.getModuleByName('libc.so').getExportByName('open') |
Module.getBaseAddress('libc.so') |
Process.getModuleByName('libc.so').base |
Memory.readByteArray(somePtr, someLength); |
somePtr.readByteArray(someLength); |
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