我在一个引用如下所示的javascript文件的网站上:
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))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h=[\'.I-l\',\'#f-m\',\'.e-d-f\',\'.e-d-q\',\'.r-1-s\',c.t,c.k];5 g(0){8(0 6 w||0 6 v){y(b a z 0){b 9=0[a];$(9).7()}}8(0 6 E){$(0).7()}}$.G.7=5(){x j.H(\'F\',\'i\').2(\'3-1\',\'4\').2(\'-D-3-1\',\'4\').2(\'-C-3-1\',\'4\').2(\'-B-3-1\',\'4\').i(\'A\',u)};p(o).n(5($){g(h)});',45,45,'elements|select|css|user|none|function|instanceof|tknDisableSelection|if|current|key|var|tknSelectors|videos|recommended|next|tknSetUnselectable|tknUnselectable|on|this|vocabContent|listings|video|ready|document|jQuery|previous|expanded|wrapper|vocabTabList|false|Object|Array|return|for|in|selectstart|ms|moz|webkit|String|unselectable|fn|attr|dialogue'.split('|'),0,{}))
这可能是一个可识别的混淆模式,但我不知道哪一个。
如何将其反转并将其转换为我能阅读的javascript?
答案 0 :(得分:5)
这很简单。它似乎已经装满了类似于"packer"的工具。 jsbeautifier很好地处理它(请注意名为&#34的选项;检测打包器和混淆器?&#34;):
tknUnselectable = ['.dialogue-listings',
'#next-video',
'.recommended-videos-next',
'.recommended-videos-previous',
'.expanded-select-wrapper',
tknSelectors.vocabTabList,
tknSelectors.vocabContent];
function tknSetUnselectable(elements) {
if (elements instanceof Array || elements instanceof Object) {
for (var key in elements) {
var current = elements[key];
$(current).tknDisableSelection()
}
}
if (elements instanceof String) {
$(elements).tknDisableSelection()
}
}
$.fn.tknDisableSelection = function() {
return this.attr('unselectable', 'on')
.css('user-select', 'none')
.css('-webkit-user-select', 'none')
.css('-moz-user-select', 'none')
.css('-ms-user-select', 'none')
.on('selectstart', false)
};
jQuery(document).ready(function($) {
tknSetUnselectable(tknUnselectable)
});