这是js代码 由于代码混淆了 要分析出来/thread-354129-1-1.html?_dsign=3183fa78这个链接 我用别的软件调试了js代码没问题 不知道为什么python执行了显示错误
js代码:
var location = {
href: function ($url) {
console.log($url)
},
assign: function ($url) {
console.log($url)
},
replace: function ($url) {
console.log($url)
}
}
function LNm() {
'return LNm';
return 'l?'
}
OgF = function(OgF_) {
var _O = function(OgF_) {
'return OgF';
return OgF_;
};
return _O(OgF_);
};
_zn0Pw = location;
function WjWx(WjWx_) {
function htm() {
return getName();
};
return htm();
return 'WjWx'
}
_WzyE0 = 'replace';
orq = function(orq_) {
'return orq';
return orq_;
};
uY = '3';
function D0() {
'return D0';
return '4'
}
function kJFm() {
'kJFm';
function _k() {
return '129'
};
return _k();
}
r1 = '1';
Mf = function() {
'Mf';
var _M = function() {
return '-'
};
return _M();
};
CP9P = function() {
'CP9P';
var _C = function() {
return 'fa7'
};
return _C();
};
_oyQzX = 'href';
Ge = 'r';
cp = '/';
DP = function() {
'DP';
var _D = function() {
return '-'
};
return _D();
};
function ju() {
'ju';
function _j() {
return '1'
};
return _j();
}
function getName() {
var caller = getName.caller;
if (caller.name) {
return caller.name
}
var str = String().replace(/[s]*/g, "");
var name = str.match(/^function([^(]+?)(/);
if (name && name[1]) {
return name[1];
} else {
return '';
}
}
CL = function() {
'CL';
var _C = function() {
return '-'
};
return _C();
};
_CzT4j = window;
_JPh6d = 'assign';
location[_WzyE0](cp + 'th' + Ge + 'ea' + (function() {
'return ZI';
return (function() {
return 'd';
})();
})() + DP() + orq('35') + D0() + kJFm() + CL() + ju() + Mf() + OgF('1.') + WjWx('jM9P') + LNm() + (function(dbo_) {
return (function(dbo_) {
return dbo_;
})(dbo_);
})('_d') + (function() {
'return fa';
return (function() {
return 's';
})();
})() + (function() {
'return B52h';
return (function() {
return 'ign';
})();
})() + (function(CaH_) {
'return CaH';
return CaH_
})('=3') + r1 + (function() {
'return mH';
return (function() {
return '8';
})();
})() + uY + CP9P() + (function(mM6_) {
return (function(mM6_) {
return mM6_;
})(mM6_);
})('8'));
_CzT4j['href'] = cp + 'th' + Ge + 'ea' + (function() {
'return ZI';
return (function() {
return 'd';
})();
})() + DP() + orq('35') + D0();
python3代码
import js2py
data=open('sjtest.js','r',encoding= 'utf8').read()
data=js2py.eval_js(data)
print(data)
python3执行后出错的内容:
Traceback (most recent call last):
File "C:UsersXiaomaDesktopSource codetest.py", line 34, in
data=js2py.eval_js(data)
File "D:Program Files (x86)Python37-32libsite-packagesjs2pyevaljs.py", line 115, in eval_js
return e.eval(js)
File "D:Program Files (x86)Python37-32libsite-packagesjs2pyevaljs.py", line 204, in eval
File "D:Program Files (x86)Python37-32libsite-packagesjs2pyevaljs.py", line 199, in execute
exec (compiled, self._context)
File "", line 4, in
File "", line 3, in PyJs_LONG_0_
File "D:Program Files (x86)Python37-32libsite-packagesjs2pybase.py", line 949, in __call__
return self.call(self.GlobalObject, args)
File "D:Program Files (x86)Python37-32libsite-packagesjs2pybase.py", line 1464, in call
return de(*args))
File "D:Program Files (x86)Python37-32libsite-packagesjs2pyhostjseval.py", line 45, in Eval
executor(py_code)
File "D:Program Files (x86)Python37-32libsite-packagesjs2pyhostjseval.py", line 51, in executor
exec (code, globals())
File "", line 267, in
File "", line 241, in PyJs_LONG_20_
File "D:Program Files (x86)Python37-32libsite-packagesjs2pybase.py", line 949, in __call__
return self.call(self.GlobalObject, args)
File "D:Program Files (x86)Python37-32libsite-packagesjs2pybase.py", line 1464, in call
return de(*args))
File "", line 23, in PyJsHoisted_WjWx_
File "D:Program Files (x86)Python37-32libsite-packagesjs2pybase.py", line 949, in __call__
return self.call(self.GlobalObject, args)
File "D:Program Files (x86)Python37-32libsite-packagesjs2pybase.py", line 1464, in call
return de(*args))
File "", line 18, in PyJsHoisted_htm_
File "D:Program Files (x86)Python37-32libsite-packagesjs2pybase.py", line 949, in __call__
return self.call(self.GlobalObject, args)
File "D:Program Files (x86)Python37-32libsite-packagesjs2pybase.py", line 1464, in call
return de(*args))
File "", line 74, in PyJsHoisted_getName_
File "D:Program Files (x86)Python37-32libsite-packagesjs2pybase.py", line 322, in get
'Undefined and null dont have properties (tried getting property %s)' % repr(prop))
js2py.internals.simplex.JsException: TypeError: Undefined and null dont have properties (tried getting property 'name')
本文发布于:2024-01-28 21:07:52,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170644727710292.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |