Bypass_Debugger

Bypass无限debugger

目前为 2024-12-31 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Bypass_Debugger
  3. // @namespace https://github.com/0xsdeo/Bypass_Debugger
  4. // @version 2024-12-31
  5. // @description Bypass无限debugger
  6. // @author 0xsdeo
  7. // @match http://*/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. let temp_eval = eval;
  17. let temp_toString = Function.prototype.toString;
  18.  
  19. Function.prototype.toString = function () {
  20. if (this === eval) {
  21. return 'function eval() { [native code] }';
  22. } else if (this === Function) {
  23. return 'function Function() { [native code] }';
  24. } else if (this === Function.prototype.toString) {
  25. return 'function toString() { [native code] }';
  26. } else if (this === Function.prototype.constructor) {
  27. return 'function Function() { [native code] }';
  28. }
  29. return temp_toString.apply(this, arguments);
  30. }
  31.  
  32. window.eval = function () {
  33. if (typeof arguments[0] == "string") {
  34. arguments[0] = arguments[0].replaceAll(/debugger/g, '');
  35. }
  36. return temp_eval(...arguments);
  37. }
  38.  
  39. let Bypass_debugger = Function;
  40.  
  41. Function = function () {
  42. for (let i = 0; i < arguments.length; i++) {
  43. if (typeof arguments[i] == "string") {
  44. arguments[i] = arguments[i].replaceAll(/debugger/g, '');
  45. }
  46. }
  47. return Bypass_debugger(...arguments);
  48. }
  49.  
  50. Function.prototype = Bypass_debugger.prototype;
  51.  
  52. Function.prototype.constructor = function () {
  53. for (let i = 0; i < arguments.length; i++) {
  54. if (typeof arguments[i] == "string") {
  55. arguments[i] = arguments[i].replaceAll(/debugger/g, '');
  56. }
  57. }
  58. return Bypass_debugger(...arguments);
  59. }
  60.  
  61. Function.prototype.constructor.prototype = Function.prototype;
  62. })();