Last active
January 9, 2025 06:27
-
-
Save Esonhugh/379835e3d44f5689f1a687486bdf0c52 to your computer and use it in GitHub Desktop.
Chrome content script - Current environment hooks and debug tool for reversing js on website. Released on https://update.greasyfork.org/scripts/523279/ConsoleHook.user.js
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
<html> | |
<head> | |
<title>Playground of hooks</title> | |
<script src="/hook.js"></script> | |
</head> | |
<body> | |
<script> | |
// console.hooks.hookfunc(console, "log") | |
obj = { | |
keyA: "As", | |
KeyB: 1231213123, | |
func: () => { | |
return "123231" | |
}, | |
func2: (res) => { | |
return res + 1 | |
} | |
} | |
// obj = console.hooks.hookValueViaProxy("objx", obj) | |
obj.keyA | |
obj.Key = "C" | |
obj.KeyB = "1231" | |
// console.hooks.hookValueViaGetSet("objx",obj, "Key") | |
obj.keyA = "12312" | |
obj.Key = "B" | |
obj.Key = "C" | |
console.log(obj.func()) | |
console.hooks.hookfunc(obj, "func", function (res) { | |
let [ret, originalFunction, arguments, env] = res; | |
return "114514" | |
}) | |
console.log(obj.func()) | |
setInterval(function () { | |
console.log("debugger!"); | |
debugger | |
}, 123); | |
console.hooks.hookfunc(obj, "func2", ()=>{}, (res)=>{ | |
let [originalFunction, arguments, t] = res; | |
var handler = arguments[0]; | |
console.log(handler) | |
return [123] | |
}) | |
obj.func2(12); | |
function re(){ Function["constructor"]("return () => {debugger}")["call"]("action")} | |
setInterval(re, 123); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment