Javascript模糊处理的新功能。。为什么不执行?

Javascript模糊处理的新功能。。为什么不执行?,javascript,html,obfuscation,deobfuscation,Javascript,Html,Obfuscation,Deobfuscation,我正在尝试运行一些已经混淆的Java脚本,但由于某些原因,什么都没有发生。。。我的文件名为test2.js,其中包含以下代码: eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c

我正在尝试运行一些已经混淆的Java脚本,但由于某些原因,什么都没有发生。。。我的文件名为test2.js,其中包含以下代码:

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('L 6;6=\'p\';r c A(){1.2("3").0=""q(6<B){1.2("h").0+="C. s I o n k? I u l m 5 p <4>"}y q(6>w){1.2("h").0+="x D!. s I o n k? I u l m 5 6 <4>"}1.2("3").0+="<a 9=\'#\' 7=\'g();\'>e i, j d 5 f</a><4>"1.2("3").0+="<a 9=\'#\' 7=\'g();\'>e i, j d 5 f</a><4>"8 b}c g(){1.2("3").0=""1.2("h").0+="e i, j d 5 f<4>";1.2("3").0+="<a 9=\'#\' 7=\'v();\'>z H</a><4>"8 b}c v(){1.2("3").0=""1.2("3").0+="<a 9=\'#\' 7=\'t();\'>E M K J, F G?</a><4>"8 b}c t(){1.2("3").0=""8 b}',49,49,'innerHTML|document|getElementById|NPCResponseWindow|br|is|GetCharHP|onclick|return|href||false|function|name|Hi|Player|nicetomeetyou|NPCTalkWindow|NPC|my|today|your|HP|you|help|399|if||Can|END|see|Beginnings2|450|Go|else|Same|Beginnings|400|Hello|away|Lets|shall|we|here||again|this|var|do'.split('|')))
eval(函数(p,a,c,k,e,d){e=function(c){return(c

但是除了开始对话外,什么也没有出现。有什么帮助吗?我做错了什么?

正如所料,它们是未混淆代码上的错误:

var GetCharHP;
GetCharHP = '399';
r    // there is an error here, add the ;
function Beginnings() {
    document.getElementById("NPCResponseWindow").innerHTML = ""
    if (GetCharHP < 400) {
        document.getElementById("NPCTalkWindow").innerHTML += "Hello. Can I help you today? I see your HP is 399 <br>"
    } else if (GetCharHP > 450) {
        document.getElementById("NPCTalkWindow").innerHTML += "Go away!. Can I help you today? I see your HP is GetCharHP <br>"
    }
    document.getElementById("NPCResponseWindow").innerHTML += "<a href='#' onclick='nicetomeetyou();'>Hi NPC, my name is Player</a><br>"
    document.getElementById("NPCResponseWindow").innerHTML += "<a href='#' onclick='nicetomeetyou();'>Hi NPC, my name is Player</a><br>"
    return false
}

function nicetomeetyou() {
    document.getElementById("NPCResponseWindow").innerHTML = ""
    document.getElementById("NPCTalkWindow").innerHTML += "Hi NPC, my name is Player<br>";
    document.getElementById("NPCResponseWindow").innerHTML += "<a href='#' onclick='Beginnings2();'>Same here</a><br>"
    return false
}

function Beginnings2() {
    document.getElementById("NPCResponseWindow").innerHTML = ""
    document.getElementById("NPCResponseWindow").innerHTML += "<a href='#' onclick='END();'>Lets do this again, shall we?</a><br>"
    return false
}

function END() {
    document.getElementById("NPCResponseWindow").innerHTML = ""
    return false
}
var-GetCharHP;
GetCharHP='399';
r//此处有错误,请添加;
函数开始(){
document.getElementById(“NPCressponseWindow”).innerHTML=“”
如果(GetCharHP<400){
document.getElementById(“NPCTalkWindow”).innerHTML+=“您好,今天有什么可以帮您的吗?我看到您的HP is 399
” }否则如果(GetCharHP>450){ document.getElementById(“NPCTalkWindow”).innerHTML+=“走开!”。今天我能帮你吗?我看到你的HP是GetCharHP
” } document.getElementById(“npresponseWindow”).innerHTML+=“
” document.getElementById(“npresponseWindow”).innerHTML+=“
” 返回错误 } 函数nicetometyou(){ document.getElementById(“NPCressponseWindow”).innerHTML=“” document.getElementById(“NPCTalkWindow”).innerHTML+=“你好,我的名字是Player
”; document.getElementById(“npresponseWindow”).innerHTML+=“
” 返回错误 } 函数beginings2(){ document.getElementById(“NPCressponseWindow”).innerHTML=“” document.getElementById(“npresponseWindow”).innerHTML+=“
” 返回错误 } 函数结束(){ document.getElementById(“NPCressponseWindow”).innerHTML=“” 返回错误 }
并将doctype添加到HTML中 并在文件末尾移动脚本(仅在前面)
你不能隐藏javascript代码,很容易与在线服务混淆

猜测:将脚本标记移到文件末尾。可能代码使用的元素不存在,当它执行时,它确实是混淆,这会破坏代码?在混淆之前你调试过吗?混淆的脚本容易出错rs检查您浏览器的控制台日志。如果您只是想最小化文件大小,只需将其丑化并启用gzip压缩即可。如果您想保密,请不要将其发送给客户端。我不是想隐藏它,只是让新手更难找到它代码。在这一点上,客户端执行对我来说不起作用。在混淆代码之前,我确实尝试过代码,它起到了很好的效果。我还将脚本移到了最后。仍然没有。感谢到目前为止的建议/评论。“我不是想隐藏它,只是让新手更难找到代码。”---这没有任何意义。
r//这里有一个错误,添加;
Doctype、分号并移动到文件的末尾就是这样做的。多亏了你们大家!@zerkms,用户混淆了代码,我想混淆器可能会将所有代码强制放在一行,并且在混淆之前忘记添加自动分号。@ArnaudGueras那么如何
r;
r
好?这是完全相同的语句。
实际上什么都没有改变。我知道,这只是一个假设,他的混淆器可能会导致错误。但我知道同样的事情,只要你用一个有缺陷的迷你器最小化你的代码,它不会以
结束所有的行。
var GetCharHP;
GetCharHP = '399';
r    // there is an error here, add the ;
function Beginnings() {
    document.getElementById("NPCResponseWindow").innerHTML = ""
    if (GetCharHP < 400) {
        document.getElementById("NPCTalkWindow").innerHTML += "Hello. Can I help you today? I see your HP is 399 <br>"
    } else if (GetCharHP > 450) {
        document.getElementById("NPCTalkWindow").innerHTML += "Go away!. Can I help you today? I see your HP is GetCharHP <br>"
    }
    document.getElementById("NPCResponseWindow").innerHTML += "<a href='#' onclick='nicetomeetyou();'>Hi NPC, my name is Player</a><br>"
    document.getElementById("NPCResponseWindow").innerHTML += "<a href='#' onclick='nicetomeetyou();'>Hi NPC, my name is Player</a><br>"
    return false
}

function nicetomeetyou() {
    document.getElementById("NPCResponseWindow").innerHTML = ""
    document.getElementById("NPCTalkWindow").innerHTML += "Hi NPC, my name is Player<br>";
    document.getElementById("NPCResponseWindow").innerHTML += "<a href='#' onclick='Beginnings2();'>Same here</a><br>"
    return false
}

function Beginnings2() {
    document.getElementById("NPCResponseWindow").innerHTML = ""
    document.getElementById("NPCResponseWindow").innerHTML += "<a href='#' onclick='END();'>Lets do this again, shall we?</a><br>"
    return false
}

function END() {
    document.getElementById("NPCResponseWindow").innerHTML = ""
    return false
}