Last active
February 27, 2021 20:15
-
-
Save antichown/12d355e1ab837e3c009fd9d963ec976d to your computer and use it in GitHub Desktop.
Messagebox - API hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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