Debugging AMSI with Frida
Overview
Debugging AMSI with Frida
Interceptor.attach(Module.findExportByName("amsi.dll", "AmsiScanBuffer"), {
onEnter: function(args) {
this.buffer = args[1];
this.size = args[2].toInt32();
this.ascii = Memory.readUtf16String(this.buffer, this.size);
this.amsiSession = args[4];
this.result = args[5];
console.log("[*] AmsiScanBuffer()" + "\n | [AMSI] Buffer size: " + this.size + "\n | ASCII: " + this.ascii + "\n | [AMSI] Session: " + this.amsiSession);
},
onLeave: function(retval) {
console.log("[*] AmsiScanBuffer() Exit\n | [AMSI] Result: " + Memory.readUShort(this.result) + "\n\n");
}
});
Executing frida

Last updated