-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathHook_Function.js
65 lines (58 loc) · 2.13 KB
/
Hook_Function.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// ==UserScript==
// @name Hook_Function
// @namespace http://tampermonkey.net/
// @version 2024-12-04
// @description Bypass new Function --> debugger && constructor --> debugger
// @author 0xsdeo
// @match http://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function () {
'use strict';
var Bypass_debugger = Function;
var temp_toString = Function.prototype.toString;
Function.prototype.toString = function () {
if (this === Function) {
return 'function Function() { [native code] }';
}
else if (this === Function.prototype.toString) {
return 'function toString() { [native code] }';
}
return temp_toString.apply(this, arguments);
}
Function = function () {
var reg = /debugger/;
for (var i = 0; i < arguments.length; i++) {
if (typeof arguments[i] == "string") {
var temp_length = arguments[i].match(/debugger/g);
if (temp_length != null) {
temp_length = temp_length.length;
while (temp_length) {
arguments[i] = arguments[i].replace(reg, "");
temp_length--;
}
}
}
}
return Bypass_debugger(...arguments);
}
Function.prototype = Bypass_debugger.prototype;
Function.prototype.constructor = function () {
var reg = /debugger/;
for (var i = 0; i < arguments.length; i++) {
if (typeof arguments[i] == "string") {
var temp_length = arguments[i].match(/debugger/g);
if (temp_length != null) {
temp_length = temp_length.length;
while (temp_length) {
arguments[i] = arguments[i].replace(reg, "");
temp_length--;
}
}
}
}
return Bypass_debugger(...arguments);
}
Function.prototype.constructor.prototype = Function.prototype;
})();