frida-core
frida-core copied to clipboard
[SERIOUS BUG] frida.InvalidOperationError: script has been destroyed
This problem has wasted me totally 48 hours in front of the screen doing useless trials and errors. Nothing worked, it gave no useful errors at all, just destroyed.
const fReadFilePtr = Module.getExportByName("kernel32", "ReadFile");
const fReadFileParamTypes = ['pointer', 'pointer', 'uint32', 'pointer', 'pointer'];
const fReadFile = new NativeFunction(fReadFilePtr, 'bool', fReadFileParamTypes);
Interceptor.replace(fReadFilePtr, new NativeCallback((a1, a2, a3, a4, a5) => {
console.log('enter ReadFile, #' + args[0]);
return fReadFile(a1, a2, a3, a4, a5);
}, 'bool', fReadFileParamTypes));