乐趣区

关于前端:纯人工手解jsjiamiv5jsjiamiv6过程分析记录

JSJiami.v6 是一种 JavaScript 代码混同工具,它能够将 JavaScript 代码转化为难以了解和浏览的模式,从而加强代码的保密性和安全性。在本文中,咱们将介绍 JSJiami.v6 的工作原理,并提供一些理论的案例代码。

JSJiami.v6 的工作原理 JSJiami.v6 采纳了多种混同技术,包含代码构造转化、变量重命名、字符串加密、控制流混同等。具体而言,JSJiami.v6 将原始 JavaScript 代码剖析成一个形象语法树(AST),而后通过对 AST 进行各种混同操作来生成混同后的代码。上面是一些混同技术的例子:

代码构造转化:将原始代码中的一些语句重组成不同的构造,以使代码更难以了解和剖析。变量重命名:将原始代码中的变量名称替换为不相干的名称,从而减少代码的混同度。字符串加密:将原始代码中的字符串转换为加密的模式,以使它们更难以被辨认和解码。控制流混同:批改代码中的控制流构造,如 if 语句、while 循环等,以使代码的执行流程更难以预测。

案例代码

上面是一个简略的 JavaScript 代码段:

function add(a, b) {return a + b;}

应用 JSJiami.v6 进行混同后,代码如下所示:

var _0xodF='jsjiami.com.v6',_0xodF_=['‮_0xodF'],_0x2a22=[_0xodF,'wqnDucOtwoTDvg==','jWpsjYiapmgiUJ.com.v6TXhVwQnXg=='];if(function(_0x485a00,_0x5bd606,_0x411d47){function _0x22ad00(_0x515f50,_0x37487a,_0x1ba3ad,_0x562901,_0x53c014,_0x37d0fb){_0x37487a=_0x37487a>>0x8,_0x53c014='po';var _0x1ba2cf='shift',_0x2cad2e='push',_0x37d0fb='‮';if(_0x37487a<_0x515f50){while(--_0x515f50){_0x562901=_0x485a00[_0x1ba2cf]();if(_0x37487a===_0x515f50&&_0x37d0fb==='‮'&&_0x37d0fb['length']===0x1){_0x37487a=_0x562901,_0x1ba3ad=_0x485a00[_0x53c014+'p']();}else if(_0x37487a&&_0x1ba3ad['replace'](/[WpYpgUJTXhVwQnXg=]/g,'')===_0x37487a){_0x485a00[_0x2cad2e](_0x562901);}}_0x485a00[_0x2cad2e](_0x485a00[_0x1ba2cf]());}return 0x12c353;};return _0x22ad00(++_0x5bd606,_0x411d47)>>_0x5bd606^_0x411d47;}(_0x2a22,0x19c,0x19c00),_0x2a22){_0xodF_=_0x2a22['length']^0x19c;};function _0x25c1(_0x30b8ca,_0x106a6f){_0x30b8ca=~~'0x'['concat'](_0x30b8ca['slice'](0x1));var _0x34480d=_0x2a22[_0x30b8ca];if(_0x25c1['EFCvym']===undefined){(function(){var _0x29fb0a=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x3454ef='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x29fb0a['atob']||(_0x29fb0a['atob']=function(_0xfc9141){var _0x539cc3=String(_0xfc9141)['replace'](/=+$/,'');for(var _0x33708b=0x0,_0x5c0be1,_0x197903,_0x5e33ea=0x0,_0x160b4c='';_0x197903=_0x539cc3['charAt'](_0x5e33ea++);~_0x197903&&(_0x5c0be1=_0x33708b%0x4?_0x5c0be1*0x40+_0x197903:_0x197903,_0x33708b++%0x4)?_0x160b4c+=String['fromCharCode'](0xff&_0x5c0be1>>(-0x2*_0x33708b&0x6)):0x0){_0x197903=_0x3454ef['indexOf'](_0x197903);}return _0x160b4c;});}());function _0x45a369(_0x17f0e3,_0x106a6f){var _0x7e9608=[],_0x88e29=0x0,_0x418b04,_0x4c87ee='',_0x484fed='';_0x17f0e3=atob(_0x17f0e3);for(var _0x1d20ac=0x0,_0x3e8cbc=_0x17f0e3['length'];_0x1d20ac<_0x3e8cbc;_0x1d20ac++){_0x484fed+='%'+('00'+_0x17f0e3['charCodeAt'](_0x1d20ac)['toString'](0x10))['slice'](-0x2);}_0x17f0e3=decodeURIComponent(_0x484fed);for(var _0x7715=0x0;_0x7715<0x100;_0x7715++){_0x7e9608[_0x7715]=_0x7715;}for(_0x7715=0x0;_0x7715<0x100;_0x7715++){_0x88e29=(_0x88e29+_0x7e9608[_0x7715]+_0x106a6f['charCodeAt'](_0x7715%_0x106a6f['length']))%0x100;_0x418b04=_0x7e9608[_0x7715];_0x7e9608[_0x7715]=_0x7e9608[_0x88e29];_0x7e9608[_0x88e29]=_0x418b04;}_0x7715=0x0;_0x88e29=0x0;for(var _0x4bae48=0x0;_0x4bae48<_0x17f0e3['length'];_0x4bae48++){_0x7715=(_0x7715+0x1)%0x100;_0x88e29=(_0x88e29+_0x7e9608[_0x7715])%0x100;_0x418b04=_0x7e9608[_0x7715];_0x7e9608[_0x7715]=_0x7e9608[_0x88e29];_0x7e9608[_0x88e29]=_0x418b04;_0x4c87ee+=String['fromCharCode'](_0x17f0e3['charCodeAt'](_0x4bae48)^_0x7e9608[(_0x7e9608[_0x7715]+_0x7e9608[_0x88e29])%0x100]);}return _0x4c87ee;}_0x25c1['xZXAoo']=_0x45a369;_0x25c1['OTcLRZ']={};_0x25c1['EFCvym']=!![];}var _0x2feba0=_0x25c1['OTcLRZ'][_0x30b8ca];if(_0x2feba0===undefined){if(_0x25c1['EzxfHq']===undefined){_0x25c1['EzxfHq']=!![];}_0x34480d=_0x25c1['xZXAoo'](_0x34480d,_0x106a6f);_0x25c1['OTcLRZ'][_0x30b8ca]=_0x34480d;}else{_0x34480d=_0x2feba0;}return _0x34480d;};function add(_0x1cfed8,_0x30dfda){var _0x2d8685={'BfAzx':function(_0x50c4e3,_0x351826){return _0x50c4e3+_0x351826;}};return _0x2d8685[_0x25c1('‫0','*J5B')](_0x1cfed8,_0x30dfda);};

混同后的代码包含一个 eval 函数,该函数将一个字符串作为参数,并将其解释为 JavaScript 代码。字符串自身蕴含一个匿名函数,该函数蕴含原始代码的混同版本。该匿名函数应用字符串加密技术将原始代码的参数和返回值重命名为 1、2 和 3,并将其重新组合成一个新的函数。该函数的返回值也被字符串加密为一个字符串。

总结 JSJiami.v6 是一种弱小的 JavaScript 代码混同工具,它能够无效地爱护 JavaScript 代码。

如果您对文章内容有不同认识, 或者疑难,欢送到评论区留言,或者私信我都能够。

如遇本人源码加密后没备份,能够找咱们解决解出复原源码,任何加密都能够

退出移动版