Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/426.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
除臭Javascript十六进制编码变量_Javascript_Deobfuscation - Fatal编程技术网

除臭Javascript十六进制编码变量

除臭Javascript十六进制编码变量,javascript,deobfuscation,Javascript,Deobfuscation,现在简单的十六进制deob很简单,我很好奇是否有一个工具来重命名变量的用法。例如: 是否有一个工具可以从数组中获取变量名,并在代码体中重命名用法?是String.replace(regex,function(found,selected))方法。 h0=$('.de1').text(); h1=h0。拆分(“$”)[0]。拆分(“=”)[1]; h2=h0.切片(h1.长度+12); 评估('ar='+h1); h3=h2.replace(/0x67a5\[(\d*)\]/g,函数(a,b){

现在简单的十六进制deob很简单,我很好奇是否有一个工具来重命名变量的用法。例如:

是否有一个工具可以从数组中获取变量名,并在代码体中重命名用法?

String.replace(regex,function(found,selected))
方法。
h0=$('.de1').text();
h1=h0。拆分(“$”)[0]。拆分(“=”)[1];
h2=h0.切片(h1.长度+12);
评估('ar='+h1);
h3=h2.replace(/0x67a5\[(\d*)\]/g,函数(a,b){return'''+ar[parseInt(b)]+''});
h4=h3.replace(/;(?!=[“])/g,;
).replace(/\\x(..)/g,函数(a,b){return'&x'+b+'})。replace(/\\u(..)/g,函数(a,b){return x'+b+'})。replace(/\u0x(..)/g,函数(a,b){return x'&b'+b'}) $('#abrpm').html(h4);
是。
String.replace(regex,function(found,selected))
方法。
h0=$('.de1').text();
h1=h0。拆分(“$”)[0]。拆分(“=”)[1];
h2=h0.切片(h1.长度+12);
评估('ar='+h1);
h3=h2.replace(/0x67a5\[(\d*)\]/g,函数(a,b){return'''+ar[parseInt(b)]+''});
h4=h3.replace(/;(?!=[“])/g,;
).replace(/\\x(..)/g,函数(a,b){return'&x'+b+'})。replace(/\\u(..)/g,函数(a,b){return x'+b+'})。replace(/\u0x(..)/g,函数(a,b){return x'&b'+b'})
$('abrpm').html(h4)使用此网站,大多数代码都可以格式化并可读:

但是,这会在顶部留下一个巨大的数组,其中包含代码中使用的大多数变量/字符串。要在整个代码中插入其内容,可以使用以下JavaScript搜索和替换每个实例:

for (var i=0; i<keywords.length; i++) {
    if (keywords[i].match(/^[a-zA-Z][a-zA-Z0-9_]*$/)) { // Could be a standalone variable
       // Replace any instances the string is used in an array accessor ['x'] with a dot .x
       code = code.replace(new RegExp('\\['+arrayName+'\\['+i+'\\]\\]','g'),'.'+keywords[i]);
    }
    // Insert as strings throughout code, escaping anything necessary
    code = code.replace(new RegExp(arrayName+'\\['+i+'\\]','g'),'\''+
       keywords[i].replace(/\\/g,'\\\\').replace(/\r/g,'\\r').replace(/\n/g,'\\n').replace(/'/g,'\\\'')+
    '\'');
} console.log(code);

for(var i=0;i使用此网站,大多数代码可以格式化并可读:

但是,这会在顶部留下一个巨大的数组,其中包含代码中使用的大多数变量/字符串。要在整个代码中插入其内容,可以使用以下JavaScript搜索和替换每个实例:

for (var i=0; i<keywords.length; i++) {
    if (keywords[i].match(/^[a-zA-Z][a-zA-Z0-9_]*$/)) { // Could be a standalone variable
       // Replace any instances the string is used in an array accessor ['x'] with a dot .x
       code = code.replace(new RegExp('\\['+arrayName+'\\['+i+'\\]\\]','g'),'.'+keywords[i]);
    }
    // Insert as strings throughout code, escaping anything necessary
    code = code.replace(new RegExp(arrayName+'\\['+i+'\\]','g'),'\''+
       keywords[i].replace(/\\/g,'\\\\').replace(/\r/g,'\\r').replace(/\n/g,'\\n').replace(/'/g,'\\\'')+
    '\'');
} console.log(code);

for(var i=0;i如果使用python,请使用以下方法处理顶部的大数组:

import re
#first open the file and read into the variable 'text'
result = re.sub(r"\\x([0-9A-F]{2})", lambda m: chr(int(m.group(1), 16)), text)

如果使用python,请使用以下方法处理顶部的大数组:

import re
#first open the file and read into the variable 'text'
result = re.sub(r"\\x([0-9A-F]{2})", lambda m: chr(int(m.group(1), 16)), text)

$('.'abrpm').html($('.de1').html().replace(/\\x(..)/g,函数(a,b){return'&#x'+b+'})
虽然这对于去除变量名非常有用,但它并不能解决重命名用法的问题。例如$('.'x3853[12](random);$('.'abrpm').html($('.de1').html()).replace(/\\x(…))/g,函数(a,b)&'.+b+'/''/''.replace($)/g、 (a、b)函数(a、b)返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回返回函数(a,b){return'&#x'+b+'''})。替换(/“/g,“\\”).replace(/“/”/g,“\\”).replace(/“,”/g,“,”));eval($($”).text().replace(/\n/g,).split($”)[0])
$(''abrpm').html($('.de1').html()).replace(/\\x(…)/g,函数(a,b){return和&'x'+b'))
虽然这对于去除变量名非常有用,但它并不能解决重命名用法的问题。例如x3853[12](随机);$('#abrpm').html($('.de1').html().replace(/\\x(..)/g,函数(a,b){return x'+b+'}.replace(/\\u(..)/g,函数(a,b){return x'+b+'.}改名这些用法的难度稍大一点。<代码><<代码><代码>$(#Abrapm)一点稍稍难一点。<代码><<代码>$((ාAbrapm)一点稍难一点。<代码>>$([代码>>)一点.html(h=(h=(1.de1)一段)html.html.html.html.html.html.html..替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.替换.更换.更换.更换.更换.更换.更换.更换.更换.更换.更换.更换.更换.更换..更换.更换.更换.更换.更换.更换..更换.更换.更换..1.替换(/“,”/g,“,”);eval($(“#abrpm”).text().replace(/\n/g').split(“$”)[0])
作为参考,我是这样运行代码的:作为参考,我是这样运行代码的: