Skip to content

Instantly share code, notes, and snippets.

@antichown
Last active February 27, 2021 20:15
Show Gist options
  • Save antichown/12d355e1ab837e3c009fd9d963ec976d to your computer and use it in GitHub Desktop.
Save antichown/12d355e1ab837e3c009fd9d963ec976d to your computer and use it in GitHub Desktop.
Messagebox - API hook
Test Breakpoint
bpx MessageBoxW
'use strict';
var msgbox=Module.getExportByName('user32.dll','MessageBoxW');
Interceptor.attach(msgbox , {
onEnter: function(args) {
console.log("Handle",args[0]);
console.log("Text",args[1].readUtf16String());
console.log("Caption",args[2].readUtf16String());
console.log("Type",args[3]);
args[1].writeUtf16String("AAAA");
},
onLeave: function(retval) {
console.log("leaving");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment