Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 8x 8x 50x 50x 50x 50x 50x 50x 8x 44x | import SparkMD5 from "spark-md5"; export const anonymizeGBVMScript = (input: string): string => { const functionNameMatch = input.match(/_([^:\s]*)::/); Iif (!functionNameMatch) return input; const functionName = functionNameMatch[1]; const globalReferencePattern = new RegExp(functionName, "gm"); const placeholderReferencePattern = new RegExp( "__PLACEHOLDER\\|" + functionName + "[^|]*\\|PLACEHOLDER__", "gm" ); return input .replace(globalReferencePattern, "SCRIPT") .replace(/^(.globl |)(GBVM\$|GBVM_END\$).*$/gm, "") // Strip debugger comments .replace(placeholderReferencePattern, "SCRIPT"); // Strip recursive placeholders }; export const gbvmScriptChecksum = (input: string): string => { return SparkMD5.hash(anonymizeGBVMScript(input)); }; |