Bypass_Debugger

Bypass无限debugger

  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. // @run-at document-start
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. let temp_eval = eval;
  18. let temp_toString = Function.prototype.toString;
  19.  
  20. Function.prototype.toString = function () {
  21. if (this === eval) {
  22. return 'function eval() { [native code] }';
  23. } else if (this === Function) {
  24. return 'function Function() { [native code] }';
  25. } else if (this === Function.prototype.toString) {
  26. return 'function toString() { [native code] }';
  27. } else if (this === Function.prototype.constructor) {
  28. return 'function Function() { [native code] }';
  29. }
  30. return temp_toString.apply(this, arguments);
  31. }
  32.  
  33. window.eval = function () {
  34. if (typeof arguments[0] == "string") {
  35. arguments[0] = arguments[0].replaceAll(/debugger/g, '');
  36. }
  37. return temp_eval(...arguments);
  38. }
  39.  
  40. let Bypass_debugger = Function;
  41.  
  42. Function = function () {
  43. for (let i = 0; i < arguments.length; i++) {
  44. if (typeof arguments[i] == "string") {
  45. arguments[i] = arguments[i].replaceAll(/debugger/g, '');
  46. }
  47. }
  48. return Bypass_debugger(...arguments);
  49. }
  50.  
  51. Function.prototype = Bypass_debugger.prototype;
  52.  
  53. Function.prototype.constructor = function () {
  54. for (let i = 0; i < arguments.length; i++) {
  55. if (typeof arguments[i] == "string") {
  56. arguments[i] = arguments[i].replaceAll(/debugger/g, '');
  57. }
  58. }
  59. return Bypass_debugger(...arguments);
  60. }
  61.  
  62. Function.prototype.constructor.prototype = Function.prototype;
  63. })();