DebufProtectionFunctionCallTemplate.ts 597 B

123456789101112131415161718
  1. /**
  2. * @returns {string}
  3. */
  4. export function DebugProtectionFunctionCallTemplate (): string {
  5. return `
  6. (function () {
  7. var regExp1 = new RegExp('function *\\\\( *\\\\)');
  8. var regExp2 = new RegExp('\\\\+\\\\+ *\\(?:_0x([a-f0-9]){4,6}|\\\\b[a-zA-Z]{1,2}\\\\b\\)');
  9. var result = {debugProtectionFunctionName}('init');
  10. if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {
  11. result('0');
  12. } else {
  13. {debugProtectionFunctionName}();
  14. }
  15. })();
  16. `;
  17. }