mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-20 10:25:01 +08:00
first commit
This commit is contained in:
commit
6f0002de3d
208
3-代码包/MD5JS/md5.js
Normal file
208
3-代码包/MD5JS/md5.js
Normal file
@ -0,0 +1,208 @@
|
||||
var _0xafb7 = ['0123456789abcdef', 'charAt', 'length', 'abc', '900150983cd24fb0d6963f7d28e17f72', 'concat', 'charCodeAt', '0123456789ABCDEF'];
|
||||
(function (_0x1d2076, _0x2a7e5a) {
|
||||
var _0x6ffefc = function (_0x3ddd21) {
|
||||
while (--_0x3ddd21) {
|
||||
_0x1d2076['push'](_0x1d2076['shift']());
|
||||
}
|
||||
};
|
||||
_0x6ffefc(++_0x2a7e5a);
|
||||
}(_0xafb7, 0x132));
|
||||
var _0x4f75 = function (_0x254029, _0x1d4b71) {
|
||||
_0x254029 = _0x254029 - 0x0;
|
||||
var _0x18b07e = _0xafb7[_0x254029];
|
||||
return _0x18b07e;
|
||||
};
|
||||
var hexcase = 0x0;
|
||||
var b64pad = '';
|
||||
var chrsz = 0x8;
|
||||
|
||||
function hex_md5(_0x3066e8) {
|
||||
return binl2hex(core_md5(str2binl(_0x3066e8), _0x3066e8[_0x4f75('0x0')] * chrsz));
|
||||
}
|
||||
|
||||
function b64_md5(_0x3e6d2a) {
|
||||
return binl2b64(core_md5(str2binl(_0x3e6d2a), _0x3e6d2a[_0x4f75('0x0')] * chrsz));
|
||||
}
|
||||
|
||||
function str_md5(_0x299d77) {
|
||||
return binl2str(core_md5(str2binl(_0x299d77), _0x299d77[_0x4f75('0x0')] * chrsz));
|
||||
}
|
||||
|
||||
function hex_hmac_md5(_0x527dc3, _0x2917f0) {
|
||||
return binl2hex(core_hmac_md5(_0x527dc3, _0x2917f0));
|
||||
}
|
||||
|
||||
function b64_hmac_md5(_0xef9e7f, _0x59c8eb) {
|
||||
return binl2b64(core_hmac_md5(_0xef9e7f, _0x59c8eb));
|
||||
}
|
||||
|
||||
function str_hmac_md5(_0x281d11, _0x378864) {
|
||||
return binl2str(core_hmac_md5(_0x281d11, _0x378864));
|
||||
}
|
||||
|
||||
function md5_vm_test() {
|
||||
return hex_md5(_0x4f75('0x1')) == _0x4f75('0x2');
|
||||
}
|
||||
|
||||
function core_md5(_0x22ee7b, _0x5112e5) {
|
||||
_0x22ee7b[_0x5112e5 >> 0x5] |= 0x80 << _0x5112e5 % 0x20;
|
||||
_0x22ee7b[(_0x5112e5 + 0x40 >>> 0x9 << 0x4) + 0xe] = _0x5112e5;
|
||||
var _0x24dc11 = 0x67452301;
|
||||
var _0x4d8080 = -0x10325477;
|
||||
var _0x5a0e38 = -0x67452302;
|
||||
var _0x1bea03 = 0x10325476;
|
||||
for (var _0x19201a = 0x0; _0x19201a < _0x22ee7b['length']; _0x19201a += 0x10) {
|
||||
var _0x5690f3 = _0x24dc11;
|
||||
var _0x278f34 = _0x4d8080;
|
||||
var _0x39995b = _0x5a0e38;
|
||||
var _0x43e134 = _0x1bea03;
|
||||
_0x24dc11 = md5_ff(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x0], 0x7, -0x28955b88);
|
||||
_0x1bea03 = md5_ff(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x1], 0xc, -0x173848aa);
|
||||
_0x5a0e38 = md5_ff(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0x2], 0x11, 0x242070db);
|
||||
_0x4d8080 = md5_ff(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x3], 0x16, -0x3e423112);
|
||||
_0x24dc11 = md5_ff(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x4], 0x7, -0xa83f051);
|
||||
_0x1bea03 = md5_ff(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x5], 0xc, 0x4787c62a);
|
||||
_0x5a0e38 = md5_ff(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0x6], 0x11, -0x57cfb9ed);
|
||||
_0x4d8080 = md5_ff(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x7], 0x16, -0x2b96aff);
|
||||
_0x24dc11 = md5_ff(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x8], 0x7, 0x698098d8);
|
||||
_0x1bea03 = md5_ff(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x9], 0xc, -0x74bb0851);
|
||||
_0x5a0e38 = md5_ff(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0xa], 0x11, -0xa44f);
|
||||
_0x4d8080 = md5_ff(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0xb], 0x16, -0x76a32842);
|
||||
_0x24dc11 = md5_ff(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0xc], 0x7, 0x6b901122);
|
||||
_0x1bea03 = md5_ff(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0xd], 0xc, -0x2678e6d);
|
||||
_0x5a0e38 = md5_ff(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0xe], 0x11, -0x5986bc72);
|
||||
_0x4d8080 = md5_ff(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0xf], 0x16, 0x49b40821);
|
||||
_0x24dc11 = md5_gg(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x1], 0x5, -0x9e1da9e);
|
||||
_0x1bea03 = md5_gg(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x6], 0x9, -0x3fbf4cc0);
|
||||
_0x5a0e38 = md5_gg(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0xb], 0xe, 0x265e5a51);
|
||||
_0x4d8080 = md5_gg(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x0], 0x14, -0x16493856);
|
||||
_0x24dc11 = md5_gg(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x5], 0x5, -0x29d0efa3);
|
||||
_0x1bea03 = md5_gg(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0xa], 0x9, 0x2441453);
|
||||
_0x5a0e38 = md5_gg(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0xf], 0xe, -0x275e197f);
|
||||
_0x4d8080 = md5_gg(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x4], 0x14, -0x182c0438);
|
||||
_0x24dc11 = md5_gg(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x9], 0x5, 0x21e1cde6);
|
||||
_0x1bea03 = md5_gg(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0xe], 0x9, -0x3cc8f82a);
|
||||
_0x5a0e38 = md5_gg(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0x3], 0xe, -0xb2af279);
|
||||
_0x4d8080 = md5_gg(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x8], 0x14, 0x455a14ed);
|
||||
_0x24dc11 = md5_gg(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0xd], 0x5, -0x561c16fb);
|
||||
_0x1bea03 = md5_gg(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x2], 0x9, -0x3105c08);
|
||||
_0x5a0e38 = md5_gg(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0x7], 0xe, 0x676f02d9);
|
||||
_0x4d8080 = md5_gg(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0xc], 0x14, -0x72d5b376);
|
||||
_0x24dc11 = md5_hh(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x5], 0x4, -0x5c6be);
|
||||
_0x1bea03 = md5_hh(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x8], 0xb, -0x788e097f);
|
||||
_0x5a0e38 = md5_hh(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0xb], 0x10, 0x6d9d6122);
|
||||
_0x4d8080 = md5_hh(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0xe], 0x17, -0x21ac7f4);
|
||||
_0x24dc11 = md5_hh(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x1], 0x4, -0x5b4115bc);
|
||||
_0x1bea03 = md5_hh(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x4], 0xb, 0x4bdecfa9);
|
||||
_0x5a0e38 = md5_hh(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0x7], 0x10, -0x944b4a0);
|
||||
_0x4d8080 = md5_hh(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0xa], 0x17, -0x41404390);
|
||||
_0x24dc11 = md5_hh(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0xd], 0x4, 0x289b7ec6);
|
||||
_0x1bea03 = md5_hh(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x0], 0xb, -0x155ed806);
|
||||
_0x5a0e38 = md5_hh(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0x3], 0x10, -0x2b10cf7b);
|
||||
_0x4d8080 = md5_hh(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x6], 0x17, 0x4881d05);
|
||||
_0x24dc11 = md5_hh(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x9], 0x4, -0x262b2fc7);
|
||||
_0x1bea03 = md5_hh(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0xc], 0xb, -0x1924661b);
|
||||
_0x5a0e38 = md5_hh(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0xf], 0x10, 0x1fa27cf8);
|
||||
_0x4d8080 = md5_hh(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x2], 0x17, -0x3b53a99b);
|
||||
_0x24dc11 = md5_ii(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x0], 0x6, -0xbd6ddbc);
|
||||
_0x1bea03 = md5_ii(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x7], 0xa, 0x432aff97);
|
||||
_0x5a0e38 = md5_ii(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0xe], 0xf, -0x546bdc59);
|
||||
_0x4d8080 = md5_ii(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x5], 0x15, -0x36c5fc7);
|
||||
_0x24dc11 = md5_ii(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0xc], 0x6, 0x655b59c3);
|
||||
_0x1bea03 = md5_ii(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0x3], 0xa, -0x70f3336e);
|
||||
_0x5a0e38 = md5_ii(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0xa], 0xf, -0x100b83);
|
||||
_0x4d8080 = md5_ii(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x1], 0x15, -0x7a7ba22f);
|
||||
_0x24dc11 = md5_ii(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x8], 0x6, 0x6fa87e4f);
|
||||
_0x1bea03 = md5_ii(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0xf], 0xa, -0x1d31920);
|
||||
_0x5a0e38 = md5_ii(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0x6], 0xf, -0x5cfebcec);
|
||||
_0x4d8080 = md5_ii(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0xd], 0x15, 0x4e0811a1);
|
||||
_0x24dc11 = md5_ii(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03, _0x22ee7b[_0x19201a + 0x4], 0x6, -0x8ac817e);
|
||||
_0x1bea03 = md5_ii(_0x1bea03, _0x24dc11, _0x4d8080, _0x5a0e38, _0x22ee7b[_0x19201a + 0xb], 0xa, -0x42c50dcb);
|
||||
_0x5a0e38 = md5_ii(_0x5a0e38, _0x1bea03, _0x24dc11, _0x4d8080, _0x22ee7b[_0x19201a + 0x2], 0xf, 0x2ad7d2bb);
|
||||
_0x4d8080 = md5_ii(_0x4d8080, _0x5a0e38, _0x1bea03, _0x24dc11, _0x22ee7b[_0x19201a + 0x9], 0x15, -0x14792c6f);
|
||||
_0x24dc11 = safe_add(_0x24dc11, _0x5690f3);
|
||||
_0x4d8080 = safe_add(_0x4d8080, _0x278f34);
|
||||
_0x5a0e38 = safe_add(_0x5a0e38, _0x39995b);
|
||||
_0x1bea03 = safe_add(_0x1bea03, _0x43e134);
|
||||
}
|
||||
return Array(_0x24dc11, _0x4d8080, _0x5a0e38, _0x1bea03);
|
||||
}
|
||||
|
||||
function md5_cmn(_0x13da99, _0x4e97a4, _0x35d420, _0x2be282, _0x30ef48, _0x31cceb) {
|
||||
return safe_add(bit_rol(safe_add(safe_add(_0x4e97a4, _0x13da99), safe_add(_0x2be282, _0x31cceb)), _0x30ef48), _0x35d420);
|
||||
}
|
||||
|
||||
function md5_ff(_0x3470ed, _0xb5effa, _0x477770, _0x33e34f, _0x356226, _0x13dc1d, _0x1e29c9) {
|
||||
return md5_cmn(_0xb5effa & _0x477770 | ~_0xb5effa & _0x33e34f, _0x3470ed, _0xb5effa, _0x356226, _0x13dc1d, _0x1e29c9);
|
||||
}
|
||||
|
||||
function md5_gg(_0x489772, _0x4cd15b, _0x53464d, _0x48aa94, _0x6a0a55, _0x12dbfb, _0x410e93) {
|
||||
return md5_cmn(_0x4cd15b & _0x48aa94 | _0x53464d & ~_0x48aa94, _0x489772, _0x4cd15b, _0x6a0a55, _0x12dbfb, _0x410e93);
|
||||
}
|
||||
|
||||
function md5_hh(_0x2fb64f, _0x38b15b, _0x102f48, _0x3dc19b, _0x5e25aa, _0x3ae390, _0x89e2fc) {
|
||||
return md5_cmn(_0x38b15b ^ _0x102f48 ^ _0x3dc19b, _0x2fb64f, _0x38b15b, _0x5e25aa, _0x3ae390, _0x89e2fc);
|
||||
}
|
||||
|
||||
function md5_ii(_0x1a821d, _0x1e15bd, _0x2e26e7, _0x1a3729, _0x3ef1a2, _0x32fa53, _0x163466) {
|
||||
return md5_cmn(_0x2e26e7 ^ (_0x1e15bd | ~_0x1a3729), _0x1a821d, _0x1e15bd, _0x3ef1a2, _0x32fa53, _0x163466);
|
||||
}
|
||||
|
||||
function core_hmac_md5(_0x5d2cea, _0x5c190a) {
|
||||
var _0x4e64d3 = str2binl(_0x5d2cea);
|
||||
if (_0x4e64d3[_0x4f75('0x0')] > 0x10) _0x4e64d3 = core_md5(_0x4e64d3, _0x5d2cea['length'] * chrsz);
|
||||
var _0x33c231 = Array(0x10), _0xe018a = Array(0x10);
|
||||
for (var _0x5f0b9b = 0x0; _0x5f0b9b < 0x10; _0x5f0b9b++) {
|
||||
_0x33c231[_0x5f0b9b] = _0x4e64d3[_0x5f0b9b] ^ 0x36363636;
|
||||
_0xe018a[_0x5f0b9b] = _0x4e64d3[_0x5f0b9b] ^ 0x5c5c5c5c;
|
||||
}
|
||||
var _0x30e59b = core_md5(_0x33c231[_0x4f75('0x3')](str2binl(_0x5c190a)), 0x200 + _0x5c190a[_0x4f75('0x0')] * chrsz);
|
||||
return core_md5(_0xe018a[_0x4f75('0x3')](_0x30e59b), 0x200 + 0x80);
|
||||
}
|
||||
|
||||
function safe_add(_0x3f936b, _0x452433) {
|
||||
var _0x2830ca = (_0x3f936b & 0xffff) + (_0x452433 & 0xffff);
|
||||
var _0x558dbe = (_0x3f936b >> 0x10) + (_0x452433 >> 0x10) + (_0x2830ca >> 0x10);
|
||||
return _0x558dbe << 0x10 | _0x2830ca & 0xffff;
|
||||
}
|
||||
|
||||
function bit_rol(_0x4ae01b, _0x223c0d) {
|
||||
return _0x4ae01b << _0x223c0d | _0x4ae01b >>> 0x20 - _0x223c0d;
|
||||
}
|
||||
|
||||
function str2binl(_0x5c42d1) {
|
||||
var _0x18b049 = Array();
|
||||
var _0x4fdd09 = (0x1 << chrsz) - 0x1;
|
||||
for (var _0x3fe83f = 0x0; _0x3fe83f < _0x5c42d1[_0x4f75('0x0')] * chrsz; _0x3fe83f += chrsz) _0x18b049[_0x3fe83f >> 0x5] |= (_0x5c42d1[_0x4f75('0x4')](_0x3fe83f / chrsz) & _0x4fdd09) << _0x3fe83f % 0x20;
|
||||
return _0x18b049;
|
||||
}
|
||||
|
||||
function binl2str(_0xf5e77a) {
|
||||
var _0x2c8aff = '';
|
||||
var _0x4a565 = (0x1 << chrsz) - 0x1;
|
||||
for (var _0x24957b = 0x0; _0x24957b < _0xf5e77a[_0x4f75('0x0')] * 0x20; _0x24957b += chrsz) _0x2c8aff += String['fromCharCode'](_0xf5e77a[_0x24957b >> 0x5] >>> _0x24957b % 0x20 & _0x4a565);
|
||||
return _0x2c8aff;
|
||||
}
|
||||
|
||||
function binl2hex(_0x2a8297) {
|
||||
var _0x15a7cb = hexcase ? _0x4f75('0x5') : _0x4f75('0x6');
|
||||
var _0x1be29d = '';
|
||||
for (var _0x112c2f = 0x0; _0x112c2f < _0x2a8297[_0x4f75('0x0')] * 0x4; _0x112c2f++) {
|
||||
_0x1be29d += _0x15a7cb['charAt'](_0x2a8297[_0x112c2f >> 0x2] >> _0x112c2f % 0x4 * 0x8 + 0x4 & 0xf) + _0x15a7cb[_0x4f75('0x7')](_0x2a8297[_0x112c2f >> 0x2] >> _0x112c2f % 0x4 * 0x8 & 0xf);
|
||||
}
|
||||
return _0x1be29d;
|
||||
}
|
||||
|
||||
function binl2b64(_0x1f399a) {
|
||||
var _0x4657e3 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
var _0x3409f2 = '';
|
||||
for (var _0x54da0a = 0x0; _0x54da0a < _0x1f399a[_0x4f75('0x0')] * 0x4; _0x54da0a += 0x3) {
|
||||
var _0x71178d = (_0x1f399a[_0x54da0a >> 0x2] >> 0x8 * (_0x54da0a % 0x4) & 0xff) << 0x10 | (_0x1f399a[_0x54da0a + 0x1 >> 0x2] >> 0x8 * ((_0x54da0a + 0x1) % 0x4) & 0xff) << 0x8 | _0x1f399a[_0x54da0a + 0x2 >> 0x2] >> 0x8 * ((_0x54da0a + 0x2) % 0x4) & 0xff;
|
||||
for (var _0x33e70d = 0x0; _0x33e70d < 0x4; _0x33e70d++) {
|
||||
if (_0x54da0a * 0x8 + _0x33e70d * 0x6 > _0x1f399a[_0x4f75('0x0')] * 0x20) _0x3409f2 += b64pad; else _0x3409f2 += _0x4657e3[_0x4f75('0x7')](_0x71178d >> 0x6 * (0x3 - _0x33e70d) & 0x3f);
|
||||
}
|
||||
}
|
||||
return _0x3409f2;
|
||||
}
|
||||
|
||||
console.log(hex_md5("NightTeam"));
|
14
3-代码包/NodeServer/client.py
Normal file
14
3-代码包/NodeServer/client.py
Normal file
@ -0,0 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @时间 : 2019-12-15 14:31
|
||||
# @作者 : 陈祥安
|
||||
# @文件名 : client.py
|
||||
# @公众号: Python学习开发
|
||||
import requests
|
||||
|
||||
url = "http://127.0.0.1:3000/get_num"
|
||||
|
||||
data = {
|
||||
"a": 1, "b": 2
|
||||
}
|
||||
req = requests.post(url,data)
|
||||
print(req.text)
|
15
3-代码包/NodeServer/client2.py
Normal file
15
3-代码包/NodeServer/client2.py
Normal file
@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @时间 : 2019-12-15 14:31
|
||||
# @作者 : 陈祥安
|
||||
# @文件名 : client.py
|
||||
# @公众号: Python学习开发
|
||||
import requests
|
||||
|
||||
|
||||
url = "http://127.0.0.1:3000/crypto"
|
||||
|
||||
data = {
|
||||
"user": "liming", "password": "1234qwer"
|
||||
}
|
||||
req = requests.post(url,data)
|
||||
print(req.text)
|
766
3-代码包/NodeServer/crypto.js
Normal file
766
3-代码包/NodeServer/crypto.js
Normal file
@ -0,0 +1,766 @@
|
||||
var CryptoJS = function (o, e) {
|
||||
var h = {}
|
||||
, g = h.lib = {}
|
||||
, z = function () {
|
||||
}
|
||||
, y = g.Base = {
|
||||
extend: function (b) {
|
||||
z.prototype = this;
|
||||
var d = new z;
|
||||
b && d.mixIn(b);
|
||||
d.hasOwnProperty("init") || (d.init = function () {
|
||||
d.$super.init.apply(this, arguments)
|
||||
}
|
||||
);
|
||||
d.init.prototype = d;
|
||||
d.$super = this;
|
||||
return d
|
||||
},
|
||||
create: function () {
|
||||
var b = this.extend();
|
||||
b.init.apply(b, arguments);
|
||||
return b
|
||||
},
|
||||
init: function () {
|
||||
},
|
||||
mixIn: function (b) {
|
||||
for (var d in b) {
|
||||
b.hasOwnProperty(d) && (this[d] = b[d])
|
||||
}
|
||||
b.hasOwnProperty("toString") && (this.toString = b.toString)
|
||||
},
|
||||
clone: function () {
|
||||
return this.init.prototype.extend(this)
|
||||
}
|
||||
}
|
||||
, a = g.WordArray = y.extend({
|
||||
init: function (b, d) {
|
||||
b = this.words = b || [];
|
||||
this.sigBytes = d != e ? d : 4 * b.length
|
||||
},
|
||||
toString: function (b) {
|
||||
return (b || m).stringify(this)
|
||||
},
|
||||
concat: function (b) {
|
||||
var p = this.words
|
||||
, n = b.words
|
||||
, l = this.sigBytes;
|
||||
b = b.sigBytes;
|
||||
this.clamp();
|
||||
if (l % 4) {
|
||||
for (var d = 0; d < b; d++) {
|
||||
p[l + d >>> 2] |= (n[d >>> 2] >>> 24 - 8 * (d % 4) & 255) << 24 - 8 * ((l + d) % 4)
|
||||
}
|
||||
} else {
|
||||
if (65535 < n.length) {
|
||||
for (d = 0; d < b; d += 4) {
|
||||
p[l + d >>> 2] = n[d >>> 2]
|
||||
}
|
||||
} else {
|
||||
p.push.apply(p, n)
|
||||
}
|
||||
}
|
||||
this.sigBytes += b;
|
||||
return this
|
||||
},
|
||||
clamp: function () {
|
||||
var b = this.words
|
||||
, d = this.sigBytes;
|
||||
b[d >>> 2] &= 4294967295 << 32 - 8 * (d % 4);
|
||||
b.length = o.ceil(d / 4)
|
||||
},
|
||||
clone: function () {
|
||||
var b = y.clone.call(this);
|
||||
b.words = this.words.slice(0);
|
||||
return b
|
||||
},
|
||||
random: function (b) {
|
||||
for (var l = [], d = 0; d < b; d += 4) {
|
||||
l.push(4294967296 * o.random() | 0)
|
||||
}
|
||||
return new a.init(l, b)
|
||||
}
|
||||
})
|
||||
, k = h.enc = {}
|
||||
, m = k.Hex = {
|
||||
stringify: function (b) {
|
||||
var p = b.words;
|
||||
b = b.sigBytes;
|
||||
for (var n = [], l = 0; l < b; l++) {
|
||||
var d = p[l >>> 2] >>> 24 - 8 * (l % 4) & 255;
|
||||
n.push((d >>> 4).toString(16));
|
||||
n.push((d & 15).toString(16))
|
||||
}
|
||||
return n.join("")
|
||||
},
|
||||
parse: function (b) {
|
||||
for (var n = b.length, l = [], d = 0; d < n; d += 2) {
|
||||
l[d >>> 3] |= parseInt(b.substr(d, 2), 16) << 24 - 4 * (d % 8)
|
||||
}
|
||||
return new a.init(l, n / 2)
|
||||
}
|
||||
}
|
||||
, i = k.Latin1 = {
|
||||
stringify: function (b) {
|
||||
var n = b.words;
|
||||
b = b.sigBytes;
|
||||
for (var l = [], d = 0; d < b; d++) {
|
||||
l.push(String.fromCharCode(n[d >>> 2] >>> 24 - 8 * (d % 4) & 255))
|
||||
}
|
||||
return l.join("")
|
||||
},
|
||||
parse: function (b) {
|
||||
for (var n = b.length, l = [], d = 0; d < n; d++) {
|
||||
l[d >>> 2] |= (b.charCodeAt(d) & 255) << 24 - 8 * (d % 4)
|
||||
}
|
||||
return new a.init(l, n)
|
||||
}
|
||||
}
|
||||
, j = k.Utf8 = {
|
||||
stringify: function (b) {
|
||||
try {
|
||||
return decodeURIComponent(escape(i.stringify(b)))
|
||||
} catch (d) {
|
||||
throw Error("Malformed UTF-8 data")
|
||||
}
|
||||
},
|
||||
parse: function (b) {
|
||||
return i.parse(unescape(encodeURIComponent(b)))
|
||||
}
|
||||
}
|
||||
, c = g.BufferedBlockAlgorithm = y.extend({
|
||||
reset: function () {
|
||||
this._data = new a.init;
|
||||
this._nDataBytes = 0
|
||||
},
|
||||
_append: function (b) {
|
||||
"string" == typeof b && (b = j.parse(b));
|
||||
this._data.concat(b);
|
||||
this._nDataBytes += b.sigBytes
|
||||
},
|
||||
_process: function (l) {
|
||||
var t = this._data
|
||||
, s = t.words
|
||||
, p = t.sigBytes
|
||||
, n = this.blockSize
|
||||
, d = p / (4 * n)
|
||||
, d = l ? o.ceil(d) : o.max((d | 0) - this._minBufferSize, 0);
|
||||
l = d * n;
|
||||
p = o.min(4 * l, p);
|
||||
if (l) {
|
||||
for (var r = 0; r < l; r += n) {
|
||||
this._doProcessBlock(s, r)
|
||||
}
|
||||
r = s.splice(0, l);
|
||||
t.sigBytes -= p
|
||||
}
|
||||
return new a.init(r, p)
|
||||
},
|
||||
clone: function () {
|
||||
var b = y.clone.call(this);
|
||||
b._data = this._data.clone();
|
||||
return b
|
||||
},
|
||||
_minBufferSize: 0
|
||||
});
|
||||
g.Hasher = c.extend({
|
||||
cfg: y.extend(),
|
||||
init: function (b) {
|
||||
this.cfg = this.cfg.extend(b);
|
||||
this.reset()
|
||||
},
|
||||
reset: function () {
|
||||
c.reset.call(this);
|
||||
this._doReset()
|
||||
},
|
||||
update: function (b) {
|
||||
this._append(b);
|
||||
this._process();
|
||||
return this
|
||||
},
|
||||
finalize: function (b) {
|
||||
b && this._append(b);
|
||||
return this._doFinalize()
|
||||
},
|
||||
blockSize: 16,
|
||||
_createHelper: function (b) {
|
||||
return function (d, l) {
|
||||
return (new b.init(l)).finalize(d)
|
||||
}
|
||||
},
|
||||
_createHmacHelper: function (b) {
|
||||
return function (d, l) {
|
||||
return (new f.HMAC.init(b, l)).finalize(d)
|
||||
}
|
||||
}
|
||||
});
|
||||
var f = h.algo = {};
|
||||
return h
|
||||
}(Math);
|
||||
(function () {
|
||||
var a = CryptoJS
|
||||
, b = a.lib.WordArray;
|
||||
a.enc.Base64 = {
|
||||
stringify: function (j) {
|
||||
var e = j.words
|
||||
, i = j.sigBytes
|
||||
, g = this._map;
|
||||
j.clamp();
|
||||
j = [];
|
||||
for (var h = 0; h < i; h += 3) {
|
||||
for (var c = (e[h >>> 2] >>> 24 - 8 * (h % 4) & 255) << 16 | (e[h + 1 >>> 2] >>> 24 - 8 * ((h + 1) % 4) & 255) << 8 | e[h + 2 >>> 2] >>> 24 - 8 * ((h + 2) % 4) & 255, f = 0; 4 > f && h + 0.75 * f < i; f++) {
|
||||
j.push(g.charAt(c >>> 6 * (3 - f) & 63))
|
||||
}
|
||||
}
|
||||
if (e = g.charAt(64)) {
|
||||
for (; j.length % 4;) {
|
||||
j.push(e)
|
||||
}
|
||||
}
|
||||
return j.join("")
|
||||
},
|
||||
parse: function (k) {
|
||||
var f = k.length
|
||||
, i = this._map
|
||||
, h = i.charAt(64);
|
||||
h && (h = k.indexOf(h),
|
||||
-1 != h && (f = h));
|
||||
for (var h = [], j = 0, e = 0; e < f; e++) {
|
||||
if (e % 4) {
|
||||
var g = i.indexOf(k.charAt(e - 1)) << 2 * (e % 4)
|
||||
, c = i.indexOf(k.charAt(e)) >>> 6 - 2 * (e % 4);
|
||||
h[j >>> 2] |= (g | c) << 24 - 8 * (j % 4);
|
||||
j++
|
||||
}
|
||||
}
|
||||
return b.create(h, j)
|
||||
},
|
||||
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
||||
}
|
||||
}
|
||||
)();
|
||||
(function (k) {
|
||||
function c(d, s, l, r, q, p, o) {
|
||||
d = d + (s & l | ~s & r) + q + o;
|
||||
return (d << p | d >>> 32 - p) + s
|
||||
}
|
||||
|
||||
function f(d, s, l, r, q, p, o) {
|
||||
d = d + (s & r | l & ~r) + q + o;
|
||||
return (d << p | d >>> 32 - p) + s
|
||||
}
|
||||
|
||||
function e(d, s, l, r, q, p, o) {
|
||||
d = d + (s ^ l ^ r) + q + o;
|
||||
return (d << p | d >>> 32 - p) + s
|
||||
}
|
||||
|
||||
function n(d, s, l, r, q, p, o) {
|
||||
d = d + (l ^ (s | ~r)) + q + o;
|
||||
return (d << p | d >>> 32 - p) + s
|
||||
}
|
||||
|
||||
for (var m = CryptoJS, a = m.lib, i = a.WordArray, j = a.Hasher, a = m.algo, g = [], h = 0; 64 > h; h++) {
|
||||
g[h] = 4294967296 * k.abs(k.sin(h + 1)) | 0
|
||||
}
|
||||
a = a.MD5 = j.extend({
|
||||
_doReset: function () {
|
||||
this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878])
|
||||
},
|
||||
_doProcessBlock: function (J, L) {
|
||||
for (var U = 0; 16 > U; U++) {
|
||||
var T = L + U
|
||||
, S = J[T];
|
||||
J[T] = (S << 8 | S >>> 24) & 16711935 | (S << 24 | S >>> 8) & 4278255360
|
||||
}
|
||||
var U = this._hash.words
|
||||
, T = J[L + 0]
|
||||
, S = J[L + 1]
|
||||
, O = J[L + 2]
|
||||
, N = J[L + 3]
|
||||
, b = J[L + 4]
|
||||
, H = J[L + 5]
|
||||
, y = J[L + 6]
|
||||
, l = J[L + 7]
|
||||
, o = J[L + 8]
|
||||
, K = J[L + 9]
|
||||
, I = J[L + 10]
|
||||
, G = J[L + 11]
|
||||
, p = J[L + 12]
|
||||
, F = J[L + 13]
|
||||
, s = J[L + 14]
|
||||
, d = J[L + 15]
|
||||
, R = U[0]
|
||||
, M = U[1]
|
||||
, Q = U[2]
|
||||
, P = U[3]
|
||||
, R = c(R, M, Q, P, T, 7, g[0])
|
||||
, P = c(P, R, M, Q, S, 12, g[1])
|
||||
, Q = c(Q, P, R, M, O, 17, g[2])
|
||||
, M = c(M, Q, P, R, N, 22, g[3])
|
||||
, R = c(R, M, Q, P, b, 7, g[4])
|
||||
, P = c(P, R, M, Q, H, 12, g[5])
|
||||
, Q = c(Q, P, R, M, y, 17, g[6])
|
||||
, M = c(M, Q, P, R, l, 22, g[7])
|
||||
, R = c(R, M, Q, P, o, 7, g[8])
|
||||
, P = c(P, R, M, Q, K, 12, g[9])
|
||||
, Q = c(Q, P, R, M, I, 17, g[10])
|
||||
, M = c(M, Q, P, R, G, 22, g[11])
|
||||
, R = c(R, M, Q, P, p, 7, g[12])
|
||||
, P = c(P, R, M, Q, F, 12, g[13])
|
||||
, Q = c(Q, P, R, M, s, 17, g[14])
|
||||
, M = c(M, Q, P, R, d, 22, g[15])
|
||||
, R = f(R, M, Q, P, S, 5, g[16])
|
||||
, P = f(P, R, M, Q, y, 9, g[17])
|
||||
, Q = f(Q, P, R, M, G, 14, g[18])
|
||||
, M = f(M, Q, P, R, T, 20, g[19])
|
||||
, R = f(R, M, Q, P, H, 5, g[20])
|
||||
, P = f(P, R, M, Q, I, 9, g[21])
|
||||
, Q = f(Q, P, R, M, d, 14, g[22])
|
||||
, M = f(M, Q, P, R, b, 20, g[23])
|
||||
, R = f(R, M, Q, P, K, 5, g[24])
|
||||
, P = f(P, R, M, Q, s, 9, g[25])
|
||||
, Q = f(Q, P, R, M, N, 14, g[26])
|
||||
, M = f(M, Q, P, R, o, 20, g[27])
|
||||
, R = f(R, M, Q, P, F, 5, g[28])
|
||||
, P = f(P, R, M, Q, O, 9, g[29])
|
||||
, Q = f(Q, P, R, M, l, 14, g[30])
|
||||
, M = f(M, Q, P, R, p, 20, g[31])
|
||||
, R = e(R, M, Q, P, H, 4, g[32])
|
||||
, P = e(P, R, M, Q, o, 11, g[33])
|
||||
, Q = e(Q, P, R, M, G, 16, g[34])
|
||||
, M = e(M, Q, P, R, s, 23, g[35])
|
||||
, R = e(R, M, Q, P, S, 4, g[36])
|
||||
, P = e(P, R, M, Q, b, 11, g[37])
|
||||
, Q = e(Q, P, R, M, l, 16, g[38])
|
||||
, M = e(M, Q, P, R, I, 23, g[39])
|
||||
, R = e(R, M, Q, P, F, 4, g[40])
|
||||
, P = e(P, R, M, Q, T, 11, g[41])
|
||||
, Q = e(Q, P, R, M, N, 16, g[42])
|
||||
, M = e(M, Q, P, R, y, 23, g[43])
|
||||
, R = e(R, M, Q, P, K, 4, g[44])
|
||||
, P = e(P, R, M, Q, p, 11, g[45])
|
||||
, Q = e(Q, P, R, M, d, 16, g[46])
|
||||
, M = e(M, Q, P, R, O, 23, g[47])
|
||||
, R = n(R, M, Q, P, T, 6, g[48])
|
||||
, P = n(P, R, M, Q, l, 10, g[49])
|
||||
, Q = n(Q, P, R, M, s, 15, g[50])
|
||||
, M = n(M, Q, P, R, H, 21, g[51])
|
||||
, R = n(R, M, Q, P, p, 6, g[52])
|
||||
, P = n(P, R, M, Q, N, 10, g[53])
|
||||
, Q = n(Q, P, R, M, I, 15, g[54])
|
||||
, M = n(M, Q, P, R, S, 21, g[55])
|
||||
, R = n(R, M, Q, P, o, 6, g[56])
|
||||
, P = n(P, R, M, Q, d, 10, g[57])
|
||||
, Q = n(Q, P, R, M, y, 15, g[58])
|
||||
, M = n(M, Q, P, R, F, 21, g[59])
|
||||
, R = n(R, M, Q, P, b, 6, g[60])
|
||||
, P = n(P, R, M, Q, G, 10, g[61])
|
||||
, Q = n(Q, P, R, M, O, 15, g[62])
|
||||
, M = n(M, Q, P, R, K, 21, g[63]);
|
||||
U[0] = U[0] + R | 0;
|
||||
U[1] = U[1] + M | 0;
|
||||
U[2] = U[2] + Q | 0;
|
||||
U[3] = U[3] + P | 0
|
||||
},
|
||||
_doFinalize: function () {
|
||||
var d = this._data
|
||||
, q = d.words
|
||||
, l = 8 * this._nDataBytes
|
||||
, p = 8 * d.sigBytes;
|
||||
q[p >>> 5] |= 128 << 24 - p % 32;
|
||||
var o = k.floor(l / 4294967296);
|
||||
q[(p + 64 >>> 9 << 4) + 15] = (o << 8 | o >>> 24) & 16711935 | (o << 24 | o >>> 8) & 4278255360;
|
||||
q[(p + 64 >>> 9 << 4) + 14] = (l << 8 | l >>> 24) & 16711935 | (l << 24 | l >>> 8) & 4278255360;
|
||||
d.sigBytes = 4 * (q.length + 1);
|
||||
this._process();
|
||||
d = this._hash;
|
||||
q = d.words;
|
||||
for (l = 0; 4 > l; l++) {
|
||||
p = q[l],
|
||||
q[l] = (p << 8 | p >>> 24) & 16711935 | (p << 24 | p >>> 8) & 4278255360
|
||||
}
|
||||
return d
|
||||
},
|
||||
clone: function () {
|
||||
var d = j.clone.call(this);
|
||||
d._hash = this._hash.clone();
|
||||
return d
|
||||
}
|
||||
});
|
||||
m.MD5 = j._createHelper(a);
|
||||
m.HmacMD5 = j._createHmacHelper(a)
|
||||
}
|
||||
)(Math);
|
||||
(function () {
|
||||
var b = CryptoJS
|
||||
, e = b.lib
|
||||
, f = e.Base
|
||||
, a = e.WordArray
|
||||
, e = b.algo
|
||||
, c = e.EvpKDF = f.extend({
|
||||
cfg: f.extend({
|
||||
keySize: 4,
|
||||
hasher: e.MD5,
|
||||
iterations: 1
|
||||
}),
|
||||
init: function (g) {
|
||||
this.cfg = this.cfg.extend(g)
|
||||
},
|
||||
compute: function (k, g) {
|
||||
for (var i = this.cfg, t = i.hasher.create(), l = a.create(), o = l.words, h = i.keySize, i = i.iterations; o.length < h;) {
|
||||
j && t.update(j);
|
||||
var j = t.update(k).finalize(g);
|
||||
t.reset();
|
||||
for (var m = 1; m < i; m++) {
|
||||
j = t.finalize(j),
|
||||
t.reset()
|
||||
}
|
||||
l.concat(j)
|
||||
}
|
||||
l.sigBytes = 4 * h;
|
||||
return l
|
||||
}
|
||||
});
|
||||
b.EvpKDF = function (i, g, h) {
|
||||
return c.create(h).compute(i, g)
|
||||
}
|
||||
}
|
||||
)();
|
||||
CryptoJS.lib.Cipher || function (B) {
|
||||
var g = CryptoJS
|
||||
, j = g.lib
|
||||
, i = j.Base
|
||||
, D = j.WordArray
|
||||
, C = j.BufferedBlockAlgorithm
|
||||
, e = g.enc.Base64
|
||||
, z = g.algo.EvpKDF
|
||||
, A = j.Cipher = C.extend({
|
||||
cfg: i.extend(),
|
||||
createEncryptor: function (c, b) {
|
||||
return this.create(this._ENC_XFORM_MODE, c, b)
|
||||
},
|
||||
createDecryptor: function (c, b) {
|
||||
return this.create(this._DEC_XFORM_MODE, c, b)
|
||||
},
|
||||
init: function (l, d, c) {
|
||||
this.cfg = this.cfg.extend(c);
|
||||
this._xformMode = l;
|
||||
this._key = d;
|
||||
this.reset()
|
||||
},
|
||||
reset: function () {
|
||||
C.reset.call(this);
|
||||
this._doReset()
|
||||
},
|
||||
process: function (a) {
|
||||
this._append(a);
|
||||
return this._process()
|
||||
},
|
||||
finalize: function (a) {
|
||||
a && this._append(a);
|
||||
return this._doFinalize()
|
||||
},
|
||||
keySize: 4,
|
||||
ivSize: 4,
|
||||
_ENC_XFORM_MODE: 1,
|
||||
_DEC_XFORM_MODE: 2,
|
||||
_createHelper: function (a) {
|
||||
return {
|
||||
encrypt: function (c, l, n) {
|
||||
return ("string" == typeof l ? k : o).encrypt(a, c, l, n)
|
||||
},
|
||||
decrypt: function (c, l, n) {
|
||||
return ("string" == typeof l ? k : o).decrypt(a, c, l, n)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
j.StreamCipher = A.extend({
|
||||
_doFinalize: function () {
|
||||
return this._process(!0)
|
||||
},
|
||||
blockSize: 1
|
||||
});
|
||||
var m = g.mode = {}
|
||||
, y = function (p, n, l) {
|
||||
var r = this._iv;
|
||||
r ? this._iv = B : r = this._prevBlock;
|
||||
for (var q = 0; q < l; q++) {
|
||||
p[n + q] ^= r[q]
|
||||
}
|
||||
}
|
||||
, f = (j.BlockCipherMode = i.extend({
|
||||
createEncryptor: function (c, b) {
|
||||
return this.Encryptor.create(c, b)
|
||||
},
|
||||
createDecryptor: function (c, b) {
|
||||
return this.Decryptor.create(c, b)
|
||||
},
|
||||
init: function (c, b) {
|
||||
this._cipher = c;
|
||||
this._iv = b
|
||||
}
|
||||
})).extend();
|
||||
f.Encryptor = f.extend({
|
||||
processBlock: function (n, l) {
|
||||
var d = this._cipher
|
||||
, p = d.blockSize;
|
||||
y.call(this, n, l, p);
|
||||
d.encryptBlock(n, l);
|
||||
this._prevBlock = n.slice(l, l + p)
|
||||
}
|
||||
});
|
||||
f.Decryptor = f.extend({
|
||||
processBlock: function (p, n) {
|
||||
var l = this._cipher
|
||||
, r = l.blockSize
|
||||
, q = p.slice(n, n + r);
|
||||
l.decryptBlock(p, n);
|
||||
y.call(this, p, n, r);
|
||||
this._prevBlock = q
|
||||
}
|
||||
});
|
||||
m = m.CBC = f;
|
||||
f = (g.pad = {}).Pkcs7 = {
|
||||
pad: function (r, p) {
|
||||
for (var u = 4 * p, u = u - r.sigBytes % u, s = u << 24 | u << 16 | u << 8 | u, q = [], t = 0; t < u; t += 4) {
|
||||
q.push(s)
|
||||
}
|
||||
u = D.create(q, u);
|
||||
r.concat(u)
|
||||
},
|
||||
unpad: function (b) {
|
||||
b.sigBytes -= b.words[b.sigBytes - 1 >>> 2] & 255
|
||||
}
|
||||
};
|
||||
j.BlockCipher = A.extend({
|
||||
cfg: A.cfg.extend({
|
||||
mode: m,
|
||||
padding: f
|
||||
}),
|
||||
reset: function () {
|
||||
A.reset.call(this);
|
||||
var l = this.cfg
|
||||
, d = l.iv
|
||||
, l = l.mode;
|
||||
if (this._xformMode == this._ENC_XFORM_MODE) {
|
||||
var n = l.createEncryptor
|
||||
} else {
|
||||
n = l.createDecryptor,
|
||||
this._minBufferSize = 1
|
||||
}
|
||||
this._mode = n.call(l, this, d && d.words)
|
||||
},
|
||||
_doProcessBlock: function (d, c) {
|
||||
this._mode.processBlock(d, c)
|
||||
},
|
||||
_doFinalize: function () {
|
||||
var d = this.cfg.padding;
|
||||
if (this._xformMode == this._ENC_XFORM_MODE) {
|
||||
d.pad(this._data, this.blockSize);
|
||||
var c = this._process(!0)
|
||||
} else {
|
||||
c = this._process(!0),
|
||||
d.unpad(c)
|
||||
}
|
||||
return c
|
||||
},
|
||||
blockSize: 4
|
||||
});
|
||||
var h = j.CipherParams = i.extend({
|
||||
init: function (b) {
|
||||
this.mixIn(b)
|
||||
},
|
||||
toString: function (b) {
|
||||
return (b || this.formatter).stringify(this)
|
||||
}
|
||||
})
|
||||
, m = (g.format = {}).OpenSSL = {
|
||||
stringify: function (d) {
|
||||
var c = d.ciphertext;
|
||||
d = d.salt;
|
||||
return (d ? D.create([1398893684, 1701076831]).concat(d).concat(c) : c).toString(e)
|
||||
},
|
||||
parse: function (l) {
|
||||
l = e.parse(l);
|
||||
var d = l.words;
|
||||
if (1398893684 == d[0] && 1701076831 == d[1]) {
|
||||
var n = D.create(d.slice(2, 4));
|
||||
d.splice(0, 4);
|
||||
l.sigBytes -= 16
|
||||
}
|
||||
return h.create({
|
||||
ciphertext: l,
|
||||
salt: n
|
||||
})
|
||||
}
|
||||
}
|
||||
, o = j.SerializableCipher = i.extend({
|
||||
cfg: i.extend({
|
||||
format: m
|
||||
}),
|
||||
encrypt: function (q, n, s, r) {
|
||||
r = this.cfg.extend(r);
|
||||
var p = q.createEncryptor(s, r);
|
||||
n = p.finalize(n);
|
||||
p = p.cfg;
|
||||
return h.create({
|
||||
ciphertext: n,
|
||||
key: s,
|
||||
iv: p.iv,
|
||||
algorithm: q,
|
||||
mode: p.mode,
|
||||
padding: p.padding,
|
||||
blockSize: q.blockSize,
|
||||
formatter: r.format
|
||||
})
|
||||
},
|
||||
decrypt: function (n, l, q, p) {
|
||||
p = this.cfg.extend(p);
|
||||
l = this._parse(l, p.format);
|
||||
return n.createDecryptor(q, p).finalize(l.ciphertext)
|
||||
},
|
||||
_parse: function (d, c) {
|
||||
return "string" == typeof d ? c.parse(d, this) : d
|
||||
}
|
||||
})
|
||||
, g = (g.kdf = {}).OpenSSL = {
|
||||
execute: function (n, l, q, p) {
|
||||
p || (p = D.random(8));
|
||||
n = z.create({
|
||||
keySize: l + q
|
||||
}).compute(n, p);
|
||||
q = D.create(n.words.slice(l), 4 * q);
|
||||
n.sigBytes = 4 * l;
|
||||
return h.create({
|
||||
key: n,
|
||||
iv: q,
|
||||
salt: p
|
||||
})
|
||||
}
|
||||
}
|
||||
, k = j.PasswordBasedCipher = o.extend({
|
||||
cfg: o.cfg.extend({
|
||||
kdf: g
|
||||
}),
|
||||
encrypt: function (a, q, p, n) {
|
||||
n = this.cfg.extend(n);
|
||||
p = n.kdf.execute(p, a.keySize, a.ivSize);
|
||||
n.iv = p.iv;
|
||||
a = o.encrypt.call(this, a, q, p.key, n);
|
||||
a.mixIn(p);
|
||||
return a
|
||||
},
|
||||
decrypt: function (a, q, p, n) {
|
||||
n = this.cfg.extend(n);
|
||||
q = this._parse(q, n.format);
|
||||
p = n.kdf.execute(p, a.keySize, a.ivSize, q.salt);
|
||||
n.iv = p.iv;
|
||||
return o.decrypt.call(this, a, q, p.key, n)
|
||||
}
|
||||
})
|
||||
}();
|
||||
(function () {
|
||||
for (var C = CryptoJS, K = C.lib.BlockCipher, Q = C.algo, M = [], E = [], D = [], I = [], m = [], A = [], S = [], h = [], J = [], L = [], T = [], R = 0; 256 > R; R++) {
|
||||
T[R] = 128 > R ? R << 1 : R << 1 ^ 283
|
||||
}
|
||||
for (var P = 0, O = 0, R = 0; 256 > R; R++) {
|
||||
var N = O ^ O << 1 ^ O << 2 ^ O << 3 ^ O << 4
|
||||
, N = N >>> 8 ^ N & 255 ^ 99;
|
||||
M[P] = N;
|
||||
E[N] = P;
|
||||
var f = T[P]
|
||||
, B = T[f]
|
||||
, o = T[B]
|
||||
, g = 257 * T[N] ^ 16843008 * N;
|
||||
D[P] = g << 24 | g >>> 8;
|
||||
I[P] = g << 16 | g >>> 16;
|
||||
m[P] = g << 8 | g >>> 24;
|
||||
A[P] = g;
|
||||
g = 16843009 * o ^ 65537 * B ^ 257 * f ^ 16843008 * P;
|
||||
S[N] = g << 24 | g >>> 8;
|
||||
h[N] = g << 16 | g >>> 16;
|
||||
J[N] = g << 8 | g >>> 24;
|
||||
L[N] = g;
|
||||
P ? (P = f ^ T[T[T[o ^ f]]],
|
||||
O ^= T[T[O]]) : P = O = 1
|
||||
}
|
||||
var i = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]
|
||||
, Q = Q.AES = K.extend({
|
||||
_doReset: function () {
|
||||
for (var b = this._key, r = b.words, q = b.sigBytes / 4, b = 4 * ((this._nRounds = q + 6) + 1), p = this._keySchedule = [], n = 0; n < b; n++) {
|
||||
if (n < q) {
|
||||
p[n] = r[n]
|
||||
} else {
|
||||
var l = p[n - 1];
|
||||
n % q ? 6 < q && 4 == n % q && (l = M[l >>> 24] << 24 | M[l >>> 16 & 255] << 16 | M[l >>> 8 & 255] << 8 | M[l & 255]) : (l = l << 8 | l >>> 24,
|
||||
l = M[l >>> 24] << 24 | M[l >>> 16 & 255] << 16 | M[l >>> 8 & 255] << 8 | M[l & 255],
|
||||
l ^= i[n / q | 0] << 24);
|
||||
p[n] = p[n - q] ^ l
|
||||
}
|
||||
}
|
||||
r = this._invKeySchedule = [];
|
||||
for (q = 0; q < b; q++) {
|
||||
n = b - q,
|
||||
l = q % 4 ? p[n] : p[n - 4],
|
||||
r[q] = 4 > q || 4 >= n ? l : S[M[l >>> 24]] ^ h[M[l >>> 16 & 255]] ^ J[M[l >>> 8 & 255]] ^ L[M[l & 255]]
|
||||
}
|
||||
},
|
||||
encryptBlock: function (d, c) {
|
||||
this._doCryptBlock(d, c, this._keySchedule, D, I, m, A, M)
|
||||
},
|
||||
decryptBlock: function (b, j) {
|
||||
var e = b[j + 1];
|
||||
b[j + 1] = b[j + 3];
|
||||
b[j + 3] = e;
|
||||
this._doCryptBlock(b, j, this._invKeySchedule, S, h, J, L, E);
|
||||
e = b[j + 1];
|
||||
b[j + 1] = b[j + 3];
|
||||
b[j + 3] = e
|
||||
},
|
||||
_doCryptBlock: function (ac, ab, aa, Z, Y, U, G, X) {
|
||||
for (var F = this._nRounds, W = ac[ab] ^ aa[0], V = ac[ab + 1] ^ aa[1], H = ac[ab + 2] ^ aa[2], z = ac[ab + 3] ^ aa[3], y = 4, w = 1; w < F; w++) {
|
||||
var x = Z[W >>> 24] ^ Y[V >>> 16 & 255] ^ U[H >>> 8 & 255] ^ G[z & 255] ^ aa[y++]
|
||||
, v = Z[V >>> 24] ^ Y[H >>> 16 & 255] ^ U[z >>> 8 & 255] ^ G[W & 255] ^ aa[y++]
|
||||
, u = Z[H >>> 24] ^ Y[z >>> 16 & 255] ^ U[W >>> 8 & 255] ^ G[V & 255] ^ aa[y++]
|
||||
, z = Z[z >>> 24] ^ Y[W >>> 16 & 255] ^ U[V >>> 8 & 255] ^ G[H & 255] ^ aa[y++]
|
||||
, W = x
|
||||
, V = v
|
||||
, H = u
|
||||
}
|
||||
x = (X[W >>> 24] << 24 | X[V >>> 16 & 255] << 16 | X[H >>> 8 & 255] << 8 | X[z & 255]) ^ aa[y++];
|
||||
v = (X[V >>> 24] << 24 | X[H >>> 16 & 255] << 16 | X[z >>> 8 & 255] << 8 | X[W & 255]) ^ aa[y++];
|
||||
u = (X[H >>> 24] << 24 | X[z >>> 16 & 255] << 16 | X[W >>> 8 & 255] << 8 | X[V & 255]) ^ aa[y++];
|
||||
z = (X[z >>> 24] << 24 | X[W >>> 16 & 255] << 16 | X[V >>> 8 & 255] << 8 | X[H & 255]) ^ aa[y++];
|
||||
ac[ab] = x;
|
||||
ac[ab + 1] = v;
|
||||
ac[ab + 2] = u;
|
||||
ac[ab + 3] = z
|
||||
},
|
||||
keySize: 8
|
||||
});
|
||||
C.AES = K._createHelper(Q)
|
||||
}
|
||||
)();
|
||||
|
||||
|
||||
const Encrypt = function (user, password) {
|
||||
let result = {}
|
||||
var t = CryptoJS.MD5(user),
|
||||
i = CryptoJS.enc.Utf8.parse(t),
|
||||
r = CryptoJS.enc.Utf8.parse(password),
|
||||
u = CryptoJS.AES.encrypt(password, i, {
|
||||
iv: r
|
||||
});
|
||||
result.t = t.toString()
|
||||
result.i = i.toString()
|
||||
result.r = r.toString()
|
||||
result.u = u.toString()
|
||||
return result
|
||||
};
|
||||
|
||||
|
||||
module.exports={
|
||||
Encrypt
|
||||
}
|
15
3-代码包/NodeServer/last.js
Normal file
15
3-代码包/NodeServer/last.js
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
|
||||
//1.这个对象存在于js,而不存在于nodejs,比如window,document,screen.
|
||||
//2.这些对象的属性 是一个值。
|
||||
var window ={}
|
||||
// window.btoa=function(aa){
|
||||
// return aa
|
||||
// }
|
||||
var document={}
|
||||
|
||||
document={"location":{"href":"https://bbs.nightteam.cn/member.php?mod=register"}}
|
||||
var screen ={"width":900,"height":1200}
|
||||
console.log(screen.width)
|
||||
|
22
3-代码包/NodeServer/server.js
Normal file
22
3-代码包/NodeServer/server.js
Normal file
@ -0,0 +1,22 @@
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
const sum = require("./sum")
|
||||
var bodyParser = require('body-parser');
|
||||
app.use(bodyParser());
|
||||
|
||||
|
||||
app.post('/get_num', function (req, res) {
|
||||
let result = req.body
|
||||
console.log("result",result)
|
||||
let a = parseInt(result.a)
|
||||
let b = parseInt(result.b)
|
||||
result = sum.add(a, b)
|
||||
res.send(result.toString());
|
||||
})
|
||||
|
||||
app.listen(3000, () => {
|
||||
console.log("开启服务,端口3000")
|
||||
})
|
||||
|
||||
|
||||
|
22
3-代码包/NodeServer/server2.js
Normal file
22
3-代码包/NodeServer/server2.js
Normal file
@ -0,0 +1,22 @@
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
const crypto = require("./crypto")
|
||||
var bodyParser = require('body-parser');
|
||||
app.use(bodyParser());
|
||||
|
||||
|
||||
app.post('/crypto', function (req, res) {
|
||||
let result = req.body
|
||||
console.log(result)
|
||||
let user = result.user
|
||||
let pwd = result.password
|
||||
result = crypto.Encrypt(user, pwd)
|
||||
res.send(result);
|
||||
})
|
||||
|
||||
app.listen(3000, () => {
|
||||
console.log("开启服务,端口3000")
|
||||
})
|
||||
|
||||
|
||||
|
8
3-代码包/NodeServer/sum.js
Normal file
8
3-代码包/NodeServer/sum.js
Normal file
@ -0,0 +1,8 @@
|
||||
function add(a, b) {
|
||||
return a + b
|
||||
}
|
||||
|
||||
module.exports =
|
||||
{
|
||||
add
|
||||
}
|
739
3-代码包/PyExecjsDemo/aes_demo.js
Normal file
739
3-代码包/PyExecjsDemo/aes_demo.js
Normal file
@ -0,0 +1,739 @@
|
||||
var CryptoJS= function(o, e) {
|
||||
var h = {}
|
||||
, g = h.lib = {}
|
||||
, z = function() {}
|
||||
, y = g.Base = {
|
||||
extend: function(b) {
|
||||
z.prototype = this;
|
||||
var d = new z;
|
||||
b && d.mixIn(b);
|
||||
d.hasOwnProperty("init") || (d.init = function() {
|
||||
d.$super.init.apply(this, arguments)
|
||||
}
|
||||
);
|
||||
d.init.prototype = d;
|
||||
d.$super = this;
|
||||
return d
|
||||
},
|
||||
create: function() {
|
||||
var b = this.extend();
|
||||
b.init.apply(b, arguments);
|
||||
return b
|
||||
},
|
||||
init: function() {},
|
||||
mixIn: function(b) {
|
||||
for (var d in b) {
|
||||
b.hasOwnProperty(d) && (this[d] = b[d])
|
||||
}
|
||||
b.hasOwnProperty("toString") && (this.toString = b.toString)
|
||||
},
|
||||
clone: function() {
|
||||
return this.init.prototype.extend(this)
|
||||
}
|
||||
}
|
||||
, a = g.WordArray = y.extend({
|
||||
init: function(b, d) {
|
||||
b = this.words = b || [];
|
||||
this.sigBytes = d != e ? d : 4 * b.length
|
||||
},
|
||||
toString: function(b) {
|
||||
return (b || m).stringify(this)
|
||||
},
|
||||
concat: function(b) {
|
||||
var p = this.words
|
||||
, n = b.words
|
||||
, l = this.sigBytes;
|
||||
b = b.sigBytes;
|
||||
this.clamp();
|
||||
if (l % 4) {
|
||||
for (var d = 0; d < b; d++) {
|
||||
p[l + d >>> 2] |= (n[d >>> 2] >>> 24 - 8 * (d % 4) & 255) << 24 - 8 * ((l + d) % 4)
|
||||
}
|
||||
} else {
|
||||
if (65535 < n.length) {
|
||||
for (d = 0; d < b; d += 4) {
|
||||
p[l + d >>> 2] = n[d >>> 2]
|
||||
}
|
||||
} else {
|
||||
p.push.apply(p, n)
|
||||
}
|
||||
}
|
||||
this.sigBytes += b;
|
||||
return this
|
||||
},
|
||||
clamp: function() {
|
||||
var b = this.words
|
||||
, d = this.sigBytes;
|
||||
b[d >>> 2] &= 4294967295 << 32 - 8 * (d % 4);
|
||||
b.length = o.ceil(d / 4)
|
||||
},
|
||||
clone: function() {
|
||||
var b = y.clone.call(this);
|
||||
b.words = this.words.slice(0);
|
||||
return b
|
||||
},
|
||||
random: function(b) {
|
||||
for (var l = [], d = 0; d < b; d += 4) {
|
||||
l.push(4294967296 * o.random() | 0)
|
||||
}
|
||||
return new a.init(l,b)
|
||||
}
|
||||
})
|
||||
, k = h.enc = {}
|
||||
, m = k.Hex = {
|
||||
stringify: function(b) {
|
||||
var p = b.words;
|
||||
b = b.sigBytes;
|
||||
for (var n = [], l = 0; l < b; l++) {
|
||||
var d = p[l >>> 2] >>> 24 - 8 * (l % 4) & 255;
|
||||
n.push((d >>> 4).toString(16));
|
||||
n.push((d & 15).toString(16))
|
||||
}
|
||||
return n.join("")
|
||||
},
|
||||
parse: function(b) {
|
||||
for (var n = b.length, l = [], d = 0; d < n; d += 2) {
|
||||
l[d >>> 3] |= parseInt(b.substr(d, 2), 16) << 24 - 4 * (d % 8)
|
||||
}
|
||||
return new a.init(l,n / 2)
|
||||
}
|
||||
}
|
||||
, i = k.Latin1 = {
|
||||
stringify: function(b) {
|
||||
var n = b.words;
|
||||
b = b.sigBytes;
|
||||
for (var l = [], d = 0; d < b; d++) {
|
||||
l.push(String.fromCharCode(n[d >>> 2] >>> 24 - 8 * (d % 4) & 255))
|
||||
}
|
||||
return l.join("")
|
||||
},
|
||||
parse: function(b) {
|
||||
for (var n = b.length, l = [], d = 0; d < n; d++) {
|
||||
l[d >>> 2] |= (b.charCodeAt(d) & 255) << 24 - 8 * (d % 4)
|
||||
}
|
||||
return new a.init(l,n)
|
||||
}
|
||||
}
|
||||
, j = k.Utf8 = {
|
||||
stringify: function(b) {
|
||||
try {
|
||||
return decodeURIComponent(escape(i.stringify(b)))
|
||||
} catch (d) {
|
||||
throw Error("Malformed UTF-8 data")
|
||||
}
|
||||
},
|
||||
parse: function(b) {
|
||||
return i.parse(unescape(encodeURIComponent(b)))
|
||||
}
|
||||
}
|
||||
, c = g.BufferedBlockAlgorithm = y.extend({
|
||||
reset: function() {
|
||||
this._data = new a.init;
|
||||
this._nDataBytes = 0
|
||||
},
|
||||
_append: function(b) {
|
||||
"string" == typeof b && (b = j.parse(b));
|
||||
this._data.concat(b);
|
||||
this._nDataBytes += b.sigBytes
|
||||
},
|
||||
_process: function(l) {
|
||||
var t = this._data
|
||||
, s = t.words
|
||||
, p = t.sigBytes
|
||||
, n = this.blockSize
|
||||
, d = p / (4 * n)
|
||||
, d = l ? o.ceil(d) : o.max((d | 0) - this._minBufferSize, 0);
|
||||
l = d * n;
|
||||
p = o.min(4 * l, p);
|
||||
if (l) {
|
||||
for (var r = 0; r < l; r += n) {
|
||||
this._doProcessBlock(s, r)
|
||||
}
|
||||
r = s.splice(0, l);
|
||||
t.sigBytes -= p
|
||||
}
|
||||
return new a.init(r,p)
|
||||
},
|
||||
clone: function() {
|
||||
var b = y.clone.call(this);
|
||||
b._data = this._data.clone();
|
||||
return b
|
||||
},
|
||||
_minBufferSize: 0
|
||||
});
|
||||
g.Hasher = c.extend({
|
||||
cfg: y.extend(),
|
||||
init: function(b) {
|
||||
this.cfg = this.cfg.extend(b);
|
||||
this.reset()
|
||||
},
|
||||
reset: function() {
|
||||
c.reset.call(this);
|
||||
this._doReset()
|
||||
},
|
||||
update: function(b) {
|
||||
this._append(b);
|
||||
this._process();
|
||||
return this
|
||||
},
|
||||
finalize: function(b) {
|
||||
b && this._append(b);
|
||||
return this._doFinalize()
|
||||
},
|
||||
blockSize: 16,
|
||||
_createHelper: function(b) {
|
||||
return function(d, l) {
|
||||
return (new b.init(l)).finalize(d)
|
||||
}
|
||||
},
|
||||
_createHmacHelper: function(b) {
|
||||
return function(d, l) {
|
||||
return (new f.HMAC.init(b,l)).finalize(d)
|
||||
}
|
||||
}
|
||||
});
|
||||
var f = h.algo = {};
|
||||
return h
|
||||
}(Math);
|
||||
(function() {
|
||||
var a = CryptoJS
|
||||
, b = a.lib.WordArray;
|
||||
a.enc.Base64 = {
|
||||
stringify: function(j) {
|
||||
var e = j.words
|
||||
, i = j.sigBytes
|
||||
, g = this._map;
|
||||
j.clamp();
|
||||
j = [];
|
||||
for (var h = 0; h < i; h += 3) {
|
||||
for (var c = (e[h >>> 2] >>> 24 - 8 * (h % 4) & 255) << 16 | (e[h + 1 >>> 2] >>> 24 - 8 * ((h + 1) % 4) & 255) << 8 | e[h + 2 >>> 2] >>> 24 - 8 * ((h + 2) % 4) & 255, f = 0; 4 > f && h + 0.75 * f < i; f++) {
|
||||
j.push(g.charAt(c >>> 6 * (3 - f) & 63))
|
||||
}
|
||||
}
|
||||
if (e = g.charAt(64)) {
|
||||
for (; j.length % 4; ) {
|
||||
j.push(e)
|
||||
}
|
||||
}
|
||||
return j.join("")
|
||||
},
|
||||
parse: function(k) {
|
||||
var f = k.length
|
||||
, i = this._map
|
||||
, h = i.charAt(64);
|
||||
h && (h = k.indexOf(h),
|
||||
-1 != h && (f = h));
|
||||
for (var h = [], j = 0, e = 0; e < f; e++) {
|
||||
if (e % 4) {
|
||||
var g = i.indexOf(k.charAt(e - 1)) << 2 * (e % 4)
|
||||
, c = i.indexOf(k.charAt(e)) >>> 6 - 2 * (e % 4);
|
||||
h[j >>> 2] |= (g | c) << 24 - 8 * (j % 4);
|
||||
j++
|
||||
}
|
||||
}
|
||||
return b.create(h, j)
|
||||
},
|
||||
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
||||
}
|
||||
}
|
||||
)();
|
||||
(function(k) {
|
||||
function c(d, s, l, r, q, p, o) {
|
||||
d = d + (s & l | ~s & r) + q + o;
|
||||
return (d << p | d >>> 32 - p) + s
|
||||
}
|
||||
function f(d, s, l, r, q, p, o) {
|
||||
d = d + (s & r | l & ~r) + q + o;
|
||||
return (d << p | d >>> 32 - p) + s
|
||||
}
|
||||
function e(d, s, l, r, q, p, o) {
|
||||
d = d + (s ^ l ^ r) + q + o;
|
||||
return (d << p | d >>> 32 - p) + s
|
||||
}
|
||||
function n(d, s, l, r, q, p, o) {
|
||||
d = d + (l ^ (s | ~r)) + q + o;
|
||||
return (d << p | d >>> 32 - p) + s
|
||||
}
|
||||
for (var m = CryptoJS, a = m.lib, i = a.WordArray, j = a.Hasher, a = m.algo, g = [], h = 0; 64 > h; h++) {
|
||||
g[h] = 4294967296 * k.abs(k.sin(h + 1)) | 0
|
||||
}
|
||||
a = a.MD5 = j.extend({
|
||||
_doReset: function() {
|
||||
this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878])
|
||||
},
|
||||
_doProcessBlock: function(J, L) {
|
||||
for (var U = 0; 16 > U; U++) {
|
||||
var T = L + U
|
||||
, S = J[T];
|
||||
J[T] = (S << 8 | S >>> 24) & 16711935 | (S << 24 | S >>> 8) & 4278255360
|
||||
}
|
||||
var U = this._hash.words
|
||||
, T = J[L + 0]
|
||||
, S = J[L + 1]
|
||||
, O = J[L + 2]
|
||||
, N = J[L + 3]
|
||||
, b = J[L + 4]
|
||||
, H = J[L + 5]
|
||||
, y = J[L + 6]
|
||||
, l = J[L + 7]
|
||||
, o = J[L + 8]
|
||||
, K = J[L + 9]
|
||||
, I = J[L + 10]
|
||||
, G = J[L + 11]
|
||||
, p = J[L + 12]
|
||||
, F = J[L + 13]
|
||||
, s = J[L + 14]
|
||||
, d = J[L + 15]
|
||||
, R = U[0]
|
||||
, M = U[1]
|
||||
, Q = U[2]
|
||||
, P = U[3]
|
||||
, R = c(R, M, Q, P, T, 7, g[0])
|
||||
, P = c(P, R, M, Q, S, 12, g[1])
|
||||
, Q = c(Q, P, R, M, O, 17, g[2])
|
||||
, M = c(M, Q, P, R, N, 22, g[3])
|
||||
, R = c(R, M, Q, P, b, 7, g[4])
|
||||
, P = c(P, R, M, Q, H, 12, g[5])
|
||||
, Q = c(Q, P, R, M, y, 17, g[6])
|
||||
, M = c(M, Q, P, R, l, 22, g[7])
|
||||
, R = c(R, M, Q, P, o, 7, g[8])
|
||||
, P = c(P, R, M, Q, K, 12, g[9])
|
||||
, Q = c(Q, P, R, M, I, 17, g[10])
|
||||
, M = c(M, Q, P, R, G, 22, g[11])
|
||||
, R = c(R, M, Q, P, p, 7, g[12])
|
||||
, P = c(P, R, M, Q, F, 12, g[13])
|
||||
, Q = c(Q, P, R, M, s, 17, g[14])
|
||||
, M = c(M, Q, P, R, d, 22, g[15])
|
||||
, R = f(R, M, Q, P, S, 5, g[16])
|
||||
, P = f(P, R, M, Q, y, 9, g[17])
|
||||
, Q = f(Q, P, R, M, G, 14, g[18])
|
||||
, M = f(M, Q, P, R, T, 20, g[19])
|
||||
, R = f(R, M, Q, P, H, 5, g[20])
|
||||
, P = f(P, R, M, Q, I, 9, g[21])
|
||||
, Q = f(Q, P, R, M, d, 14, g[22])
|
||||
, M = f(M, Q, P, R, b, 20, g[23])
|
||||
, R = f(R, M, Q, P, K, 5, g[24])
|
||||
, P = f(P, R, M, Q, s, 9, g[25])
|
||||
, Q = f(Q, P, R, M, N, 14, g[26])
|
||||
, M = f(M, Q, P, R, o, 20, g[27])
|
||||
, R = f(R, M, Q, P, F, 5, g[28])
|
||||
, P = f(P, R, M, Q, O, 9, g[29])
|
||||
, Q = f(Q, P, R, M, l, 14, g[30])
|
||||
, M = f(M, Q, P, R, p, 20, g[31])
|
||||
, R = e(R, M, Q, P, H, 4, g[32])
|
||||
, P = e(P, R, M, Q, o, 11, g[33])
|
||||
, Q = e(Q, P, R, M, G, 16, g[34])
|
||||
, M = e(M, Q, P, R, s, 23, g[35])
|
||||
, R = e(R, M, Q, P, S, 4, g[36])
|
||||
, P = e(P, R, M, Q, b, 11, g[37])
|
||||
, Q = e(Q, P, R, M, l, 16, g[38])
|
||||
, M = e(M, Q, P, R, I, 23, g[39])
|
||||
, R = e(R, M, Q, P, F, 4, g[40])
|
||||
, P = e(P, R, M, Q, T, 11, g[41])
|
||||
, Q = e(Q, P, R, M, N, 16, g[42])
|
||||
, M = e(M, Q, P, R, y, 23, g[43])
|
||||
, R = e(R, M, Q, P, K, 4, g[44])
|
||||
, P = e(P, R, M, Q, p, 11, g[45])
|
||||
, Q = e(Q, P, R, M, d, 16, g[46])
|
||||
, M = e(M, Q, P, R, O, 23, g[47])
|
||||
, R = n(R, M, Q, P, T, 6, g[48])
|
||||
, P = n(P, R, M, Q, l, 10, g[49])
|
||||
, Q = n(Q, P, R, M, s, 15, g[50])
|
||||
, M = n(M, Q, P, R, H, 21, g[51])
|
||||
, R = n(R, M, Q, P, p, 6, g[52])
|
||||
, P = n(P, R, M, Q, N, 10, g[53])
|
||||
, Q = n(Q, P, R, M, I, 15, g[54])
|
||||
, M = n(M, Q, P, R, S, 21, g[55])
|
||||
, R = n(R, M, Q, P, o, 6, g[56])
|
||||
, P = n(P, R, M, Q, d, 10, g[57])
|
||||
, Q = n(Q, P, R, M, y, 15, g[58])
|
||||
, M = n(M, Q, P, R, F, 21, g[59])
|
||||
, R = n(R, M, Q, P, b, 6, g[60])
|
||||
, P = n(P, R, M, Q, G, 10, g[61])
|
||||
, Q = n(Q, P, R, M, O, 15, g[62])
|
||||
, M = n(M, Q, P, R, K, 21, g[63]);
|
||||
U[0] = U[0] + R | 0;
|
||||
U[1] = U[1] + M | 0;
|
||||
U[2] = U[2] + Q | 0;
|
||||
U[3] = U[3] + P | 0
|
||||
},
|
||||
_doFinalize: function() {
|
||||
var d = this._data
|
||||
, q = d.words
|
||||
, l = 8 * this._nDataBytes
|
||||
, p = 8 * d.sigBytes;
|
||||
q[p >>> 5] |= 128 << 24 - p % 32;
|
||||
var o = k.floor(l / 4294967296);
|
||||
q[(p + 64 >>> 9 << 4) + 15] = (o << 8 | o >>> 24) & 16711935 | (o << 24 | o >>> 8) & 4278255360;
|
||||
q[(p + 64 >>> 9 << 4) + 14] = (l << 8 | l >>> 24) & 16711935 | (l << 24 | l >>> 8) & 4278255360;
|
||||
d.sigBytes = 4 * (q.length + 1);
|
||||
this._process();
|
||||
d = this._hash;
|
||||
q = d.words;
|
||||
for (l = 0; 4 > l; l++) {
|
||||
p = q[l],
|
||||
q[l] = (p << 8 | p >>> 24) & 16711935 | (p << 24 | p >>> 8) & 4278255360
|
||||
}
|
||||
return d
|
||||
},
|
||||
clone: function() {
|
||||
var d = j.clone.call(this);
|
||||
d._hash = this._hash.clone();
|
||||
return d
|
||||
}
|
||||
});
|
||||
m.MD5 = j._createHelper(a);
|
||||
m.HmacMD5 = j._createHmacHelper(a)
|
||||
}
|
||||
)(Math);
|
||||
(function() {
|
||||
var b = CryptoJS
|
||||
, e = b.lib
|
||||
, f = e.Base
|
||||
, a = e.WordArray
|
||||
, e = b.algo
|
||||
, c = e.EvpKDF = f.extend({
|
||||
cfg: f.extend({
|
||||
keySize: 4,
|
||||
hasher: e.MD5,
|
||||
iterations: 1
|
||||
}),
|
||||
init: function(g) {
|
||||
this.cfg = this.cfg.extend(g)
|
||||
},
|
||||
compute: function(k, g) {
|
||||
for (var i = this.cfg, t = i.hasher.create(), l = a.create(), o = l.words, h = i.keySize, i = i.iterations; o.length < h; ) {
|
||||
j && t.update(j);
|
||||
var j = t.update(k).finalize(g);
|
||||
t.reset();
|
||||
for (var m = 1; m < i; m++) {
|
||||
j = t.finalize(j),
|
||||
t.reset()
|
||||
}
|
||||
l.concat(j)
|
||||
}
|
||||
l.sigBytes = 4 * h;
|
||||
return l
|
||||
}
|
||||
});
|
||||
b.EvpKDF = function(i, g, h) {
|
||||
return c.create(h).compute(i, g)
|
||||
}
|
||||
}
|
||||
)();
|
||||
CryptoJS.lib.Cipher || function(B) {
|
||||
var g = CryptoJS
|
||||
, j = g.lib
|
||||
, i = j.Base
|
||||
, D = j.WordArray
|
||||
, C = j.BufferedBlockAlgorithm
|
||||
, e = g.enc.Base64
|
||||
, z = g.algo.EvpKDF
|
||||
, A = j.Cipher = C.extend({
|
||||
cfg: i.extend(),
|
||||
createEncryptor: function(c, b) {
|
||||
return this.create(this._ENC_XFORM_MODE, c, b)
|
||||
},
|
||||
createDecryptor: function(c, b) {
|
||||
return this.create(this._DEC_XFORM_MODE, c, b)
|
||||
},
|
||||
init: function(l, d, c) {
|
||||
this.cfg = this.cfg.extend(c);
|
||||
this._xformMode = l;
|
||||
this._key = d;
|
||||
this.reset()
|
||||
},
|
||||
reset: function() {
|
||||
C.reset.call(this);
|
||||
this._doReset()
|
||||
},
|
||||
process: function(a) {
|
||||
this._append(a);
|
||||
return this._process()
|
||||
},
|
||||
finalize: function(a) {
|
||||
a && this._append(a);
|
||||
return this._doFinalize()
|
||||
},
|
||||
keySize: 4,
|
||||
ivSize: 4,
|
||||
_ENC_XFORM_MODE: 1,
|
||||
_DEC_XFORM_MODE: 2,
|
||||
_createHelper: function(a) {
|
||||
return {
|
||||
encrypt: function(c, l, n) {
|
||||
return ("string" == typeof l ? k : o).encrypt(a, c, l, n)
|
||||
},
|
||||
decrypt: function(c, l, n) {
|
||||
return ("string" == typeof l ? k : o).decrypt(a, c, l, n)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
j.StreamCipher = A.extend({
|
||||
_doFinalize: function() {
|
||||
return this._process(!0)
|
||||
},
|
||||
blockSize: 1
|
||||
});
|
||||
var m = g.mode = {}
|
||||
, y = function(p, n, l) {
|
||||
var r = this._iv;
|
||||
r ? this._iv = B : r = this._prevBlock;
|
||||
for (var q = 0; q < l; q++) {
|
||||
p[n + q] ^= r[q]
|
||||
}
|
||||
}
|
||||
, f = (j.BlockCipherMode = i.extend({
|
||||
createEncryptor: function(c, b) {
|
||||
return this.Encryptor.create(c, b)
|
||||
},
|
||||
createDecryptor: function(c, b) {
|
||||
return this.Decryptor.create(c, b)
|
||||
},
|
||||
init: function(c, b) {
|
||||
this._cipher = c;
|
||||
this._iv = b
|
||||
}
|
||||
})).extend();
|
||||
f.Encryptor = f.extend({
|
||||
processBlock: function(n, l) {
|
||||
var d = this._cipher
|
||||
, p = d.blockSize;
|
||||
y.call(this, n, l, p);
|
||||
d.encryptBlock(n, l);
|
||||
this._prevBlock = n.slice(l, l + p)
|
||||
}
|
||||
});
|
||||
f.Decryptor = f.extend({
|
||||
processBlock: function(p, n) {
|
||||
var l = this._cipher
|
||||
, r = l.blockSize
|
||||
, q = p.slice(n, n + r);
|
||||
l.decryptBlock(p, n);
|
||||
y.call(this, p, n, r);
|
||||
this._prevBlock = q
|
||||
}
|
||||
});
|
||||
m = m.CBC = f;
|
||||
f = (g.pad = {}).Pkcs7 = {
|
||||
pad: function(r, p) {
|
||||
for (var u = 4 * p, u = u - r.sigBytes % u, s = u << 24 | u << 16 | u << 8 | u, q = [], t = 0; t < u; t += 4) {
|
||||
q.push(s)
|
||||
}
|
||||
u = D.create(q, u);
|
||||
r.concat(u)
|
||||
},
|
||||
unpad: function(b) {
|
||||
b.sigBytes -= b.words[b.sigBytes - 1 >>> 2] & 255
|
||||
}
|
||||
};
|
||||
j.BlockCipher = A.extend({
|
||||
cfg: A.cfg.extend({
|
||||
mode: m,
|
||||
padding: f
|
||||
}),
|
||||
reset: function() {
|
||||
A.reset.call(this);
|
||||
var l = this.cfg
|
||||
, d = l.iv
|
||||
, l = l.mode;
|
||||
if (this._xformMode == this._ENC_XFORM_MODE) {
|
||||
var n = l.createEncryptor
|
||||
} else {
|
||||
n = l.createDecryptor,
|
||||
this._minBufferSize = 1
|
||||
}
|
||||
this._mode = n.call(l, this, d && d.words)
|
||||
},
|
||||
_doProcessBlock: function(d, c) {
|
||||
this._mode.processBlock(d, c)
|
||||
},
|
||||
_doFinalize: function() {
|
||||
var d = this.cfg.padding;
|
||||
if (this._xformMode == this._ENC_XFORM_MODE) {
|
||||
d.pad(this._data, this.blockSize);
|
||||
var c = this._process(!0)
|
||||
} else {
|
||||
c = this._process(!0),
|
||||
d.unpad(c)
|
||||
}
|
||||
return c
|
||||
},
|
||||
blockSize: 4
|
||||
});
|
||||
var h = j.CipherParams = i.extend({
|
||||
init: function(b) {
|
||||
this.mixIn(b)
|
||||
},
|
||||
toString: function(b) {
|
||||
return (b || this.formatter).stringify(this)
|
||||
}
|
||||
})
|
||||
, m = (g.format = {}).OpenSSL = {
|
||||
stringify: function(d) {
|
||||
var c = d.ciphertext;
|
||||
d = d.salt;
|
||||
return (d ? D.create([1398893684, 1701076831]).concat(d).concat(c) : c).toString(e)
|
||||
},
|
||||
parse: function(l) {
|
||||
l = e.parse(l);
|
||||
var d = l.words;
|
||||
if (1398893684 == d[0] && 1701076831 == d[1]) {
|
||||
var n = D.create(d.slice(2, 4));
|
||||
d.splice(0, 4);
|
||||
l.sigBytes -= 16
|
||||
}
|
||||
return h.create({
|
||||
ciphertext: l,
|
||||
salt: n
|
||||
})
|
||||
}
|
||||
}
|
||||
, o = j.SerializableCipher = i.extend({
|
||||
cfg: i.extend({
|
||||
format: m
|
||||
}),
|
||||
encrypt: function(q, n, s, r) {
|
||||
r = this.cfg.extend(r);
|
||||
var p = q.createEncryptor(s, r);
|
||||
n = p.finalize(n);
|
||||
p = p.cfg;
|
||||
return h.create({
|
||||
ciphertext: n,
|
||||
key: s,
|
||||
iv: p.iv,
|
||||
algorithm: q,
|
||||
mode: p.mode,
|
||||
padding: p.padding,
|
||||
blockSize: q.blockSize,
|
||||
formatter: r.format
|
||||
})
|
||||
},
|
||||
decrypt: function(n, l, q, p) {
|
||||
p = this.cfg.extend(p);
|
||||
l = this._parse(l, p.format);
|
||||
return n.createDecryptor(q, p).finalize(l.ciphertext)
|
||||
},
|
||||
_parse: function(d, c) {
|
||||
return "string" == typeof d ? c.parse(d, this) : d
|
||||
}
|
||||
})
|
||||
, g = (g.kdf = {}).OpenSSL = {
|
||||
execute: function(n, l, q, p) {
|
||||
p || (p = D.random(8));
|
||||
n = z.create({
|
||||
keySize: l + q
|
||||
}).compute(n, p);
|
||||
q = D.create(n.words.slice(l), 4 * q);
|
||||
n.sigBytes = 4 * l;
|
||||
return h.create({
|
||||
key: n,
|
||||
iv: q,
|
||||
salt: p
|
||||
})
|
||||
}
|
||||
}
|
||||
, k = j.PasswordBasedCipher = o.extend({
|
||||
cfg: o.cfg.extend({
|
||||
kdf: g
|
||||
}),
|
||||
encrypt: function(a, q, p, n) {
|
||||
n = this.cfg.extend(n);
|
||||
p = n.kdf.execute(p, a.keySize, a.ivSize);
|
||||
n.iv = p.iv;
|
||||
a = o.encrypt.call(this, a, q, p.key, n);
|
||||
a.mixIn(p);
|
||||
return a
|
||||
},
|
||||
decrypt: function(a, q, p, n) {
|
||||
n = this.cfg.extend(n);
|
||||
q = this._parse(q, n.format);
|
||||
p = n.kdf.execute(p, a.keySize, a.ivSize, q.salt);
|
||||
n.iv = p.iv;
|
||||
return o.decrypt.call(this, a, q, p.key, n)
|
||||
}
|
||||
})
|
||||
}();
|
||||
(function() {
|
||||
for (var C = CryptoJS, K = C.lib.BlockCipher, Q = C.algo, M = [], E = [], D = [], I = [], m = [], A = [], S = [], h = [], J = [], L = [], T = [], R = 0; 256 > R; R++) {
|
||||
T[R] = 128 > R ? R << 1 : R << 1 ^ 283
|
||||
}
|
||||
for (var P = 0, O = 0, R = 0; 256 > R; R++) {
|
||||
var N = O ^ O << 1 ^ O << 2 ^ O << 3 ^ O << 4
|
||||
, N = N >>> 8 ^ N & 255 ^ 99;
|
||||
M[P] = N;
|
||||
E[N] = P;
|
||||
var f = T[P]
|
||||
, B = T[f]
|
||||
, o = T[B]
|
||||
, g = 257 * T[N] ^ 16843008 * N;
|
||||
D[P] = g << 24 | g >>> 8;
|
||||
I[P] = g << 16 | g >>> 16;
|
||||
m[P] = g << 8 | g >>> 24;
|
||||
A[P] = g;
|
||||
g = 16843009 * o ^ 65537 * B ^ 257 * f ^ 16843008 * P;
|
||||
S[N] = g << 24 | g >>> 8;
|
||||
h[N] = g << 16 | g >>> 16;
|
||||
J[N] = g << 8 | g >>> 24;
|
||||
L[N] = g;
|
||||
P ? (P = f ^ T[T[T[o ^ f]]],
|
||||
O ^= T[T[O]]) : P = O = 1
|
||||
}
|
||||
var i = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]
|
||||
, Q = Q.AES = K.extend({
|
||||
_doReset: function() {
|
||||
for (var b = this._key, r = b.words, q = b.sigBytes / 4, b = 4 * ((this._nRounds = q + 6) + 1), p = this._keySchedule = [], n = 0; n < b; n++) {
|
||||
if (n < q) {
|
||||
p[n] = r[n]
|
||||
} else {
|
||||
var l = p[n - 1];
|
||||
n % q ? 6 < q && 4 == n % q && (l = M[l >>> 24] << 24 | M[l >>> 16 & 255] << 16 | M[l >>> 8 & 255] << 8 | M[l & 255]) : (l = l << 8 | l >>> 24,
|
||||
l = M[l >>> 24] << 24 | M[l >>> 16 & 255] << 16 | M[l >>> 8 & 255] << 8 | M[l & 255],
|
||||
l ^= i[n / q | 0] << 24);
|
||||
p[n] = p[n - q] ^ l
|
||||
}
|
||||
}
|
||||
r = this._invKeySchedule = [];
|
||||
for (q = 0; q < b; q++) {
|
||||
n = b - q,
|
||||
l = q % 4 ? p[n] : p[n - 4],
|
||||
r[q] = 4 > q || 4 >= n ? l : S[M[l >>> 24]] ^ h[M[l >>> 16 & 255]] ^ J[M[l >>> 8 & 255]] ^ L[M[l & 255]]
|
||||
}
|
||||
},
|
||||
encryptBlock: function(d, c) {
|
||||
this._doCryptBlock(d, c, this._keySchedule, D, I, m, A, M)
|
||||
},
|
||||
decryptBlock: function(b, j) {
|
||||
var e = b[j + 1];
|
||||
b[j + 1] = b[j + 3];
|
||||
b[j + 3] = e;
|
||||
this._doCryptBlock(b, j, this._invKeySchedule, S, h, J, L, E);
|
||||
e = b[j + 1];
|
||||
b[j + 1] = b[j + 3];
|
||||
b[j + 3] = e
|
||||
},
|
||||
_doCryptBlock: function(ac, ab, aa, Z, Y, U, G, X) {
|
||||
for (var F = this._nRounds, W = ac[ab] ^ aa[0], V = ac[ab + 1] ^ aa[1], H = ac[ab + 2] ^ aa[2], z = ac[ab + 3] ^ aa[3], y = 4, w = 1; w < F; w++) {
|
||||
var x = Z[W >>> 24] ^ Y[V >>> 16 & 255] ^ U[H >>> 8 & 255] ^ G[z & 255] ^ aa[y++]
|
||||
, v = Z[V >>> 24] ^ Y[H >>> 16 & 255] ^ U[z >>> 8 & 255] ^ G[W & 255] ^ aa[y++]
|
||||
, u = Z[H >>> 24] ^ Y[z >>> 16 & 255] ^ U[W >>> 8 & 255] ^ G[V & 255] ^ aa[y++]
|
||||
, z = Z[z >>> 24] ^ Y[W >>> 16 & 255] ^ U[V >>> 8 & 255] ^ G[H & 255] ^ aa[y++]
|
||||
, W = x
|
||||
, V = v
|
||||
, H = u
|
||||
}
|
||||
x = (X[W >>> 24] << 24 | X[V >>> 16 & 255] << 16 | X[H >>> 8 & 255] << 8 | X[z & 255]) ^ aa[y++];
|
||||
v = (X[V >>> 24] << 24 | X[H >>> 16 & 255] << 16 | X[z >>> 8 & 255] << 8 | X[W & 255]) ^ aa[y++];
|
||||
u = (X[H >>> 24] << 24 | X[z >>> 16 & 255] << 16 | X[W >>> 8 & 255] << 8 | X[V & 255]) ^ aa[y++];
|
||||
z = (X[z >>> 24] << 24 | X[W >>> 16 & 255] << 16 | X[V >>> 8 & 255] << 8 | X[H & 255]) ^ aa[y++];
|
||||
ac[ab] = x;
|
||||
ac[ab + 1] = v;
|
||||
ac[ab + 2] = u;
|
||||
ac[ab + 3] = z
|
||||
},
|
||||
keySize: 8
|
||||
});
|
||||
C.AES = K._createHelper(Q)
|
||||
}
|
||||
)();
|
42
3-代码包/PyExecjsDemo/run_aes.py
Normal file
42
3-代码包/PyExecjsDemo/run_aes.py
Normal file
@ -0,0 +1,42 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @时间 : 2019-11-10 00:00
|
||||
# @作者 : 陈祥安
|
||||
# @文件名 : run_aes.py
|
||||
# @公众号: Python学习开发
|
||||
from pprint import pprint
|
||||
|
||||
import execjs
|
||||
import pathlib
|
||||
import os
|
||||
|
||||
js_path = pathlib.Path(os.path.abspath(os.path.dirname(__file__)))
|
||||
js_path = js_path / "crypto.js"
|
||||
with js_path.open('r', encoding="utf-8") as f:
|
||||
script = f.read()
|
||||
|
||||
c = "1234"
|
||||
|
||||
# 传入python中的变量
|
||||
add = ('''
|
||||
aesEncrypt = function() {
|
||||
result={}
|
||||
var t = CryptoJS.MD5("login.xxx.com"),
|
||||
i = CryptoJS.enc.Utf8.parse(t),
|
||||
r = CryptoJS.enc.Utf8.parse("1234567812345678"),
|
||||
u = CryptoJS.AES.encrypt(''' + "'{}'".format(c) + ''',i, {
|
||||
iv: r
|
||||
});
|
||||
result.t=t.toString()
|
||||
result.i =i.toString()
|
||||
result.r =r.toString()
|
||||
result.u =u.toString()
|
||||
return result
|
||||
};
|
||||
''')
|
||||
script = script + add
|
||||
print("script",script)
|
||||
|
||||
|
||||
x = execjs.compile(script)
|
||||
result = x.call("aesEncrypt")
|
||||
print(result)
|
5
3-代码包/PyppeteerDemo/__init__.py
Normal file
5
3-代码包/PyppeteerDemo/__init__.py
Normal file
@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2019-10-27 21:34
|
||||
# @Author : cxa
|
||||
# @File : __init__.py.py
|
||||
# @Software: PyCharm
|
43
3-代码包/PyppeteerDemo/demo.py
Normal file
43
3-代码包/PyppeteerDemo/demo.py
Normal file
@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2019-10-27 22:01
|
||||
# @Author : cxa
|
||||
# @File : demo.py
|
||||
# @Software: PyCharm
|
||||
from pyppeteer import launch
|
||||
import asyncio
|
||||
|
||||
|
||||
def get_text(id,attr):
|
||||
### 拼接字符串注意{}要写出{{}}
|
||||
script=("""
|
||||
let id='{id}';
|
||||
let attr='{attr}';
|
||||
let supporter ="chrome";
|
||||
const run=function(){{
|
||||
let all_str = $(id).getAttribute(attr)
|
||||
let end_index=supporter.length+58
|
||||
Base64._keyStr = all_str.substring(0, end_index)
|
||||
let charset = all_str.substring(64, all_str.length)
|
||||
let encoded = Base64.decode(charset,supporter);
|
||||
return encoded
|
||||
}}
|
||||
run()
|
||||
""").format(id=id,attr=attr)
|
||||
return script
|
||||
|
||||
|
||||
|
||||
async def run():
|
||||
browser = await launch({"headless": True})
|
||||
page = await browser.newPage()
|
||||
await page.goto('http://127.0.0.1:5002/')
|
||||
script = get_text("base64","data")
|
||||
text = await page.evaluate(script)
|
||||
|
||||
print(text)
|
||||
return text
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(run())
|
87
3-代码包/PyppeteerDemo/my_base64.py
Normal file
87
3-代码包/PyppeteerDemo/my_base64.py
Normal file
@ -0,0 +1,87 @@
|
||||
import string
|
||||
import random
|
||||
|
||||
# base 字符集
|
||||
|
||||
|
||||
base64_charset = string.ascii_uppercase + string.ascii_lowercase + string.digits + '+/'
|
||||
base64_charset_list = list(base64_charset)
|
||||
random.shuffle(base64_charset_list)
|
||||
base64_charset = ''.join(base64_charset_list)
|
||||
|
||||
|
||||
def encode(orgin_string):
|
||||
"""
|
||||
将bytes类型编码为base64
|
||||
:param origin_bytes:需要编码的bytes
|
||||
:return:base64字符串
|
||||
"""
|
||||
|
||||
origin_bytes = orgin_string.encode()
|
||||
# 将每一位bytes转换为二进制字符串
|
||||
base64_bytes = [f"{str(bin(b)).replace('0b', ''):0>8}" for b in origin_bytes]
|
||||
|
||||
resp = ''
|
||||
nums = len(base64_bytes) // 3
|
||||
remain = len(base64_bytes) % 3
|
||||
|
||||
integral_part = base64_bytes[0:3 * nums]
|
||||
while integral_part:
|
||||
# 取三个字节,以每6比特,转换为4个整数
|
||||
tmp_unit = ''.join(integral_part[0:3])
|
||||
tmp_unit = [int(tmp_unit[x: x + 6], 2) for x in [0, 6, 12, 18]]
|
||||
# 取对应base64字符
|
||||
resp += ''.join([base64_charset[i] for i in tmp_unit])
|
||||
integral_part = integral_part[3:]
|
||||
|
||||
if remain:
|
||||
# 补齐三个字节,每个字节补充 0000 0000
|
||||
remain_part = ''.join(base64_bytes[3 * nums:]) + (3 - remain) * '0' * 8
|
||||
# 取三个字节,以每6比特,转换为4个整数
|
||||
# 剩余1字节可构造2个base64字符,补充==;剩余2字节可构造3个base64字符,补充=
|
||||
tmp_unit = [int(remain_part[x: x + 6], 2) for x in [0, 6, 12, 18]][:remain + 1]
|
||||
resp += ''.join([base64_charset[i] for i in tmp_unit]) + (3 - remain) * '='
|
||||
|
||||
return resp, base64_charset
|
||||
|
||||
|
||||
def decode(base64_str, charset):
|
||||
"""
|
||||
解码base64字符串
|
||||
:param base64_str:base64字符串
|
||||
:return:解码后的bytearray;若入参不是合法base64字符串,返回空bytearray
|
||||
"""
|
||||
|
||||
# 对每一个base64字符取下标索引,并转换为6为二进制字符串
|
||||
base64_bytes = [f"{str(bin(charset.index(s))).replace('0b', ''):0>6}" for s in base64_str if
|
||||
s != '=']
|
||||
print("base64_bytes", base64_bytes)
|
||||
resp = bytearray()
|
||||
nums = len(base64_bytes) // 4
|
||||
remain = len(base64_bytes) % 4
|
||||
integral_part = base64_bytes[0:4 * nums]
|
||||
|
||||
while integral_part:
|
||||
# 取4个6位base64字符,作为3个字节
|
||||
tmp_unit = ''.join(integral_part[0:4])
|
||||
tmp_unit = [int(tmp_unit[x: x + 8], 2) for x in [0, 8, 16]]
|
||||
for i in tmp_unit:
|
||||
resp.append(i)
|
||||
integral_part = integral_part[4:]
|
||||
|
||||
if remain:
|
||||
remain_part = ''.join(base64_bytes[nums * 4:])
|
||||
tmp_unit = [int(remain_part[i * 8:(i + 1) * 8], 2) for i in range(remain - 1)]
|
||||
for i in tmp_unit:
|
||||
resp.append(i)
|
||||
|
||||
return str(bytes(resp),encoding="utf-8"), charset
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
a = encode("NightTeam")
|
||||
b = decode(a[0], a[1])
|
||||
print(a)
|
||||
print(b)
|
56
3-代码包/PyppeteerDemo/server.py
Normal file
56
3-代码包/PyppeteerDemo/server.py
Normal file
@ -0,0 +1,56 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @时间 : 2019-12-30 00:18
|
||||
# @作者 : 陈祥安
|
||||
# @文件名 : server.py
|
||||
# @公众号: Python学习开发
|
||||
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2019-10-14 16:22
|
||||
# @Author : cxa
|
||||
# @File : server.py
|
||||
# @Software: PyCharm
|
||||
|
||||
from flask import Flask, render_template
|
||||
import random
|
||||
import my_base64
|
||||
app = Flask(__name__)
|
||||
|
||||
text = """
|
||||
Life is not about waiting for the storm to pass. it's about learning to dance in the rain.
|
||||
生活不是等待暴风雨过去,而是要学会在雨中跳舞。
|
||||
What is insistence? That is, day after day, you tell yourself to go on for another day.
|
||||
什么是坚持?那就是,一天又一天,你告诉自己,再坚持一天。
|
||||
I don't want to earn my living. I want to live. --Oscar·Wilde.
|
||||
我不想谋生。我想生活。--奥斯卡·王尔德。
|
||||
Life has not the best choice, but to undertake your choice.
|
||||
生活不是拥有最好的选择,而是承担你的选择。
|
||||
It takes courage to follow your mind. But it takes everything to follow your heart.
|
||||
跟着理智走,要有勇气;跟着感觉走,要有倾其所有的决心。
|
||||
You may be our of my sight, but never out of my mind.
|
||||
"""
|
||||
text_gen = [item for item in text.split("\n") if item]
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
origin_text = random.choice(text_gen).strip()
|
||||
|
||||
text_encode, charset = my_base64.encode(origin_text)
|
||||
variable = {"text": text_encode, "charset": charset}
|
||||
|
||||
return render_template("index.html", variable=variable)
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def miss(e):
|
||||
return render_template('404.html'), 404
|
||||
|
||||
|
||||
@app.errorhandler(500)
|
||||
def error(e):
|
||||
return render_template('500.html'), 500
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port=5002, debug=True)
|
162
3-代码包/PyppeteerDemo/static/js/base64.js
Normal file
162
3-代码包/PyppeteerDemo/static/js/base64.js
Normal file
@ -0,0 +1,162 @@
|
||||
function detectAuto() {
|
||||
if (/HeadlessChrome/.test(navigator.userAgent) || // ua test
|
||||
!window.chrome || // headless test
|
||||
navigator.plugins.length === 0 || //plugins test
|
||||
// languages test
|
||||
!navigator.languages || navigator.languages.length === 0) {
|
||||
return true;
|
||||
}}
|
||||
var Base64 = {
|
||||
|
||||
// private property
|
||||
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
||||
|
||||
// public method for encoding
|
||||
, encode: function (input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
|
||||
input = Base64._utf8_encode(input);
|
||||
|
||||
while (i < input.length) {
|
||||
chr1 = input.charCodeAt(i++);
|
||||
chr2 = input.charCodeAt(i++);
|
||||
chr3 = input.charCodeAt(i++);
|
||||
|
||||
enc1 = chr1 >> 2;
|
||||
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
||||
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
||||
enc4 = chr3 & 63;
|
||||
|
||||
if (isNaN(chr2)) {
|
||||
enc3 = enc4 = 64;
|
||||
} else if (isNaN(chr3)) {
|
||||
enc4 = 64;
|
||||
}
|
||||
|
||||
output = output +
|
||||
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
|
||||
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
||||
} // Whend
|
||||
|
||||
return output;
|
||||
} // End Function encode
|
||||
|
||||
|
||||
// public method for decoding
|
||||
, decode: function (input,supporter) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3;
|
||||
var enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
|
||||
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||
while (i < input.length) {
|
||||
enc1 = this._keyStr.indexOf(input.charAt(i++));
|
||||
enc2 = this._keyStr.indexOf(input.charAt(i++));
|
||||
enc3 = this._keyStr.indexOf(input.charAt(i++));
|
||||
enc4 = this._keyStr.indexOf(input.charAt(i++));
|
||||
|
||||
chr1 = (enc1 << 2) | (enc2 >> 4);
|
||||
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
||||
chr3 = ((enc3 & 3) << supporter.length) | enc4;
|
||||
|
||||
output = output + String.fromCharCode(chr1);
|
||||
|
||||
if (enc3 != 64) {
|
||||
output = output + String.fromCharCode(chr2);
|
||||
}
|
||||
|
||||
if (enc4 != 64) {
|
||||
output = output + String.fromCharCode(chr3);
|
||||
}
|
||||
|
||||
} // Whend
|
||||
|
||||
output = Base64._utf8_decode(output);
|
||||
|
||||
return output;
|
||||
} // End Function decode
|
||||
|
||||
|
||||
// private method for UTF-8 encoding
|
||||
, _utf8_encode: function (string) {
|
||||
var utftext = "";
|
||||
string = string.replace(/\r\n/g, "\n");
|
||||
|
||||
for (var n = 0; n < string.length; n++) {
|
||||
var c = string.charCodeAt(n);
|
||||
|
||||
if (c < 128) {
|
||||
utftext += String.fromCharCode(c);
|
||||
} else if ((c > 127) && (c < 2048)) {
|
||||
utftext += String.fromCharCode((c >> 6) | 192);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
} else {
|
||||
utftext += String.fromCharCode((c >> 12) | 224);
|
||||
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
}
|
||||
|
||||
} // Next n
|
||||
|
||||
return utftext;
|
||||
} // End Function _utf8_encode
|
||||
|
||||
// private method for UTF-8 decoding
|
||||
, _utf8_decode: function (utftext) {
|
||||
var string = "";
|
||||
var i = 0;
|
||||
var c, c1, c2, c3;
|
||||
c = c1 = c2 = 0;
|
||||
|
||||
while (i < utftext.length) {
|
||||
c = utftext.charCodeAt(i);
|
||||
|
||||
if (c < 128) {
|
||||
string += String.fromCharCode(c);
|
||||
i++;
|
||||
} else if ((c > 191) && (c < 224)) {
|
||||
c2 = utftext.charCodeAt(i + 1);
|
||||
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
||||
i += 2;
|
||||
} else {
|
||||
c2 = utftext.charCodeAt(i + 1);
|
||||
c3 = utftext.charCodeAt(i + 2);
|
||||
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
||||
i += 3;
|
||||
}
|
||||
|
||||
} // Whend
|
||||
|
||||
return string;
|
||||
}, // End Function _utf8_decode
|
||||
run: function (id, attr,supporter) {
|
||||
let all_str = $(id).getAttribute(attr)
|
||||
let end_index=supporter.length+58
|
||||
Base64._keyStr = all_str.substring(0, end_index)
|
||||
let charset = all_str.substring(64, all_str.length)
|
||||
let encoded = Base64.decode(charset,supporter);
|
||||
$(id).value = encoded;
|
||||
}
|
||||
|
||||
}
|
||||
$ = function (id) {
|
||||
return document.getElementById(id)
|
||||
};
|
||||
|
||||
function doit() {
|
||||
if(!detect){
|
||||
Base64.run('base64', 'data',"chrome")
|
||||
}
|
||||
|
||||
}
|
||||
let detect=detectAuto()
|
||||
if (detect){
|
||||
window.onload =doit
|
||||
}else{
|
||||
let div=document.createElement("div")
|
||||
div.innerHTML ="禁止爬虫"
|
||||
document.body.appendChild(div)
|
||||
}
|
143
3-代码包/PyppeteerDemo/static/js/browser_check.js
Normal file
143
3-代码包/PyppeteerDemo/static/js/browser_check.js
Normal file
@ -0,0 +1,143 @@
|
||||
export default function BrowserType() {
|
||||
// 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
const testUa = regexp => regexp.test(ua);
|
||||
const testVs = regexp => ua.match(regexp)
|
||||
.toString()
|
||||
.replace(/[^0-9|_.]/g, "")
|
||||
.replace(/_/g, ".");
|
||||
// 系统
|
||||
let system = "unknow";
|
||||
if (testUa(/windows|win32|win64|wow32|wow64/g)) {
|
||||
system = "windows"; // windows系统
|
||||
} else if (testUa(/macintosh|macintel/g)) {
|
||||
system = "macos"; // macos系统
|
||||
} else if (testUa(/x11/g)) {
|
||||
system = "linux"; // linux系统
|
||||
} else if (testUa(/android|adr/g)) {
|
||||
system = "android"; // android系统
|
||||
} else if (testUa(/ios|iphone|ipad|ipod|iwatch/g)) {
|
||||
system = "ios"; // ios系统
|
||||
}
|
||||
// 系统版本
|
||||
let systemVs = "unknow";
|
||||
if (system === "windows") {
|
||||
if (testUa(/windows nt 5.0|windows 2000/g)) {
|
||||
systemVs = "2000";
|
||||
} else if (testUa(/windows nt 5.1|windows xp/g)) {
|
||||
systemVs = "xp";
|
||||
} else if (testUa(/windows nt 5.2|windows 2003/g)) {
|
||||
systemVs = "2003";
|
||||
} else if (testUa(/windows nt 6.0|windows vista/g)) {
|
||||
systemVs = "vista";
|
||||
} else if (testUa(/windows nt 6.1|windows 7/g)) {
|
||||
systemVs = "7";
|
||||
} else if (testUa(/windows nt 6.2|windows 8/g)) {
|
||||
systemVs = "8";
|
||||
} else if (testUa(/windows nt 6.3|windows 8.1/g)) {
|
||||
systemVs = "8.1";
|
||||
} else if (testUa(/windows nt 10.0|windows 10/g)) {
|
||||
systemVs = "10";
|
||||
}
|
||||
} else if (system === "macos") {
|
||||
systemVs = testVs(/os x [\d._]+/g);
|
||||
} else if (system === "android") {
|
||||
systemVs = testVs(/android [\d._]+/g);
|
||||
} else if (system === "ios") {
|
||||
systemVs = testVs(/os [\d._]+/g);
|
||||
}
|
||||
// 平台
|
||||
let platform = "unknow";
|
||||
if (system === "windows" || system === "macos" || system === "linux") {
|
||||
platform = "desktop"; // 桌面端
|
||||
} else if (system === "android" || system === "ios" || testUa(/mobile/g)) {
|
||||
platform = "mobile"; // 移动端
|
||||
}
|
||||
// 内核和载体
|
||||
let engine = "unknow";
|
||||
let supporter = "unknow";
|
||||
if (testUa(/applewebkit/g)) {
|
||||
engine = "webkit"; // webkit内核
|
||||
if (testUa(/edge/g)) {
|
||||
supporter = "edge"; // edge浏览器
|
||||
} else if (testUa(/opr/g)) {
|
||||
supporter = "opera"; // opera浏览器
|
||||
} else if (testUa(/chrome/g)) {
|
||||
supporter = "chrome"; // chrome浏览器
|
||||
} else if (testUa(/safari/g)) {
|
||||
supporter = "safari"; // safari浏览器
|
||||
}
|
||||
} else if (testUa(/gecko/g) && testUa(/firefox/g)) {
|
||||
engine = "gecko"; // gecko内核
|
||||
supporter = "firefox"; // firefox浏览器
|
||||
} else if (testUa(/presto/g)) {
|
||||
engine = "presto"; // presto内核
|
||||
supporter = "opera"; // opera浏览器
|
||||
} else if (testUa(/trident|compatible|msie/g)) {
|
||||
engine = "trident"; // trident内核
|
||||
supporter = "iexplore"; // iexplore浏览器
|
||||
}
|
||||
// 内核版本
|
||||
let engineVs = "unknow";
|
||||
if (engine === "webkit") {
|
||||
engineVs = testVs(/applewebkit\/[\d._]+/g);
|
||||
} else if (engine === "gecko") {
|
||||
engineVs = testVs(/gecko\/[\d._]+/g);
|
||||
} else if (engine === "presto") {
|
||||
engineVs = testVs(/presto\/[\d._]+/g);
|
||||
} else if (engine === "trident") {
|
||||
engineVs = testVs(/trident\/[\d._]+/g);
|
||||
}
|
||||
// 载体版本
|
||||
let supporterVs = "unknow";
|
||||
if (supporter === "chrome") {
|
||||
supporterVs = testVs(/chrome\/[\d._]+/g);
|
||||
} else if (supporter === "safari") {
|
||||
supporterVs = testVs(/version\/[\d._]+/g);
|
||||
} else if (supporter === "firefox") {
|
||||
supporterVs = testVs(/firefox\/[\d._]+/g);
|
||||
} else if (supporter === "opera") {
|
||||
supporterVs = testVs(/opr\/[\d._]+/g);
|
||||
} else if (supporter === "iexplore") {
|
||||
supporterVs = testVs(/(msie [\d._]+)|(rv:[\d._]+)/g);
|
||||
} else if (supporter === "edge") {
|
||||
supporterVs = testVs(/edge\/[\d._]+/g);
|
||||
}
|
||||
// 外壳和外壳版本
|
||||
let shell = "none";
|
||||
let shellVs = "unknow";
|
||||
if (testUa(/micromessenger/g)) {
|
||||
shell = "wechat"; // 微信浏览器
|
||||
shellVs = testVs(/micromessenger\/[\d._]+/g);
|
||||
} else if (testUa(/qqbrowser/g)) {
|
||||
shell = "qq"; // QQ浏览器
|
||||
shellVs = testVs(/qqbrowser\/[\d._]+/g);
|
||||
} else if (testUa(/ucbrowser/g)) {
|
||||
shell = "uc"; // UC浏览器
|
||||
shellVs = testVs(/ucbrowser\/[\d._]+/g);
|
||||
} else if (testUa(/qihu 360se/g)) {
|
||||
shell = "360"; // 360浏览器(无版本)
|
||||
} else if (testUa(/2345explorer/g)) {
|
||||
shell = "2345"; // 2345浏览器
|
||||
shellVs = testVs(/2345explorer\/[\d._]+/g);
|
||||
} else if (testUa(/metasr/g)) {
|
||||
shell = "sougou"; // 搜狗浏览器(无版本)
|
||||
} else if (testUa(/lbbrowser/g)) {
|
||||
shell = "liebao"; // 猎豹浏览器(无版本)
|
||||
} else if (testUa(/maxthon/g)) {
|
||||
shell = "maxthon"; // 遨游浏览器
|
||||
shellVs = testVs(/maxthon\/[\d._]+/g);
|
||||
}
|
||||
return Object.assign({
|
||||
engine, // webkit gecko presto trident
|
||||
engineVs,
|
||||
platform, // desktop mobile
|
||||
supporter, // chrome safari firefox opera iexplore edge
|
||||
supporterVs,
|
||||
system, // windows macos linux android ios
|
||||
systemVs
|
||||
}, shell === "none" ? {} : {
|
||||
shell, // wechat qq uc 360 2345 sougou liebao maxthon
|
||||
shellVs
|
||||
});
|
||||
}
|
10
3-代码包/PyppeteerDemo/templates/404.html
Normal file
10
3-代码包/PyppeteerDemo/templates/404.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>链接错误,请重新确认</h1>
|
||||
</body>
|
||||
</html>
|
10
3-代码包/PyppeteerDemo/templates/500.html
Normal file
10
3-代码包/PyppeteerDemo/templates/500.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>请使用post请求,谢谢。</h1>
|
||||
</body>
|
||||
</html>
|
14
3-代码包/PyppeteerDemo/templates/index.html
Normal file
14
3-代码包/PyppeteerDemo/templates/index.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>每日一句</title>
|
||||
<script src="/static/js/base64.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<input id="base64" data="{{ variable.charset }}{{ variable.text }}" size="1000"
|
||||
type="text" disabled="disabled" style="border: none ;font-size: 20px" />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
5
3-代码包/SeleniumDemo/__init__.py
Normal file
5
3-代码包/SeleniumDemo/__init__.py
Normal file
@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2019-10-27 20:56
|
||||
# @Author : cxa
|
||||
# @File : __init__.py.py
|
||||
# @Software: PyCharm
|
49
3-代码包/SeleniumDemo/demo.py
Normal file
49
3-代码包/SeleniumDemo/demo.py
Normal file
@ -0,0 +1,49 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2019-10-27 20:56
|
||||
# @Author : cxa
|
||||
# @File : demo.py
|
||||
# @Software: PyCharm
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.webdriver.common.action_chains import ActionChains
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
import time
|
||||
|
||||
|
||||
def get_text(id,attr):
|
||||
### 拼接字符串注意{}要写出{{}}
|
||||
script=("""
|
||||
let bt=BrowserType();
|
||||
let id='{id}';
|
||||
let attr='{attr}';
|
||||
let supporter =bt.supporter;
|
||||
const run=function(){{
|
||||
let all_str = $(id).getAttribute(attr)
|
||||
let end_index=supporter.length+58
|
||||
Base64._keyStr = all_str.substring(0, end_index)
|
||||
let charset = all_str.substring(64, all_str.length)
|
||||
let encoded = Base64.decode(charset,supporter);
|
||||
return encoded
|
||||
}}
|
||||
return run()
|
||||
""").format(id=id,attr=attr)
|
||||
return script
|
||||
|
||||
|
||||
|
||||
chrome_option = Options()
|
||||
chrome_option.add_argument("--headless")
|
||||
chrome_option.add_argument("--disable-gpu")
|
||||
chrome_option.add_argument('--ignore-certificate-errors') # SSL保存
|
||||
browser = webdriver.Chrome(options=chrome_option)
|
||||
wait = WebDriverWait(browser, 10)
|
||||
# 启动浏览器,获取网页源代码
|
||||
mainUrl = "http://127.0.0.1:5002/"
|
||||
browser.get(mainUrl)
|
||||
result=browser.execute_script(get_text("base64","data"))
|
||||
print(result)
|
||||
time.sleep(10)
|
||||
browser.quit()
|
87
3-代码包/SeleniumDemo/my_base64.py
Normal file
87
3-代码包/SeleniumDemo/my_base64.py
Normal file
@ -0,0 +1,87 @@
|
||||
import string
|
||||
import random
|
||||
|
||||
# base 字符集
|
||||
|
||||
|
||||
base64_charset = string.ascii_uppercase + string.ascii_lowercase + string.digits + '+/'
|
||||
base64_charset_list = list(base64_charset)
|
||||
random.shuffle(base64_charset_list)
|
||||
base64_charset = ''.join(base64_charset_list)
|
||||
|
||||
|
||||
def encode(orgin_string):
|
||||
"""
|
||||
将bytes类型编码为base64
|
||||
:param origin_bytes:需要编码的bytes
|
||||
:return:base64字符串
|
||||
"""
|
||||
|
||||
origin_bytes = orgin_string.encode()
|
||||
# 将每一位bytes转换为二进制字符串
|
||||
base64_bytes = [f"{str(bin(b)).replace('0b', ''):0>8}" for b in origin_bytes]
|
||||
|
||||
resp = ''
|
||||
nums = len(base64_bytes) // 3
|
||||
remain = len(base64_bytes) % 3
|
||||
|
||||
integral_part = base64_bytes[0:3 * nums]
|
||||
while integral_part:
|
||||
# 取三个字节,以每6比特,转换为4个整数
|
||||
tmp_unit = ''.join(integral_part[0:3])
|
||||
tmp_unit = [int(tmp_unit[x: x + 6], 2) for x in [0, 6, 12, 18]]
|
||||
# 取对应base64字符
|
||||
resp += ''.join([base64_charset[i] for i in tmp_unit])
|
||||
integral_part = integral_part[3:]
|
||||
|
||||
if remain:
|
||||
# 补齐三个字节,每个字节补充 0000 0000
|
||||
remain_part = ''.join(base64_bytes[3 * nums:]) + (3 - remain) * '0' * 8
|
||||
# 取三个字节,以每6比特,转换为4个整数
|
||||
# 剩余1字节可构造2个base64字符,补充==;剩余2字节可构造3个base64字符,补充=
|
||||
tmp_unit = [int(remain_part[x: x + 6], 2) for x in [0, 6, 12, 18]][:remain + 1]
|
||||
resp += ''.join([base64_charset[i] for i in tmp_unit]) + (3 - remain) * '='
|
||||
|
||||
return resp, base64_charset
|
||||
|
||||
|
||||
def decode(base64_str, charset):
|
||||
"""
|
||||
解码base64字符串
|
||||
:param base64_str:base64字符串
|
||||
:return:解码后的bytearray;若入参不是合法base64字符串,返回空bytearray
|
||||
"""
|
||||
|
||||
# 对每一个base64字符取下标索引,并转换为6为二进制字符串
|
||||
base64_bytes = [f"{str(bin(charset.index(s))).replace('0b', ''):0>6}" for s in base64_str if
|
||||
s != '=']
|
||||
print("base64_bytes", base64_bytes)
|
||||
resp = bytearray()
|
||||
nums = len(base64_bytes) // 4
|
||||
remain = len(base64_bytes) % 4
|
||||
integral_part = base64_bytes[0:4 * nums]
|
||||
|
||||
while integral_part:
|
||||
# 取4个6位base64字符,作为3个字节
|
||||
tmp_unit = ''.join(integral_part[0:4])
|
||||
tmp_unit = [int(tmp_unit[x: x + 8], 2) for x in [0, 8, 16]]
|
||||
for i in tmp_unit:
|
||||
resp.append(i)
|
||||
integral_part = integral_part[4:]
|
||||
|
||||
if remain:
|
||||
remain_part = ''.join(base64_bytes[nums * 4:])
|
||||
tmp_unit = [int(remain_part[i * 8:(i + 1) * 8], 2) for i in range(remain - 1)]
|
||||
for i in tmp_unit:
|
||||
resp.append(i)
|
||||
|
||||
return str(bytes(resp),encoding="utf-8"), charset
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
a = encode("NightTeam")
|
||||
b = decode(a[0], a[1])
|
||||
print(a)
|
||||
print(b)
|
56
3-代码包/SeleniumDemo/server.py
Normal file
56
3-代码包/SeleniumDemo/server.py
Normal file
@ -0,0 +1,56 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @时间 : 2019-12-30 00:18
|
||||
# @作者 : 陈祥安
|
||||
# @文件名 : server.py
|
||||
# @公众号: Python学习开发
|
||||
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2019-10-14 16:22
|
||||
# @Author : cxa
|
||||
# @File : server.py
|
||||
# @Software: PyCharm
|
||||
|
||||
from flask import Flask, render_template
|
||||
import random
|
||||
import my_base64
|
||||
app = Flask(__name__)
|
||||
|
||||
text = """
|
||||
Life is not about waiting for the storm to pass. it's about learning to dance in the rain.
|
||||
生活不是等待暴风雨过去,而是要学会在雨中跳舞。
|
||||
What is insistence? That is, day after day, you tell yourself to go on for another day.
|
||||
什么是坚持?那就是,一天又一天,你告诉自己,再坚持一天。
|
||||
I don't want to earn my living. I want to live. --Oscar·Wilde.
|
||||
我不想谋生。我想生活。--奥斯卡·王尔德。
|
||||
Life has not the best choice, but to undertake your choice.
|
||||
生活不是拥有最好的选择,而是承担你的选择。
|
||||
It takes courage to follow your mind. But it takes everything to follow your heart.
|
||||
跟着理智走,要有勇气;跟着感觉走,要有倾其所有的决心。
|
||||
You may be our of my sight, but never out of my mind.
|
||||
"""
|
||||
text_gen = [item for item in text.split("\n") if item]
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
origin_text = random.choice(text_gen).strip()
|
||||
|
||||
text_encode, charset = my_base64.encode(origin_text)
|
||||
variable = {"text": text_encode, "charset": charset}
|
||||
|
||||
return render_template("index.html", variable=variable)
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def miss(e):
|
||||
return render_template('404.html'), 404
|
||||
|
||||
|
||||
@app.errorhandler(500)
|
||||
def error(e):
|
||||
return render_template('500.html'), 500
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port=5002, debug=True)
|
293
3-代码包/SeleniumDemo/static/js/base64.js
Normal file
293
3-代码包/SeleniumDemo/static/js/base64.js
Normal file
@ -0,0 +1,293 @@
|
||||
function BrowserType() {
|
||||
// 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
const testUa = regexp => regexp.test(ua);
|
||||
const testVs = regexp => ua.match(regexp)
|
||||
.toString()
|
||||
.replace(/[^0-9|_.]/g, "")
|
||||
.replace(/_/g, ".");
|
||||
// 系统
|
||||
let system = "unknow";
|
||||
if (testUa(/windows|win32|win64|wow32|wow64/g)) {
|
||||
system = "windows"; // windows系统
|
||||
} else if (testUa(/macintosh|macintel/g)) {
|
||||
system = "macos"; // macos系统
|
||||
} else if (testUa(/x11/g)) {
|
||||
system = "linux"; // linux系统
|
||||
} else if (testUa(/android|adr/g)) {
|
||||
system = "android"; // android系统
|
||||
} else if (testUa(/ios|iphone|ipad|ipod|iwatch/g)) {
|
||||
system = "ios"; // ios系统
|
||||
}
|
||||
// 系统版本
|
||||
let systemVs = "unknow";
|
||||
if (system === "windows") {
|
||||
if (testUa(/windows nt 5.0|windows 2000/g)) {
|
||||
systemVs = "2000";
|
||||
} else if (testUa(/windows nt 5.1|windows xp/g)) {
|
||||
systemVs = "xp";
|
||||
} else if (testUa(/windows nt 5.2|windows 2003/g)) {
|
||||
systemVs = "2003";
|
||||
} else if (testUa(/windows nt 6.0|windows vista/g)) {
|
||||
systemVs = "vista";
|
||||
} else if (testUa(/windows nt 6.1|windows 7/g)) {
|
||||
systemVs = "7";
|
||||
} else if (testUa(/windows nt 6.2|windows 8/g)) {
|
||||
systemVs = "8";
|
||||
} else if (testUa(/windows nt 6.3|windows 8.1/g)) {
|
||||
systemVs = "8.1";
|
||||
} else if (testUa(/windows nt 10.0|windows 10/g)) {
|
||||
systemVs = "10";
|
||||
}
|
||||
} else if (system === "macos") {
|
||||
systemVs = testVs(/os x [\d._]+/g);
|
||||
} else if (system === "android") {
|
||||
systemVs = testVs(/android [\d._]+/g);
|
||||
} else if (system === "ios") {
|
||||
systemVs = testVs(/os [\d._]+/g);
|
||||
}
|
||||
// 平台
|
||||
let platform = "unknow";
|
||||
if (system === "windows" || system === "macos" || system === "linux") {
|
||||
platform = "desktop"; // 桌面端
|
||||
} else if (system === "android" || system === "ios" || testUa(/mobile/g)) {
|
||||
platform = "mobile"; // 移动端
|
||||
}
|
||||
// 内核和载体
|
||||
let engine = "unknow";
|
||||
let supporter = "unknow";
|
||||
if (testUa(/applewebkit/g)) {
|
||||
engine = "webkit"; // webkit内核
|
||||
if (testUa(/edge/g)) {
|
||||
supporter = "edge"; // edge浏览器
|
||||
} else if (testUa(/opr/g)) {
|
||||
supporter = "opera"; // opera浏览器
|
||||
} else if (testUa(/chrome/g)) {
|
||||
supporter = "chrome"; // chrome浏览器
|
||||
} else if (testUa(/safari/g)) {
|
||||
supporter = "safari"; // safari浏览器
|
||||
}
|
||||
} else if (testUa(/gecko/g) && testUa(/firefox/g)) {
|
||||
engine = "gecko"; // gecko内核
|
||||
supporter = "firefox"; // firefox浏览器
|
||||
} else if (testUa(/presto/g)) {
|
||||
engine = "presto"; // presto内核
|
||||
supporter = "opera"; // opera浏览器
|
||||
} else if (testUa(/trident|compatible|msie/g)) {
|
||||
engine = "trident"; // trident内核
|
||||
supporter = "iexplore"; // iexplore浏览器
|
||||
}
|
||||
// 内核版本
|
||||
let engineVs = "unknow";
|
||||
if (engine === "webkit") {
|
||||
engineVs = testVs(/applewebkit\/[\d._]+/g);
|
||||
} else if (engine === "gecko") {
|
||||
engineVs = testVs(/gecko\/[\d._]+/g);
|
||||
} else if (engine === "presto") {
|
||||
engineVs = testVs(/presto\/[\d._]+/g);
|
||||
} else if (engine === "trident") {
|
||||
engineVs = testVs(/trident\/[\d._]+/g);
|
||||
}
|
||||
// 载体版本
|
||||
let supporterVs = "unknow";
|
||||
if (supporter === "chrome") {
|
||||
supporterVs = testVs(/chrome\/[\d._]+/g);
|
||||
} else if (supporter === "safari") {
|
||||
supporterVs = testVs(/version\/[\d._]+/g);
|
||||
} else if (supporter === "firefox") {
|
||||
supporterVs = testVs(/firefox\/[\d._]+/g);
|
||||
} else if (supporter === "opera") {
|
||||
supporterVs = testVs(/opr\/[\d._]+/g);
|
||||
} else if (supporter === "iexplore") {
|
||||
supporterVs = testVs(/(msie [\d._]+)|(rv:[\d._]+)/g);
|
||||
} else if (supporter === "edge") {
|
||||
supporterVs = testVs(/edge\/[\d._]+/g);
|
||||
}
|
||||
// 外壳和外壳版本
|
||||
let shell = "none";
|
||||
let shellVs = "unknow";
|
||||
if (testUa(/micromessenger/g)) {
|
||||
shell = "wechat"; // 微信浏览器
|
||||
shellVs = testVs(/micromessenger\/[\d._]+/g);
|
||||
} else if (testUa(/qqbrowser/g)) {
|
||||
shell = "qq"; // QQ浏览器
|
||||
shellVs = testVs(/qqbrowser\/[\d._]+/g);
|
||||
} else if (testUa(/ucbrowser/g)) {
|
||||
shell = "uc"; // UC浏览器
|
||||
shellVs = testVs(/ucbrowser\/[\d._]+/g);
|
||||
} else if (testUa(/qihu 360se/g)) {
|
||||
shell = "360"; // 360浏览器(无版本)
|
||||
} else if (testUa(/2345explorer/g)) {
|
||||
shell = "2345"; // 2345浏览器
|
||||
shellVs = testVs(/2345explorer\/[\d._]+/g);
|
||||
} else if (testUa(/metasr/g)) {
|
||||
shell = "sougou"; // 搜狗浏览器(无版本)
|
||||
} else if (testUa(/lbbrowser/g)) {
|
||||
shell = "liebao"; // 猎豹浏览器(无版本)
|
||||
} else if (testUa(/maxthon/g)) {
|
||||
shell = "maxthon"; // 遨游浏览器
|
||||
shellVs = testVs(/maxthon\/[\d._]+/g);
|
||||
}
|
||||
return Object.assign({
|
||||
engine, // webkit gecko presto trident
|
||||
engineVs,
|
||||
platform, // desktop mobile
|
||||
supporter, // chrome safari firefox opera iexplore edge
|
||||
supporterVs,
|
||||
system, // windows macos linux android ios
|
||||
systemVs
|
||||
}, shell === "none" ? {} : {
|
||||
shell, // wechat qq uc 360 2345 sougou liebao maxthon
|
||||
shellVs
|
||||
});
|
||||
}
|
||||
var Base64 = {
|
||||
|
||||
// private property
|
||||
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
||||
|
||||
// public method for encoding
|
||||
, encode: function (input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
|
||||
input = Base64._utf8_encode(input);
|
||||
|
||||
while (i < input.length) {
|
||||
chr1 = input.charCodeAt(i++);
|
||||
chr2 = input.charCodeAt(i++);
|
||||
chr3 = input.charCodeAt(i++);
|
||||
|
||||
enc1 = chr1 >> 2;
|
||||
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
||||
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
||||
enc4 = chr3 & 63;
|
||||
|
||||
if (isNaN(chr2)) {
|
||||
enc3 = enc4 = 64;
|
||||
} else if (isNaN(chr3)) {
|
||||
enc4 = 64;
|
||||
}
|
||||
|
||||
output = output +
|
||||
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
|
||||
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
||||
} // Whend
|
||||
|
||||
return output;
|
||||
} // End Function encode
|
||||
|
||||
|
||||
// public method for decoding
|
||||
, decode: function (input,supporter) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3;
|
||||
var enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
|
||||
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||
while (i < input.length) {
|
||||
enc1 = this._keyStr.indexOf(input.charAt(i++));
|
||||
enc2 = this._keyStr.indexOf(input.charAt(i++));
|
||||
enc3 = this._keyStr.indexOf(input.charAt(i++));
|
||||
enc4 = this._keyStr.indexOf(input.charAt(i++));
|
||||
|
||||
chr1 = (enc1 << 2) | (enc2 >> 4);
|
||||
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
||||
chr3 = ((enc3 & 3) << supporter.length) | enc4;
|
||||
|
||||
output = output + String.fromCharCode(chr1);
|
||||
|
||||
if (enc3 != 64) {
|
||||
output = output + String.fromCharCode(chr2);
|
||||
}
|
||||
|
||||
if (enc4 != 64) {
|
||||
output = output + String.fromCharCode(chr3);
|
||||
}
|
||||
|
||||
} // Whend
|
||||
|
||||
output = Base64._utf8_decode(output);
|
||||
|
||||
return output;
|
||||
} // End Function decode
|
||||
|
||||
|
||||
// private method for UTF-8 encoding
|
||||
, _utf8_encode: function (string) {
|
||||
var utftext = "";
|
||||
string = string.replace(/\r\n/g, "\n");
|
||||
|
||||
for (var n = 0; n < string.length; n++) {
|
||||
var c = string.charCodeAt(n);
|
||||
|
||||
if (c < 128) {
|
||||
utftext += String.fromCharCode(c);
|
||||
} else if ((c > 127) && (c < 2048)) {
|
||||
utftext += String.fromCharCode((c >> 6) | 192);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
} else {
|
||||
utftext += String.fromCharCode((c >> 12) | 224);
|
||||
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
}
|
||||
|
||||
} // Next n
|
||||
|
||||
return utftext;
|
||||
} // End Function _utf8_encode
|
||||
|
||||
// private method for UTF-8 decoding
|
||||
, _utf8_decode: function (utftext) {
|
||||
var string = "";
|
||||
var i = 0;
|
||||
var c, c1, c2, c3;
|
||||
c = c1 = c2 = 0;
|
||||
|
||||
while (i < utftext.length) {
|
||||
c = utftext.charCodeAt(i);
|
||||
|
||||
if (c < 128) {
|
||||
string += String.fromCharCode(c);
|
||||
i++;
|
||||
} else if ((c > 191) && (c < 224)) {
|
||||
c2 = utftext.charCodeAt(i + 1);
|
||||
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
||||
i += 2;
|
||||
} else {
|
||||
c2 = utftext.charCodeAt(i + 1);
|
||||
c3 = utftext.charCodeAt(i + 2);
|
||||
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
||||
i += 3;
|
||||
}
|
||||
|
||||
} // Whend
|
||||
|
||||
return string;
|
||||
}, // End Function _utf8_decode
|
||||
run: function (id, attr,supporter) {
|
||||
let all_str = $(id).getAttribute(attr)
|
||||
let end_index=supporter.length+58
|
||||
Base64._keyStr = all_str.substring(0, end_index)
|
||||
let charset = all_str.substring(64, all_str.length)
|
||||
let encoded = Base64.decode(charset,supporter);
|
||||
$(id).value = encoded;
|
||||
}
|
||||
|
||||
}
|
||||
$ = function (id) {
|
||||
return document.getElementById(id)
|
||||
};
|
||||
|
||||
function doit() {
|
||||
let browser_type=BrowserType();
|
||||
console.log(browser_type)
|
||||
let supporter =browser_type.supporter
|
||||
if(supporter==="chrome"){
|
||||
Base64.run('base64', 'data',supporter)
|
||||
}
|
||||
|
||||
}
|
||||
window.onload =doit
|
143
3-代码包/SeleniumDemo/static/js/browser_check.js
Normal file
143
3-代码包/SeleniumDemo/static/js/browser_check.js
Normal file
@ -0,0 +1,143 @@
|
||||
export default function BrowserType() {
|
||||
// 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
const testUa = regexp => regexp.test(ua);
|
||||
const testVs = regexp => ua.match(regexp)
|
||||
.toString()
|
||||
.replace(/[^0-9|_.]/g, "")
|
||||
.replace(/_/g, ".");
|
||||
// 系统
|
||||
let system = "unknow";
|
||||
if (testUa(/windows|win32|win64|wow32|wow64/g)) {
|
||||
system = "windows"; // windows系统
|
||||
} else if (testUa(/macintosh|macintel/g)) {
|
||||
system = "macos"; // macos系统
|
||||
} else if (testUa(/x11/g)) {
|
||||
system = "linux"; // linux系统
|
||||
} else if (testUa(/android|adr/g)) {
|
||||
system = "android"; // android系统
|
||||
} else if (testUa(/ios|iphone|ipad|ipod|iwatch/g)) {
|
||||
system = "ios"; // ios系统
|
||||
}
|
||||
// 系统版本
|
||||
let systemVs = "unknow";
|
||||
if (system === "windows") {
|
||||
if (testUa(/windows nt 5.0|windows 2000/g)) {
|
||||
systemVs = "2000";
|
||||
} else if (testUa(/windows nt 5.1|windows xp/g)) {
|
||||
systemVs = "xp";
|
||||
} else if (testUa(/windows nt 5.2|windows 2003/g)) {
|
||||
systemVs = "2003";
|
||||
} else if (testUa(/windows nt 6.0|windows vista/g)) {
|
||||
systemVs = "vista";
|
||||
} else if (testUa(/windows nt 6.1|windows 7/g)) {
|
||||
systemVs = "7";
|
||||
} else if (testUa(/windows nt 6.2|windows 8/g)) {
|
||||
systemVs = "8";
|
||||
} else if (testUa(/windows nt 6.3|windows 8.1/g)) {
|
||||
systemVs = "8.1";
|
||||
} else if (testUa(/windows nt 10.0|windows 10/g)) {
|
||||
systemVs = "10";
|
||||
}
|
||||
} else if (system === "macos") {
|
||||
systemVs = testVs(/os x [\d._]+/g);
|
||||
} else if (system === "android") {
|
||||
systemVs = testVs(/android [\d._]+/g);
|
||||
} else if (system === "ios") {
|
||||
systemVs = testVs(/os [\d._]+/g);
|
||||
}
|
||||
// 平台
|
||||
let platform = "unknow";
|
||||
if (system === "windows" || system === "macos" || system === "linux") {
|
||||
platform = "desktop"; // 桌面端
|
||||
} else if (system === "android" || system === "ios" || testUa(/mobile/g)) {
|
||||
platform = "mobile"; // 移动端
|
||||
}
|
||||
// 内核和载体
|
||||
let engine = "unknow";
|
||||
let supporter = "unknow";
|
||||
if (testUa(/applewebkit/g)) {
|
||||
engine = "webkit"; // webkit内核
|
||||
if (testUa(/edge/g)) {
|
||||
supporter = "edge"; // edge浏览器
|
||||
} else if (testUa(/opr/g)) {
|
||||
supporter = "opera"; // opera浏览器
|
||||
} else if (testUa(/chrome/g)) {
|
||||
supporter = "chrome"; // chrome浏览器
|
||||
} else if (testUa(/safari/g)) {
|
||||
supporter = "safari"; // safari浏览器
|
||||
}
|
||||
} else if (testUa(/gecko/g) && testUa(/firefox/g)) {
|
||||
engine = "gecko"; // gecko内核
|
||||
supporter = "firefox"; // firefox浏览器
|
||||
} else if (testUa(/presto/g)) {
|
||||
engine = "presto"; // presto内核
|
||||
supporter = "opera"; // opera浏览器
|
||||
} else if (testUa(/trident|compatible|msie/g)) {
|
||||
engine = "trident"; // trident内核
|
||||
supporter = "iexplore"; // iexplore浏览器
|
||||
}
|
||||
// 内核版本
|
||||
let engineVs = "unknow";
|
||||
if (engine === "webkit") {
|
||||
engineVs = testVs(/applewebkit\/[\d._]+/g);
|
||||
} else if (engine === "gecko") {
|
||||
engineVs = testVs(/gecko\/[\d._]+/g);
|
||||
} else if (engine === "presto") {
|
||||
engineVs = testVs(/presto\/[\d._]+/g);
|
||||
} else if (engine === "trident") {
|
||||
engineVs = testVs(/trident\/[\d._]+/g);
|
||||
}
|
||||
// 载体版本
|
||||
let supporterVs = "unknow";
|
||||
if (supporter === "chrome") {
|
||||
supporterVs = testVs(/chrome\/[\d._]+/g);
|
||||
} else if (supporter === "safari") {
|
||||
supporterVs = testVs(/version\/[\d._]+/g);
|
||||
} else if (supporter === "firefox") {
|
||||
supporterVs = testVs(/firefox\/[\d._]+/g);
|
||||
} else if (supporter === "opera") {
|
||||
supporterVs = testVs(/opr\/[\d._]+/g);
|
||||
} else if (supporter === "iexplore") {
|
||||
supporterVs = testVs(/(msie [\d._]+)|(rv:[\d._]+)/g);
|
||||
} else if (supporter === "edge") {
|
||||
supporterVs = testVs(/edge\/[\d._]+/g);
|
||||
}
|
||||
// 外壳和外壳版本
|
||||
let shell = "none";
|
||||
let shellVs = "unknow";
|
||||
if (testUa(/micromessenger/g)) {
|
||||
shell = "wechat"; // 微信浏览器
|
||||
shellVs = testVs(/micromessenger\/[\d._]+/g);
|
||||
} else if (testUa(/qqbrowser/g)) {
|
||||
shell = "qq"; // QQ浏览器
|
||||
shellVs = testVs(/qqbrowser\/[\d._]+/g);
|
||||
} else if (testUa(/ucbrowser/g)) {
|
||||
shell = "uc"; // UC浏览器
|
||||
shellVs = testVs(/ucbrowser\/[\d._]+/g);
|
||||
} else if (testUa(/qihu 360se/g)) {
|
||||
shell = "360"; // 360浏览器(无版本)
|
||||
} else if (testUa(/2345explorer/g)) {
|
||||
shell = "2345"; // 2345浏览器
|
||||
shellVs = testVs(/2345explorer\/[\d._]+/g);
|
||||
} else if (testUa(/metasr/g)) {
|
||||
shell = "sougou"; // 搜狗浏览器(无版本)
|
||||
} else if (testUa(/lbbrowser/g)) {
|
||||
shell = "liebao"; // 猎豹浏览器(无版本)
|
||||
} else if (testUa(/maxthon/g)) {
|
||||
shell = "maxthon"; // 遨游浏览器
|
||||
shellVs = testVs(/maxthon\/[\d._]+/g);
|
||||
}
|
||||
return Object.assign({
|
||||
engine, // webkit gecko presto trident
|
||||
engineVs,
|
||||
platform, // desktop mobile
|
||||
supporter, // chrome safari firefox opera iexplore edge
|
||||
supporterVs,
|
||||
system, // windows macos linux android ios
|
||||
systemVs
|
||||
}, shell === "none" ? {} : {
|
||||
shell, // wechat qq uc 360 2345 sougou liebao maxthon
|
||||
shellVs
|
||||
});
|
||||
}
|
10
3-代码包/SeleniumDemo/templates/404.html
Normal file
10
3-代码包/SeleniumDemo/templates/404.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>链接错误,请重新确认</h1>
|
||||
</body>
|
||||
</html>
|
10
3-代码包/SeleniumDemo/templates/500.html
Normal file
10
3-代码包/SeleniumDemo/templates/500.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>请使用post请求,谢谢。</h1>
|
||||
</body>
|
||||
</html>
|
14
3-代码包/SeleniumDemo/templates/index.html
Normal file
14
3-代码包/SeleniumDemo/templates/index.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>每日一句</title>
|
||||
<script src="/static/js/base64.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<input id="base64" data="{{ variable.charset }}{{ variable.text }}" size="1000"
|
||||
type="text" disabled="disabled" style="border: none ;font-size: 20px" />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
471
3-代码包/练习/get_data执行结果的前16位字符是.js
Normal file
471
3-代码包/练习/get_data执行结果的前16位字符是.js
Normal file
@ -0,0 +1,471 @@
|
||||
function _0x2a7e5ao00a() {
|
||||
const _0x227afe = {
|
||||
'yHOEV': 'unknow',
|
||||
'wzENk': function(_0x3ea4f9, _0x1d95e3) {
|
||||
return _0x3ea4f9(_0x1d95e3);
|
||||
},
|
||||
'wsWEe': 'windows',
|
||||
'xTHMm': 'macos',
|
||||
'yavth': function(_0x136e2c, _0x288ce3) {
|
||||
return _0x136e2c(_0x288ce3);
|
||||
},
|
||||
'azgCA': 'linux',
|
||||
'nGybX': function(_0x56f4ea, _0x281669) {
|
||||
return _0x56f4ea(_0x281669);
|
||||
},
|
||||
'INJwr': 'ios',
|
||||
'hZWNh': function(_0x3a5bfd, _0x22a1f5) {
|
||||
return _0x3a5bfd === _0x22a1f5;
|
||||
},
|
||||
'UQRFb': '2000',
|
||||
'wwUUs': function(_0x1e2526, _0x460646) {
|
||||
return _0x1e2526(_0x460646);
|
||||
},
|
||||
'rqdHg': '2003',
|
||||
'RFYwz': '8.1',
|
||||
'VwpDM': function(_0xaa1cb5, _0xe1fb5) {
|
||||
return _0xaa1cb5 === _0xe1fb5;
|
||||
},
|
||||
'ijcZr': 'android',
|
||||
'wsPCu': function(_0x4cffe7, _0x13c2c0) {
|
||||
return _0x4cffe7(_0x13c2c0);
|
||||
},
|
||||
'CUddb': function(_0xf3d86b, _0x13613b) {
|
||||
return _0xf3d86b === _0x13613b;
|
||||
},
|
||||
'UcAvE': function(_0x303653, _0x1050a9) {
|
||||
return _0x303653 === _0x1050a9;
|
||||
},
|
||||
'UPKaK': 'desktop',
|
||||
'Teriw': function(_0x562472, _0x18365e) {
|
||||
return _0x562472 === _0x18365e;
|
||||
},
|
||||
'bSheG': function(_0x736c40, _0x28fa8c) {
|
||||
return _0x736c40(_0x28fa8c);
|
||||
},
|
||||
'VSVPX': 'mobile',
|
||||
'YLvkS': function(_0xcbe6ef, _0x62f17b) {
|
||||
return _0xcbe6ef(_0x62f17b);
|
||||
},
|
||||
'IIJTU': 'webkit',
|
||||
'VnwxS': 'edge',
|
||||
'czVTJ': 'opera',
|
||||
'nqrWh': function(_0x1a9d6b, _0x4f0983) {
|
||||
return _0x1a9d6b(_0x4f0983);
|
||||
},
|
||||
'qWvjw': 'chrome',
|
||||
'wcaLm': 'safari',
|
||||
'kpgHP': function(_0x357cb4, _0x4ec618) {
|
||||
return _0x357cb4(_0x4ec618);
|
||||
},
|
||||
'uZEiZ': function(_0x54d846, _0x45401a) {
|
||||
return _0x54d846(_0x45401a);
|
||||
},
|
||||
'Bsdxk': 'firefox',
|
||||
'brPia': function(_0x2698c5, _0x23fc33) {
|
||||
return _0x2698c5(_0x23fc33);
|
||||
},
|
||||
'OfqeT': 'presto',
|
||||
'CKdHS': function(_0x63167b, _0x50e9aa) {
|
||||
return _0x63167b(_0x50e9aa);
|
||||
},
|
||||
'MOinO': 'trident',
|
||||
'ubOMd': 'iexplore',
|
||||
'Ucccc': function(_0x48de88, _0x7d49d6) {
|
||||
return _0x48de88(_0x7d49d6);
|
||||
},
|
||||
'SnFUd': function(_0x45a987, _0x4a0ed4) {
|
||||
return _0x45a987 === _0x4a0ed4;
|
||||
},
|
||||
'dFIVJ': 'gecko',
|
||||
'wTQFv': function(_0x583a15, _0x1bad90) {
|
||||
return _0x583a15(_0x1bad90);
|
||||
},
|
||||
'ShzBA': function(_0x299d61, _0x828843) {
|
||||
return _0x299d61 === _0x828843;
|
||||
},
|
||||
'eMRyr': function(_0x5d0702, _0x2beb52) {
|
||||
return _0x5d0702(_0x2beb52);
|
||||
},
|
||||
'IKmjV': function(_0x233069, _0x42f6c1) {
|
||||
return _0x233069 === _0x42f6c1;
|
||||
},
|
||||
'TglAC': function(_0x1783e0, _0x1acb96) {
|
||||
return _0x1783e0 === _0x1acb96;
|
||||
},
|
||||
'GIWpy': function(_0xea74a9, _0x40e03a) {
|
||||
return _0xea74a9 === _0x40e03a;
|
||||
},
|
||||
'LSFzT': function(_0x2de986, _0x176669) {
|
||||
return _0x2de986(_0x176669);
|
||||
},
|
||||
'JVzaP': function(_0x586484, _0x30862f) {
|
||||
return _0x586484(_0x30862f);
|
||||
},
|
||||
'vnhkW': function(_0x527125, _0x3ef155) {
|
||||
return _0x527125(_0x3ef155);
|
||||
},
|
||||
'bFQSo': function(_0x456f13, _0x4d29b3) {
|
||||
return _0x456f13(_0x4d29b3);
|
||||
},
|
||||
'mucVu': function(_0x1fc559, _0x1b76da) {
|
||||
return _0x1fc559(_0x1b76da);
|
||||
},
|
||||
'ndklM': function(_0xb3a50b, _0x49d22e) {
|
||||
return _0xb3a50b(_0x49d22e);
|
||||
},
|
||||
'aKRfW': '2345',
|
||||
'JvNSR': 'sougou',
|
||||
'iEjLM': 'liebao',
|
||||
'mFXYd': function(_0x401402, _0x100996) {
|
||||
return _0x401402(_0x100996);
|
||||
},
|
||||
'Fkpwj': 'maxthon'
|
||||
};
|
||||
const _0x445504 = navigator['userAgent']['toLowerCase']();
|
||||
const _0x38e894 = _0x5bff6b=>_0x5bff6b['test'](_0x445504);
|
||||
const _0x585fad = _0x9bfeb0=>_0x445504['match'](_0x9bfeb0)['toString']()['replace'](/[^0-9|_.]/g, '')['replace'](/_/g, '.');
|
||||
let _0x52bf77 = _0x227afe['yHOEV'];
|
||||
if (_0x227afe['wzENk'](_0x38e894, /windows|win32|win64|wow32|wow64/g)) {
|
||||
_0x52bf77 = _0x227afe['wsWEe'];
|
||||
} else if (_0x227afe['wzENk'](_0x38e894, /macintosh|macintel/g)) {
|
||||
_0x52bf77 = _0x227afe['xTHMm'];
|
||||
} else if (_0x227afe['yavth'](_0x38e894, /x11/g)) {
|
||||
_0x52bf77 = _0x227afe['azgCA'];
|
||||
} else if (_0x227afe['nGybX'](_0x38e894, /android|adr/g)) {
|
||||
_0x52bf77 = 'android';
|
||||
} else if (_0x227afe['nGybX'](_0x38e894, /ios|iphone|ipad|ipod|iwatch/g)) {
|
||||
_0x52bf77 = _0x227afe['INJwr'];
|
||||
}
|
||||
let _0x4a314b = 'unknow';
|
||||
if (_0x227afe['hZWNh'](_0x52bf77, _0x227afe['wsWEe'])) {
|
||||
if (_0x227afe['nGybX'](_0x38e894, /windows nt 5.0|windows 2000/g)) {
|
||||
_0x4a314b = _0x227afe['UQRFb'];
|
||||
} else if (_0x38e894(/windows nt 5.1|windows xp/g)) {
|
||||
_0x4a314b = 'xp';
|
||||
} else if (_0x227afe['wwUUs'](_0x38e894, /windows nt 5.2|windows 2003/g)) {
|
||||
_0x4a314b = _0x227afe['rqdHg'];
|
||||
} else if (_0x227afe['wwUUs'](_0x38e894, /windows nt 6.0|windows vista/g)) {
|
||||
_0x4a314b = 'vista';
|
||||
} else if (_0x38e894(/windows nt 6.1|windows 7/g)) {
|
||||
_0x4a314b = '7';
|
||||
} else if (_0x38e894(/windows nt 6.2|windows 8/g)) {
|
||||
_0x4a314b = '8';
|
||||
} else if (_0x38e894(/windows nt 6.3|windows 8.1/g)) {
|
||||
_0x4a314b = _0x227afe['RFYwz'];
|
||||
} else if (_0x38e894(/windows nt 10.0|windows 10/g)) {
|
||||
_0x4a314b = '10';
|
||||
}
|
||||
} else if (_0x227afe['hZWNh'](_0x52bf77, 'macos')) {
|
||||
_0x4a314b = _0x227afe['wwUUs'](_0x585fad, /os x [\d._]+/g);
|
||||
} else if (_0x227afe['VwpDM'](_0x52bf77, _0x227afe['ijcZr'])) {
|
||||
_0x4a314b = _0x227afe['wsPCu'](_0x585fad, /android [\d._]+/g);
|
||||
} else if (_0x227afe['CUddb'](_0x52bf77, _0x227afe['INJwr'])) {
|
||||
_0x4a314b = _0x585fad(/os [\d._]+/g);
|
||||
}
|
||||
let _0x19ea9e = _0x227afe['yHOEV'];
|
||||
if (_0x227afe['UcAvE'](_0x52bf77, _0x227afe['wsWEe']) || _0x227afe['UcAvE'](_0x52bf77, 'macos') || _0x52bf77 === 'linux') {
|
||||
_0x19ea9e = _0x227afe['UPKaK'];
|
||||
} else if (_0x52bf77 === 'android' || _0x227afe['Teriw'](_0x52bf77, _0x227afe['INJwr']) || _0x227afe['bSheG'](_0x38e894, /mobile/g)) {
|
||||
_0x19ea9e = _0x227afe['VSVPX'];
|
||||
}
|
||||
let _0x184415 = 'unknow';
|
||||
let _0x51795a = 'unknow';
|
||||
if (_0x227afe['YLvkS'](_0x38e894, /applewebkit/g)) {
|
||||
_0x184415 = _0x227afe['IIJTU'];
|
||||
if (_0x38e894(/edge/g)) {
|
||||
_0x51795a = _0x227afe['VnwxS'];
|
||||
} else if (_0x227afe['YLvkS'](_0x38e894, /opr/g)) {
|
||||
_0x51795a = _0x227afe['czVTJ'];
|
||||
} else if (_0x227afe['nqrWh'](_0x38e894, /chrome/g)) {
|
||||
_0x51795a = _0x227afe['qWvjw'];
|
||||
} else if (_0x38e894(/safari/g)) {
|
||||
_0x51795a = _0x227afe['wcaLm'];
|
||||
}
|
||||
} else if (_0x227afe['kpgHP'](_0x38e894, /gecko/g) && _0x227afe['uZEiZ'](_0x38e894, /firefox/g)) {
|
||||
_0x184415 = 'gecko';
|
||||
_0x51795a = _0x227afe['Bsdxk'];
|
||||
} else if (_0x227afe['brPia'](_0x38e894, /presto/g)) {
|
||||
_0x184415 = _0x227afe['OfqeT'];
|
||||
_0x51795a = _0x227afe['czVTJ'];
|
||||
} else if (_0x227afe['CKdHS'](_0x38e894, /trident|compatible|msie/g)) {
|
||||
_0x184415 = _0x227afe['MOinO'];
|
||||
_0x51795a = _0x227afe['ubOMd'];
|
||||
}
|
||||
let _0xb5f01a = 'unknow';
|
||||
if (_0x227afe['Teriw'](_0x184415, _0x227afe['IIJTU'])) {
|
||||
_0xb5f01a = _0x227afe['Ucccc'](_0x585fad, /applewebkit\/[\d._]+/g);
|
||||
} else if (_0x227afe['SnFUd'](_0x184415, _0x227afe['dFIVJ'])) {
|
||||
_0xb5f01a = _0x227afe['wTQFv'](_0x585fad, /gecko\/[\d._]+/g);
|
||||
} else if (_0x227afe['ShzBA'](_0x184415, _0x227afe['OfqeT'])) {
|
||||
_0xb5f01a = _0x227afe['wTQFv'](_0x585fad, /presto\/[\d._]+/g);
|
||||
} else if (_0x184415 === _0x227afe['MOinO']) {
|
||||
_0xb5f01a = _0x227afe['eMRyr'](_0x585fad, /trident\/[\d._]+/g);
|
||||
}
|
||||
let _0x4349d5 = _0x227afe['yHOEV'];
|
||||
if (_0x227afe['IKmjV'](_0x51795a, _0x227afe['qWvjw'])) {
|
||||
_0x4349d5 = _0x585fad(/chrome\/[\d._]+/g);
|
||||
} else if (_0x227afe['TglAC'](_0x51795a, 'safari')) {
|
||||
_0x4349d5 = _0x585fad(/version\/[\d._]+/g);
|
||||
} else if (_0x51795a === _0x227afe['Bsdxk']) {
|
||||
_0x4349d5 = _0x227afe['eMRyr'](_0x585fad, /firefox\/[\d._]+/g);
|
||||
} else if (_0x227afe['TglAC'](_0x51795a, _0x227afe['czVTJ'])) {
|
||||
_0x4349d5 = _0x585fad(/opr\/[\d._]+/g);
|
||||
} else if (_0x227afe['GIWpy'](_0x51795a, _0x227afe['ubOMd'])) {
|
||||
_0x4349d5 = _0x227afe['eMRyr'](_0x585fad, /(msie [\d._]+)|(rv:[\d._]+)/g);
|
||||
} else if (_0x227afe['GIWpy'](_0x51795a, _0x227afe['VnwxS'])) {
|
||||
_0x4349d5 = _0x227afe['LSFzT'](_0x585fad, /edge\/[\d._]+/g);
|
||||
}
|
||||
let _0x59a33a = 'none';
|
||||
let _0x25de0d = 'unknow';
|
||||
if (_0x227afe['LSFzT'](_0x38e894, /micromessenger/g)) {
|
||||
_0x59a33a = 'wechat';
|
||||
_0x25de0d = _0x227afe['JVzaP'](_0x585fad, /micromessenger\/[\d._]+/g);
|
||||
} else if (_0x38e894(/qqbrowser/g)) {
|
||||
_0x59a33a = 'qq';
|
||||
_0x25de0d = _0x227afe['JVzaP'](_0x585fad, /qqbrowser\/[\d._]+/g);
|
||||
} else if (_0x227afe['vnhkW'](_0x38e894, /ucbrowser/g)) {
|
||||
_0x59a33a = 'uc';
|
||||
_0x25de0d = _0x227afe['bFQSo'](_0x585fad, /ucbrowser\/[\d._]+/g);
|
||||
} else if (_0x227afe['mucVu'](_0x38e894, /qihu 360se/g)) {
|
||||
_0x59a33a = '360';
|
||||
} else if (_0x227afe['ndklM'](_0x38e894, /2345explorer/g)) {
|
||||
_0x59a33a = _0x227afe['aKRfW'];
|
||||
_0x25de0d = _0x585fad(/2345explorer\/[\d._]+/g);
|
||||
} else if (_0x227afe['ndklM'](_0x38e894, /metasr/g)) {
|
||||
_0x59a33a = _0x227afe['JvNSR'];
|
||||
} else if (_0x227afe['ndklM'](_0x38e894, /lbbrowser/g)) {
|
||||
_0x59a33a = _0x227afe['iEjLM'];
|
||||
} else if (_0x227afe['mFXYd'](_0x38e894, /maxthon/g)) {
|
||||
_0x59a33a = _0x227afe['Fkpwj'];
|
||||
_0x25de0d = _0x227afe['mFXYd'](_0x585fad, /maxthon\/[\d._]+/g);
|
||||
}
|
||||
return Object['assign']({
|
||||
'engine': _0x184415,
|
||||
'engineVs': _0xb5f01a,
|
||||
'platform': _0x19ea9e,
|
||||
'supporter': _0x51795a,
|
||||
'supporterVs': _0x4349d5,
|
||||
'system': _0x52bf77,
|
||||
'systemVs': _0x4a314b
|
||||
}, _0x227afe['GIWpy'](_0x59a33a, 'none') ? {} : {
|
||||
'shell': _0x59a33a,
|
||||
'shellVs': _0x25de0d
|
||||
});
|
||||
}
|
||||
var _0xafb7 = ['0123456789abcdef', 'charAt', 'length', 'abc', '900150983cd24fb0d6963f7d28e17f72', 'concat', 'charCodeAt', '0123456789ABCDEF'];
|
||||
(function(_0x308400, _0x4dd0d5) {
|
||||
var _0x55a1b9 = function(_0x42a510) {
|
||||
while (--_0x42a510) {
|
||||
_0x308400['push'](_0x308400['shift']());
|
||||
}
|
||||
};
|
||||
_0x55a1b9(++_0x4dd0d5);
|
||||
}(_0xafb7, 0x132));
|
||||
var _0x4f75 = function(_0x20aa38, _0x3feb9f) {
|
||||
_0x20aa38 = _0x20aa38 - 0x0;
|
||||
var _0x442357 = _0xafb7[_0x20aa38];
|
||||
return _0x442357;
|
||||
};
|
||||
var hexcase = 0x0;
|
||||
var b64pad = '';
|
||||
var chrsz = 0x8;
|
||||
function get_data() {
|
||||
var _0x49dc93 = {
|
||||
'ObbQh': function(_0x4cc272) {
|
||||
return _0x4cc272();
|
||||
}
|
||||
};
|
||||
result = '';
|
||||
if (1600 || 900) {
|
||||
result = _0x49dc93['ObbQh'](___get_data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function ___get_data() {
|
||||
var _0xd1d5bb = {
|
||||
'chYzh': function(_0x3214e3, _0x5ecab4) {
|
||||
return _0x3214e3(_0x5ecab4);
|
||||
},
|
||||
'EyjPx': function(_0x37547a, _0x58a366, _0x1463fd) {
|
||||
return _0x37547a(_0x58a366, _0x1463fd);
|
||||
},
|
||||
'oWocp': '0x0'
|
||||
};
|
||||
_0x3066e8 = 'NightTeam';
|
||||
return _0xd1d5bb['chYzh'](binl2hex, _0xd1d5bb['EyjPx'](core__0x5f3, _0xd1d5bb['chYzh'](str2binl, _0x3066e8), _0x3066e8[_0x4f75(_0xd1d5bb['oWocp'])] * chrsz));
|
||||
}
|
||||
function b64__0x5f3(_0x285afb) {
|
||||
return binl2b64(core__0x5f3(str2binl(_0x285afb), _0x285afb[_0x4f75('0x0')] * chrsz));
|
||||
}
|
||||
function str__0x5f3(_0x508693) {
|
||||
return binl2str(core__0x5f3(str2binl(_0x508693), _0x508693[_0x4f75('0x0')] * chrsz));
|
||||
}
|
||||
function hex_hmac__0x5f3(_0x51842a, _0x49cf0a) {
|
||||
return binl2hex(core_hmac__0x5f3(_0x51842a, _0x49cf0a));
|
||||
}
|
||||
function b64_hmac__0x5f3(_0x32ca2c, _0x564ce2) {
|
||||
return binl2b64(core_hmac__0x5f3(_0x32ca2c, _0x564ce2));
|
||||
}
|
||||
function str_hmac__0x5f3(_0x2b5ae9, _0x33e2bc) {
|
||||
return binl2str(core_hmac__0x5f3(_0x2b5ae9, _0x33e2bc));
|
||||
}
|
||||
function _0x5f3_vm_test() {
|
||||
return hex__0x5f3(_0x4f75('0x1')) == _0x4f75('0x2');
|
||||
}
|
||||
function core__0x5f3(_0x29b141, _0x1d205c) {
|
||||
_0x29b141[_0x1d205c >> 0x5] |= 0x80 << _0x1d205c % 0x20;
|
||||
_0x29b141[(_0x1d205c + 0x40 >>> 0x9 << 0x4) + 0xe] = _0x1d205c;
|
||||
var _0x2ca934 = 0x67452301;
|
||||
var _0x37ae64 = -0x10325477;
|
||||
var _0x25776a = -0x67452302;
|
||||
var _0x225e4c = 0x10325476;
|
||||
for (var _0x13a45d = 0x0; _0x13a45d < _0x29b141['length']; _0x13a45d += 0x10) {
|
||||
var _0x588610 = _0x2ca934;
|
||||
var _0x12af01 = _0x37ae64;
|
||||
var _0x233171 = _0x25776a;
|
||||
var _0x4c36c3 = _0x225e4c;
|
||||
_0x2ca934 = _0x5f3_ff(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x0], 0x7, -0x28955b88);
|
||||
_0x225e4c = _0x5f3_ff(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x1], 0xc, -0x173848aa);
|
||||
_0x25776a = _0x5f3_ff(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0x2], 0x11, 0x242070db);
|
||||
_0x37ae64 = _0x5f3_ff(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x3], 0x16, -0x3e423112);
|
||||
_0x2ca934 = _0x5f3_ff(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x4], 0x7, -0xa83f051);
|
||||
_0x225e4c = _0x5f3_ff(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x5], 0xc, 0x4787c62a);
|
||||
_0x25776a = _0x5f3_ff(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0x6], 0x11, -0x57cfb9ed);
|
||||
_0x37ae64 = _0x5f3_ff(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x7], 0x16, -0x2b96aff);
|
||||
_0x2ca934 = _0x5f3_ff(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x8], 0x7, 0x698098d8);
|
||||
_0x225e4c = _0x5f3_ff(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x9], 0xc, -0x74bb0851);
|
||||
_0x25776a = _0x5f3_ff(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0xa], 0x11, -0xa44f);
|
||||
_0x37ae64 = _0x5f3_ff(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0xb], 0x16, -0x76a32842);
|
||||
_0x2ca934 = _0x5f3_ff(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0xc], 0x7, 0x6b901122);
|
||||
_0x225e4c = _0x5f3_ff(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0xd], 0xc, -0x2678e6d);
|
||||
_0x25776a = _0x5f3_ff(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0xe], 0x11, -0x5986bc72);
|
||||
_0x37ae64 = _0x5f3_ff(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0xf], 0x16, 0x49b40821);
|
||||
_0x2ca934 = _0x5f3_gg(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x1], 0x5, -0x9e1da9e);
|
||||
_0x225e4c = _0x5f3_gg(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x6], 0x9, -0x3fbf4cc0);
|
||||
_0x25776a = _0x5f3_gg(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0xb], 0xe, 0x265e5a51);
|
||||
_0x37ae64 = _0x5f3_gg(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x0], 0x14, -0x16493856);
|
||||
_0x2ca934 = _0x5f3_gg(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x5], 0x5, -0x29d0efa3);
|
||||
_0x225e4c = _0x5f3_gg(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0xa], 0x9, 0x2441453);
|
||||
_0x25776a = _0x5f3_gg(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0xf], 0xe, -0x275e197f);
|
||||
_0x37ae64 = _0x5f3_gg(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x4], 0x14, -0x182c0438);
|
||||
_0x2ca934 = _0x5f3_gg(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x9], 0x5, 0x21e1cde6);
|
||||
_0x225e4c = _0x5f3_gg(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0xe], 0x9, -0x3cc8f82a);
|
||||
_0x25776a = _0x5f3_gg(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0x3], 0xe, -0xb2af279);
|
||||
_0x37ae64 = _0x5f3_gg(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x8], 0x14, 0x455a14ed);
|
||||
_0x2ca934 = _0x5f3_gg(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0xd], 0x5, -0x561c16fb);
|
||||
_0x225e4c = _0x5f3_gg(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x2], 0x9, -0x3105c08);
|
||||
_0x25776a = _0x5f3_gg(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0x7], 0xe, 0x676f02d9);
|
||||
_0x37ae64 = _0x5f3_gg(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0xc], 0x14, -0x72d5b376);
|
||||
_0x2ca934 = _0x5f3_hh(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x5], 0x4, -0x5c6be);
|
||||
_0x225e4c = _0x5f3_hh(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x8], 0xb, -0x788e097f);
|
||||
_0x25776a = _0x5f3_hh(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0xb], 0x10, 0x6d9d6122);
|
||||
_0x37ae64 = _0x5f3_hh(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0xe], 0x17, -0x21ac7f4);
|
||||
_0x2ca934 = _0x5f3_hh(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x1], 0x4, -0x5b4115bc);
|
||||
_0x225e4c = _0x5f3_hh(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x4], 0xb, 0x4bdecfa9);
|
||||
_0x25776a = _0x5f3_hh(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0x7], 0x10, -0x944b4a0);
|
||||
_0x37ae64 = _0x5f3_hh(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0xa], 0x17, -0x41404390);
|
||||
_0x2ca934 = _0x5f3_hh(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0xd], 0x4, 0x289b7ec6);
|
||||
_0x225e4c = _0x5f3_hh(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x0], 0xb, -0x155ed806);
|
||||
_0x25776a = _0x5f3_hh(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0x3], 0x10, -0x2b10cf7b);
|
||||
_0x37ae64 = _0x5f3_hh(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x6], 0x17, 0x4881d05);
|
||||
_0x2ca934 = _0x5f3_hh(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x9], 0x4, -0x262b2fc7);
|
||||
_0x225e4c = _0x5f3_hh(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0xc], 0xb, -0x1924661b);
|
||||
_0x25776a = _0x5f3_hh(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0xf], 0x10, 0x1fa27cf8);
|
||||
_0x37ae64 = _0x5f3_hh(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x2], 0x17, -0x3b53a99b);
|
||||
_0x2ca934 = _0x5f3_ii(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x0], 0x6, -0xbd6ddbc);
|
||||
_0x225e4c = _0x5f3_ii(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x7], 0xa, 0x432aff97);
|
||||
_0x25776a = _0x5f3_ii(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0xe], 0xf, -0x546bdc59);
|
||||
_0x37ae64 = _0x5f3_ii(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x5], 0x15, -0x36c5fc7);
|
||||
_0x2ca934 = _0x5f3_ii(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0xc], 0x6, 0x655b59c3);
|
||||
_0x225e4c = _0x5f3_ii(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0x3], 0xa, -0x70f3336e);
|
||||
_0x25776a = _0x5f3_ii(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0xa], 0xf, -0x100b83);
|
||||
_0x37ae64 = _0x5f3_ii(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x1], 0x15, -0x7a7ba22f);
|
||||
_0x2ca934 = _0x5f3_ii(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x8], 0x6, 0x6fa87e4f);
|
||||
_0x225e4c = _0x5f3_ii(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0xf], 0xa, -0x1d31920);
|
||||
_0x25776a = _0x5f3_ii(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0x6], 0xf, -0x5cfebcec);
|
||||
_0x37ae64 = _0x5f3_ii(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0xd], 0x15, 0x4e0811a1);
|
||||
_0x2ca934 = _0x5f3_ii(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c, _0x29b141[_0x13a45d + 0x4], 0x6, -0x8ac817e);
|
||||
_0x225e4c = _0x5f3_ii(_0x225e4c, _0x2ca934, _0x37ae64, _0x25776a, _0x29b141[_0x13a45d + 0xb], 0xa, -0x42c50dcb);
|
||||
_0x25776a = _0x5f3_ii(_0x25776a, _0x225e4c, _0x2ca934, _0x37ae64, _0x29b141[_0x13a45d + 0x2], 0xf, 0x2ad7d2bb);
|
||||
_0x37ae64 = _0x5f3_ii(_0x37ae64, _0x25776a, _0x225e4c, _0x2ca934, _0x29b141[_0x13a45d + 0x9], 0x15, -0x14792c6f);
|
||||
_0x2ca934 = safe_add(_0x2ca934, _0x588610);
|
||||
_0x37ae64 = safe_add(_0x37ae64, _0x12af01);
|
||||
_0x25776a = safe_add(_0x25776a, _0x233171);
|
||||
_0x225e4c = safe_add(_0x225e4c, _0x4c36c3);
|
||||
}
|
||||
return Array(_0x2ca934, _0x37ae64, _0x25776a, _0x225e4c);
|
||||
}
|
||||
function _0x5f3_cmn(_0x37bd03, _0x204785, _0x4c8136, _0x4df7e5, _0x8adaae, _0x1bb5d5) {
|
||||
return safe_add(bit_rol(safe_add(safe_add(_0x204785, _0x37bd03), safe_add(_0x4df7e5, _0x1bb5d5)), _0x8adaae), _0x4c8136);
|
||||
}
|
||||
function _0x5f3_ff(_0x592bc7, _0x27110f, _0x192e0e, _0x56094f, _0xf3c246, _0x3e601b, _0x5424f7) {
|
||||
return _0x5f3_cmn(_0x27110f & _0x192e0e | ~_0x27110f & _0x56094f, _0x592bc7, _0x27110f, _0xf3c246, _0x3e601b, _0x5424f7);
|
||||
}
|
||||
function _0x5f3_gg(_0x133b26, _0x4f6e2b, _0x43870f, _0x3221b7, _0x5749c4, _0x4a7548, _0x2eeb85) {
|
||||
return _0x5f3_cmn(_0x4f6e2b & _0x3221b7 | _0x43870f & ~_0x3221b7, _0x133b26, _0x4f6e2b, _0x5749c4, _0x4a7548, _0x2eeb85);
|
||||
}
|
||||
function _0x5f3_hh(_0x182bcc, _0x5983ea, _0x15f735, _0x53f395, _0x346932, _0x1845cc, _0x3c026d) {
|
||||
return _0x5f3_cmn(_0x5983ea ^ _0x15f735 ^ _0x53f395, _0x182bcc, _0x5983ea, _0x346932, _0x1845cc, _0x3c026d);
|
||||
}
|
||||
function _0x5f3_ii(_0x51638c, _0x39d5b9, _0x5aa690, _0x332e8b, _0x40b6d3, _0x1f7f3b, _0x4a5089) {
|
||||
return _0x5f3_cmn(_0x5aa690 ^ (_0x39d5b9 | ~_0x332e8b), _0x51638c, _0x39d5b9, _0x40b6d3, _0x1f7f3b, _0x4a5089);
|
||||
}
|
||||
function core_hmac__0x5f3(_0x3c9f1f, _0x24bf57) {
|
||||
var _0xce47a9 = str2binl(_0x3c9f1f);
|
||||
if (_0xce47a9[_0x4f75('0x0')] > 0x10)
|
||||
_0xce47a9 = core__0x5f3(_0xce47a9, _0x3c9f1f['length'] * chrsz);
|
||||
var _0x201e5e = Array(0x10)
|
||||
, _0x3e6b17 = Array(0x10);
|
||||
for (var _0x1a9e62 = 0x0; _0x1a9e62 < 0x10; _0x1a9e62++) {
|
||||
_0x201e5e[_0x1a9e62] = _0xce47a9[_0x1a9e62] ^ 0x36363636;
|
||||
_0x3e6b17[_0x1a9e62] = _0xce47a9[_0x1a9e62] ^ 0x5c5c5c5c;
|
||||
}
|
||||
var _0x32b17d = core__0x5f3(_0x201e5e[_0x4f75('0x3')](str2binl(_0x24bf57)), 0x200 + _0x24bf57[_0x4f75('0x0')] * chrsz);
|
||||
return core__0x5f3(_0x3e6b17[_0x4f75('0x3')](_0x32b17d), 0x200 + 0x80);
|
||||
}
|
||||
function safe_add(_0x17d6bb, _0x338b5a) {
|
||||
var _0x1da9a = (_0x17d6bb & 0xffff) + (_0x338b5a & 0xffff);
|
||||
var _0x30eeed = (_0x17d6bb >> 0x10) + (_0x338b5a >> 0x10) + (_0x1da9a >> 0x10);
|
||||
return _0x30eeed << 0x10 | _0x1da9a & 0xffff;
|
||||
}
|
||||
function bit_rol(_0x29570a, _0x50c5a5) {
|
||||
return _0x29570a << _0x50c5a5 | _0x29570a >>> 0x20 - _0x50c5a5;
|
||||
}
|
||||
function str2binl(_0x564301) {
|
||||
var _0x8000e = Array();
|
||||
var _0x5384bf = (0x1 << chrsz) - 0x1;
|
||||
for (var _0x4eff36 = 0x0; _0x4eff36 < _0x564301[_0x4f75('0x0')] * chrsz; _0x4eff36 += chrsz)
|
||||
_0x8000e[_0x4eff36 >> 0x5] |= (_0x564301[_0x4f75('0x4')](_0x4eff36 / chrsz) & _0x5384bf) << _0x4eff36 % 0x20;
|
||||
return _0x8000e;
|
||||
}
|
||||
function binl2str(_0x1591a0) {
|
||||
var _0x48bf42 = '';
|
||||
var _0x330495 = (0x1 << chrsz) - 0x1;
|
||||
for (var _0x1d9e6e = 0x0; _0x1d9e6e < _0x1591a0[_0x4f75('0x0')] * 0x20; _0x1d9e6e += chrsz)
|
||||
_0x48bf42 += String['fromCharCode'](_0x1591a0[_0x1d9e6e >> 0x5] >>> _0x1d9e6e % 0x20 & _0x330495);
|
||||
return _0x48bf42;
|
||||
}
|
||||
function binl2hex(_0x2b2030) {
|
||||
var _0x3b523a = hexcase ? _0x4f75('0x5') : _0x4f75('0x6');
|
||||
var _0x580323 = '';
|
||||
for (var _0x3c558a = 0x0; _0x3c558a < _0x2b2030[_0x4f75('0x0')] * 0x4; _0x3c558a++) {
|
||||
_0x580323 += _0x3b523a['charAt'](_0x2b2030[_0x3c558a >> 0x2] >> _0x3c558a % 0x4 * 0x8 + 0x4 & 0xf) + _0x3b523a[_0x4f75('0x7')](_0x2b2030[_0x3c558a >> 0x2] >> _0x3c558a % 0x4 * 0x8 & 0xf);
|
||||
}
|
||||
return _0x580323;
|
||||
}
|
||||
function binl2b64(_0xbf0e43) {
|
||||
var _0x5c1f17 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
var _0x50c415 = '';
|
||||
for (var _0x30f226 = 0x0; _0x30f226 < _0xbf0e43[_0x4f75('0x0')] * 0x4; _0x30f226 += 0x3) {
|
||||
var _0x13031f = (_0xbf0e43[_0x30f226 >> 0x2] >> 0x8 * (_0x30f226 % 0x4) & 0xff) << 0x10 | (_0xbf0e43[_0x30f226 + 0x1 >> 0x2] >> 0x8 * ((_0x30f226 + 0x1) % 0x4) & 0xff) << 0x8 | _0xbf0e43[_0x30f226 + 0x2 >> 0x2] >> 0x8 * ((_0x30f226 + 0x2) % 0x4) & 0xff;
|
||||
for (var _0x25968b = 0x0; _0x25968b < 0x4; _0x25968b++) {
|
||||
if (_0x30f226 * 0x8 + _0x25968b * 0x6 > _0xbf0e43[_0x4f75('0x0')] * 0x20)
|
||||
_0x50c415 += b64pad;
|
||||
else
|
||||
_0x50c415 += _0x5c1f17[_0x4f75('0x7')](_0x13031f >> 0x6 * (0x3 - _0x25968b) & 0x3f);
|
||||
}
|
||||
}
|
||||
return _0x50c415;
|
||||
}
|
||||
console.log(get_data());
|
23
3-代码包/练习/readme.md
Normal file
23
3-代码包/练习/readme.md
Normal file
@ -0,0 +1,23 @@
|
||||
1打开浏览器开发者工具全局搜索 get_data,在console中打印 get_data() 返回
|
||||
|
||||
1c28252a6a52a30aedcd18a75d127d13
|
||||
|
||||
2将代码复制,node.js运行代码发现
|
||||
|
||||
if (screen['width'] || screen['height']) {
|
||||
result = _0x49dc93['ObbQh'](___get_data);
|
||||
}
|
||||
return result;
|
||||
|
||||
3替换为
|
||||
|
||||
if (1600 || 900) {
|
||||
result = _0x49dc93['ObbQh'](___get_data);
|
||||
}
|
||||
return result;
|
||||
|
||||
运行打印
|
||||
|
||||
1c28252a6a52a30aedcd18a75d127d13
|
||||
|
||||
1c28252a6a52a30a
|
4
6-代码包/myjs.js
Normal file
4
6-代码包/myjs.js
Normal file
File diff suppressed because one or more lines are too long
15
6-代码包/test
Normal file
15
6-代码包/test
Normal file
@ -0,0 +1,15 @@
|
||||
function start_debug(){
|
||||
debugger;
|
||||
}
|
||||
console.log(1111);
|
||||
console.log(2222);
|
||||
console.log(3333);
|
||||
var i=0;
|
||||
while (i < 10){
|
||||
start_debug();
|
||||
i++;
|
||||
console.log("i:", i);
|
||||
}
|
||||
console.log(4444);
|
||||
console.log(5555);
|
||||
console.log(6666);
|
54
douyin/sign.js
Normal file
54
douyin/sign.js
Normal file
@ -0,0 +1,54 @@
|
||||
|
||||
s = {'include': []};
|
||||
|
||||
var r;
|
||||
|
||||
function y(e, t) {
|
||||
if (null == e)
|
||||
throw new Error("Illegal argument " + e);
|
||||
var n = wordsToBytes(e);
|
||||
return t && t.asBytes ? n : t && t.asString ? a.bytesToString(n) : bytesToHex(n)
|
||||
}
|
||||
|
||||
function A(e, t, n) {
|
||||
var r = null != t ? t : {}
|
||||
, i = r.include
|
||||
, o = r.enforceWithKeys
|
||||
, a = void 0 === o ? [] : o
|
||||
, s = Object.keys(e);
|
||||
|
||||
if (n && i) {
|
||||
var l = i.concat(["service_name", "service_method", "sign_strict"]);
|
||||
s = s.filter((function(e) {
|
||||
return l.includes(e)
|
||||
}
|
||||
))
|
||||
}
|
||||
var c = s.sort().map((function(t) {
|
||||
var n = e[t];
|
||||
return function(e) {
|
||||
return null == e
|
||||
}(n) ? "" : t + (!a.includes(t) && function(e) {
|
||||
return ["string", "number"].includes("string")
|
||||
}(n) ? n : t)
|
||||
}
|
||||
)).join("");
|
||||
return y(e, t)
|
||||
}
|
||||
|
||||
function bytesToHex(e) {
|
||||
for (var t = [], n = 0; n < e.length; n++)
|
||||
t.push((e[n] >>> 4).toString(16)),
|
||||
t.push((15 & e[n]).toString(16));
|
||||
return t.join("")
|
||||
}
|
||||
|
||||
function wordsToBytes(e) {
|
||||
for (var t = [], n = 0; n < 32 * e.length; n += 8)
|
||||
t.push(e[n >>> 5] >>> 24 - n % 32 & 255);
|
||||
return t
|
||||
}
|
||||
|
||||
sign = A("demander.AdStarDemanderService", "GetDemanderInformation", {'demander_id': "1660820368794647"}, s, false);
|
||||
|
||||
console.log(sign);
|
372
package-lock.json
generated
Normal file
372
package-lock.json
generated
Normal file
@ -0,0 +1,372 @@
|
||||
{
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"accepts": {
|
||||
"version": "1.3.7",
|
||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
|
||||
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
|
||||
"requires": {
|
||||
"mime-types": "2.1.31",
|
||||
"negotiator": "0.6.2"
|
||||
}
|
||||
},
|
||||
"array-flatten": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
|
||||
},
|
||||
"body-parser": {
|
||||
"version": "1.19.0",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
|
||||
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
|
||||
"requires": {
|
||||
"bytes": "3.1.0",
|
||||
"content-type": "1.0.4",
|
||||
"debug": "2.6.9",
|
||||
"depd": "1.1.2",
|
||||
"http-errors": "1.7.2",
|
||||
"iconv-lite": "0.4.24",
|
||||
"on-finished": "2.3.0",
|
||||
"qs": "6.7.0",
|
||||
"raw-body": "2.4.0",
|
||||
"type-is": "1.6.18"
|
||||
}
|
||||
},
|
||||
"bytes": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
|
||||
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
|
||||
},
|
||||
"content-disposition": {
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
|
||||
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
|
||||
"requires": {
|
||||
"safe-buffer": "5.1.2"
|
||||
}
|
||||
},
|
||||
"content-type": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
|
||||
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
|
||||
},
|
||||
"cookie": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
|
||||
"integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
|
||||
},
|
||||
"cookie-signature": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
|
||||
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"depd": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
|
||||
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
|
||||
},
|
||||
"destroy": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
|
||||
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
|
||||
},
|
||||
"ee-first": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
||||
},
|
||||
"encodeurl": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
||||
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
||||
},
|
||||
"escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
|
||||
},
|
||||
"etag": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
|
||||
},
|
||||
"express": {
|
||||
"version": "4.17.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
|
||||
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
|
||||
"requires": {
|
||||
"accepts": "1.3.7",
|
||||
"array-flatten": "1.1.1",
|
||||
"body-parser": "1.19.0",
|
||||
"content-disposition": "0.5.3",
|
||||
"content-type": "1.0.4",
|
||||
"cookie": "0.4.0",
|
||||
"cookie-signature": "1.0.6",
|
||||
"debug": "2.6.9",
|
||||
"depd": "1.1.2",
|
||||
"encodeurl": "1.0.2",
|
||||
"escape-html": "1.0.3",
|
||||
"etag": "1.8.1",
|
||||
"finalhandler": "1.1.2",
|
||||
"fresh": "0.5.2",
|
||||
"merge-descriptors": "1.0.1",
|
||||
"methods": "1.1.2",
|
||||
"on-finished": "2.3.0",
|
||||
"parseurl": "1.3.3",
|
||||
"path-to-regexp": "0.1.7",
|
||||
"proxy-addr": "2.0.7",
|
||||
"qs": "6.7.0",
|
||||
"range-parser": "1.2.1",
|
||||
"safe-buffer": "5.1.2",
|
||||
"send": "0.17.1",
|
||||
"serve-static": "1.14.1",
|
||||
"setprototypeof": "1.1.1",
|
||||
"statuses": "1.5.0",
|
||||
"type-is": "1.6.18",
|
||||
"utils-merge": "1.0.1",
|
||||
"vary": "1.1.2"
|
||||
}
|
||||
},
|
||||
"finalhandler": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
|
||||
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
|
||||
"requires": {
|
||||
"debug": "2.6.9",
|
||||
"encodeurl": "1.0.2",
|
||||
"escape-html": "1.0.3",
|
||||
"on-finished": "2.3.0",
|
||||
"parseurl": "1.3.3",
|
||||
"statuses": "1.5.0",
|
||||
"unpipe": "1.0.0"
|
||||
}
|
||||
},
|
||||
"forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
|
||||
},
|
||||
"fresh": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
|
||||
},
|
||||
"http-errors": {
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
|
||||
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
|
||||
"requires": {
|
||||
"depd": "1.1.2",
|
||||
"inherits": "2.0.3",
|
||||
"setprototypeof": "1.1.1",
|
||||
"statuses": "1.5.0",
|
||||
"toidentifier": "1.0.0"
|
||||
}
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"requires": {
|
||||
"safer-buffer": "2.1.2"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||
},
|
||||
"ipaddr.js": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
|
||||
},
|
||||
"media-typer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
|
||||
},
|
||||
"merge-descriptors": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
||||
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
|
||||
},
|
||||
"methods": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
|
||||
},
|
||||
"mime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.48.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz",
|
||||
"integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.31",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz",
|
||||
"integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==",
|
||||
"requires": {
|
||||
"mime-db": "1.48.0"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||
},
|
||||
"negotiator": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
|
||||
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
|
||||
},
|
||||
"on-finished": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
||||
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
|
||||
"requires": {
|
||||
"ee-first": "1.1.1"
|
||||
}
|
||||
},
|
||||
"parseurl": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
|
||||
},
|
||||
"path-to-regexp": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
||||
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
|
||||
},
|
||||
"proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||
"requires": {
|
||||
"forwarded": "0.2.0",
|
||||
"ipaddr.js": "1.9.1"
|
||||
}
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.7.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
|
||||
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
|
||||
},
|
||||
"range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
|
||||
},
|
||||
"raw-body": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
|
||||
"integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
|
||||
"requires": {
|
||||
"bytes": "3.1.0",
|
||||
"http-errors": "1.7.2",
|
||||
"iconv-lite": "0.4.24",
|
||||
"unpipe": "1.0.0"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"send": {
|
||||
"version": "0.17.1",
|
||||
"resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
|
||||
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
|
||||
"requires": {
|
||||
"debug": "2.6.9",
|
||||
"depd": "1.1.2",
|
||||
"destroy": "1.0.4",
|
||||
"encodeurl": "1.0.2",
|
||||
"escape-html": "1.0.3",
|
||||
"etag": "1.8.1",
|
||||
"fresh": "0.5.2",
|
||||
"http-errors": "1.7.2",
|
||||
"mime": "1.6.0",
|
||||
"ms": "2.1.1",
|
||||
"on-finished": "2.3.0",
|
||||
"range-parser": "1.2.1",
|
||||
"statuses": "1.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ms": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
||||
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve-static": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
|
||||
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
|
||||
"requires": {
|
||||
"encodeurl": "1.0.2",
|
||||
"escape-html": "1.0.3",
|
||||
"parseurl": "1.3.3",
|
||||
"send": "0.17.1"
|
||||
}
|
||||
},
|
||||
"setprototypeof": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
|
||||
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
|
||||
},
|
||||
"statuses": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
||||
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
|
||||
},
|
||||
"toidentifier": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
|
||||
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
|
||||
},
|
||||
"type-is": {
|
||||
"version": "1.6.18",
|
||||
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
||||
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
||||
"requires": {
|
||||
"media-typer": "0.3.0",
|
||||
"mime-types": "2.1.31"
|
||||
}
|
||||
},
|
||||
"unpipe": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
|
||||
},
|
||||
"utils-merge": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
||||
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
|
||||
},
|
||||
"vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
|
||||
}
|
||||
}
|
||||
}
|
0
py_js/__init__.py
Normal file
0
py_js/__init__.py
Normal file
17
py_js/test.py
Normal file
17
py_js/test.py
Normal file
@ -0,0 +1,17 @@
|
||||
# 检测运行环境
|
||||
import execjs
|
||||
print(execjs.get().name)
|
||||
|
||||
js_text = """
|
||||
function hello(str){return str;}
|
||||
"""
|
||||
ctx = execjs.compile(js_text)
|
||||
a = ctx.call("hello", "32131")
|
||||
print(a)
|
||||
|
||||
# 存在的问题
|
||||
# 执行大型js时会有点慢
|
||||
# 特殊编码的输入或输出参数会出现报错的情况
|
||||
|
||||
# selenium操作js
|
||||
# pyppeteer操作js
|
9760
py_js/xhs.js
Normal file
9760
py_js/xhs.js
Normal file
File diff suppressed because one or more lines are too long
87
xhs/client/client-x-s.py
Normal file
87
xhs/client/client-x-s.py
Normal file
@ -0,0 +1,87 @@
|
||||
import requests
|
||||
import json
|
||||
import time
|
||||
from setting import xhs_account
|
||||
|
||||
|
||||
class XhsApp(object):
|
||||
def __init__(self):
|
||||
self.nodejs_x_s_url = "http://127.0.0.1:3000/get_x_s"
|
||||
self.nodejs_id_url = "http://127.0.0.1:3001/get_sign"
|
||||
self.cookie_url = "https://www.xiaohongshu.com/fe_api/burdock/v2/shield/registerCanvas"
|
||||
self.login_url = "https://customer.xiaohongshu.com/api/cas/loginWithAccount"
|
||||
|
||||
self.sign = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4280.141 " \
|
||||
"Safari/537.36~~~unknown~~~zh-CN~~~24~~~8~~~4~~~-480~~~Asia/Shanghai~~~1~~~1~~~1~~~1~~~unkno" \
|
||||
"wn~~~Linux x86_64~~~Chrome PDF Plugin::Portable Document Format::application/x-google-chrome" \
|
||||
"-pdf~pdf,Chrome PDF Viewer::::application/pdf~pdf,Native Client::::application/x-nacl~,appl" \
|
||||
"ication/x-pnacl~~~~canvas winding:yes~canvas fp:4ed6498d31241a0323aabbcc7f6d68a0~~~false~~~f" \
|
||||
"alse~~~false~~~false~~~false~~~0;false;false~~~0;1;2;3;4;5;6;7;8;9~~~124.04347730432432"
|
||||
|
||||
def get_timestamp(self):
|
||||
t = time.time()
|
||||
return str(round(t * 1000))
|
||||
|
||||
def get_x_s(self, x_t):
|
||||
x_s_data = 'test1test/api/cas/loginWithAccount{"account":"test2","password":"test3",' \
|
||||
'"service":"https://pgy.xiaohongshu.com"}'
|
||||
x_s_data = x_s_data.replace("test1", x_t)\
|
||||
.replace("test2", xhs_account.get('account'))\
|
||||
.replace("test3", xhs_account.get('password'))
|
||||
|
||||
data = {
|
||||
'sign': x_s_data
|
||||
}
|
||||
req = requests.post(self.nodejs_x_s_url, data=data)
|
||||
id = req.text
|
||||
return id
|
||||
|
||||
def get_id(self):
|
||||
data = {
|
||||
'sign': self.sign
|
||||
}
|
||||
req = requests.post(self.nodejs_id_url, data=data)
|
||||
id = req.text
|
||||
return id
|
||||
|
||||
def get_cookie_timestamp2(self, id):
|
||||
data = {
|
||||
'id': id,
|
||||
'sign': self.sign
|
||||
}
|
||||
req = requests.post(self.cookie_url, data=data)
|
||||
canvas = json.loads(req.text).get('data').get('canvas')
|
||||
return canvas
|
||||
|
||||
def get_html(self, timestamp2, x_s, x_t):
|
||||
headers = {
|
||||
'cookie': "timestamp2=" + timestamp2,
|
||||
'x-s': x_s,
|
||||
'x-t': x_t,
|
||||
'content-type': 'application/json;charset=UTF-8'
|
||||
}
|
||||
|
||||
payload = "{\"account\":\"test1\",\"password\":\"test2\"," \
|
||||
"\"service\":\"https://pgy.xiaohongshu.com\"}"
|
||||
payload = payload.replace("test1", xhs_account.get('account')).replace("test2", xhs_account.get('password'))
|
||||
|
||||
req = requests.post(self.login_url, headers=headers, data=payload)
|
||||
return req.text, req.headers
|
||||
|
||||
def run(self):
|
||||
x_t = self.get_timestamp()
|
||||
print('x_t : {}'.format(x_t))
|
||||
|
||||
x_s = self.get_x_s(x_t)
|
||||
print('x_s : {}'.format(x_s))
|
||||
|
||||
id = self.get_id()
|
||||
timestamp2 = self.get_cookie_timestamp2(id)
|
||||
text, headers = self.get_html(timestamp2, x_s, x_t)
|
||||
print(text)
|
||||
print(headers)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
xhs_app = XhsApp()
|
||||
xhs_app.run()
|
53
xhs/client/client.py
Normal file
53
xhs/client/client.py
Normal file
@ -0,0 +1,53 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
|
||||
class XhsApp(object):
|
||||
def __init__(self):
|
||||
self.node_js_url = "http://127.0.0.1:3001/get_sign"
|
||||
self.cookie_url = "https://www.xiaohongshu.com/fe_api/burdock/v2/shield/registerCanvas"
|
||||
self.html_url = "https://www.xiaohongshu.com/discovery/item/5ea02f090000000001001a90"
|
||||
# sign 中的参数按需要改动后获取id值
|
||||
self.sign = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4280.141 " \
|
||||
"Safari/537.36~~~unknown~~~zh-CN~~~24~~~8~~~4~~~-480~~~Asia/Shanghai~~~1~~~1~~~1~~~1~~~unkno" \
|
||||
"wn~~~Linux x86_64~~~Chrome PDF Plugin::Portable Document Format::application/x-google-chrome" \
|
||||
"-pdf~pdf,Chrome PDF Viewer::::application/pdf~pdf,Native Client::::application/x-nacl~,appl" \
|
||||
"ication/x-pnacl~~~~canvas winding:yes~canvas fp:4ed6498d31241a0323aabbcc7f6d68a0~~~false~~~f" \
|
||||
"alse~~~false~~~false~~~false~~~0;false;false~~~0;1;2;3;4;5;6;7;8;9~~~124.04347730432432"
|
||||
|
||||
def get_id(self):
|
||||
data = {
|
||||
'sign': self.sign
|
||||
}
|
||||
req = requests.post(self.node_js_url, data=data)
|
||||
id = req.text
|
||||
return id
|
||||
|
||||
def get_cookie(self, id):
|
||||
data = {
|
||||
'id': id,
|
||||
'sign': self.sign
|
||||
}
|
||||
req = requests.post(self.cookie_url, data=data)
|
||||
canvas = json.loads(req.text).get('data').get('canvas')
|
||||
return canvas
|
||||
|
||||
def get_html(self, cookie):
|
||||
Headers = {
|
||||
'cookie': "timestamp2=" + cookie
|
||||
}
|
||||
req = requests.get(self.html_url, headers=Headers)
|
||||
return req.text
|
||||
|
||||
def run(self):
|
||||
id = self.get_id()
|
||||
print(id)
|
||||
canvas = self.get_cookie(id)
|
||||
print(canvas)
|
||||
html = self.get_html(canvas)
|
||||
print(html)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
xhs_app =XhsApp()
|
||||
xhs_app.run()
|
17
xhs/client/client_test.py
Normal file
17
xhs/client/client_test.py
Normal file
@ -0,0 +1,17 @@
|
||||
import requests
|
||||
|
||||
url = "https://customer.xiaohongshu.com/api/cas/loginWithAccount"
|
||||
|
||||
payload = "{\"account\":\"feng.bao@winndoo.com\",\"password\":\"Winndoo@com123\"," \
|
||||
"\"service\":\"https://pgy.xiaohongshu.com\"}"
|
||||
|
||||
headers = {
|
||||
'content-type': 'application/json;charset=UTF-8',
|
||||
'x-s': 'OiZk125KZga6ZjcWslMlOidB12MbOY1K0jwvOgACZgA3',
|
||||
'x-t': '1623396152975',
|
||||
'cookie': 'timestamp2=20210611efba504df43e1e6daff3fe96'
|
||||
}
|
||||
|
||||
response = requests.request("POST", url, headers=headers, data=payload)
|
||||
|
||||
print(response.text)
|
75
xhs/encryption.js
Normal file
75
xhs/encryption.js
Normal file
@ -0,0 +1,75 @@
|
||||
function encryption(t) {
|
||||
function c(t, e) {
|
||||
return t << e | t >>> 32 - e
|
||||
}
|
||||
|
||||
function u(t, e) {
|
||||
var n, r, o, i, a;
|
||||
return o = 2147483648 & t,
|
||||
i = 2147483648 & e,
|
||||
a = (1073741823 & t) + (1073741823 & e),
|
||||
(n = 1073741824 & t) & (r = 1073741824 & e) ? 2147483648 ^ a ^ o ^ i : n | r ? 1073741824 & a ? 3221225472 ^ a ^ o ^ i : 1073741824 ^ a ^ o ^ i : a ^ o ^ i
|
||||
}
|
||||
|
||||
function e(t, e, n, r, o, i, a) {
|
||||
return u(c(t = u(t, u(u(e & n | ~e & r, o), a)), i), e)
|
||||
}
|
||||
|
||||
function n(t, e, n, r, o, i, a) {
|
||||
return u(c(t = u(t, u(u(e & r | n & ~r, o), a)), i), e)
|
||||
}
|
||||
|
||||
function r(t, e, n, r, o, i, a) {
|
||||
return u(c(t = u(t, u(u(e ^ n ^ r, o), a)), i), e)
|
||||
}
|
||||
|
||||
function o(t, e, n, r, o, i, a) {
|
||||
return u(c(t = u(t, u(u(n ^ (e | ~r), o), a)), i), e)
|
||||
}
|
||||
|
||||
function i(t) {
|
||||
var e, n = "", r = "";
|
||||
for (e = 0; e <= 3; e++)
|
||||
n += (r = "0" + (t >>> 8 * e & 255).toString(16)).substr(r.length - 2, 2);
|
||||
return n
|
||||
}
|
||||
|
||||
var a, s, l, f, p, d, v, h, g, y = Array();
|
||||
for (y = function (t) {
|
||||
for (var e, n = t.length, r = n + 8, o = 16 * ((r - r % 64) / 64 + 1), i = Array(o - 1), a = 0, c = 0; c < n;)
|
||||
a = c % 4 * 8,
|
||||
i[e = (c - c % 4) / 4] = i[e] | t.charCodeAt(c) << a,
|
||||
c++;
|
||||
return a = c % 4 * 8,
|
||||
i[e = (c - c % 4) / 4] = i[e] | 128 << a,
|
||||
i[o - 2] = n << 3,
|
||||
i[o - 1] = n >>> 29,
|
||||
i
|
||||
}(t = function (t) {
|
||||
t = t.replace(/\r\n/g, "\n");
|
||||
for (var e = "", n = 0; n < t.length; n++) {
|
||||
var r = t.charCodeAt(n);
|
||||
r < 128 ? e += String.fromCharCode(r) : (127 < r && r < 2048 ? e += String.fromCharCode(r >> 6 | 192) : (e += String.fromCharCode(r >> 12 | 224),
|
||||
e += String.fromCharCode(r >> 6 & 63 | 128)),
|
||||
e += String.fromCharCode(63 & r | 128))
|
||||
}
|
||||
return e
|
||||
}(t)),
|
||||
d = 1732584193,
|
||||
v = 4023233417,
|
||||
h = 2562383102,
|
||||
g = 271733878,
|
||||
a = 0; a < y.length; a += 16)
|
||||
d = o(d = r(d = r(d = r(d = r(d = n(d = n(d = n(d = n(d = e(d = e(d = e(d = e(s = d, l = v, f = h, p = g, y[a + 0], 7, 3614090360), v = e(v, h = e(h, g = e(g, d, v, h, y[a + 1], 12, 3905402710), d, v, y[a + 2], 17, 606105819), g, d, y[a + 3], 22, 3250441966), h, g, y[a + 4], 7, 4118548399), v = e(v, h = e(h, g = e(g, d, v, h, y[a + 5], 12, 1200080426), d, v, y[a + 6], 17, 2821735955), g, d, y[a + 7], 22, 4249261313), h, g, y[a + 8], 7, 1770035416), v = e(v, h = e(h, g = e(g, d, v, h, y[a + 9], 12, 2336552879), d, v, y[a + 10], 17, 4294925233), g, d, y[a + 11], 22, 2304563134), h, g, y[a + 12], 7, 1804603682), v = e(v, h = e(h, g = e(g, d, v, h, y[a + 13], 12, 4254626195), d, v, y[a + 14], 17, 2792965006), g, d, y[a + 15], 22, 1236535329), h, g, y[a + 1], 5, 4129170786), v = n(v, h = n(h, g = n(g, d, v, h, y[a + 6], 9, 3225465664), d, v, y[a + 11], 14, 643717713), g, d, y[a + 0], 20, 3921069994), h, g, y[a + 5], 5, 3593408605), v = n(v, h = n(h, g = n(g, d, v, h, y[a + 10], 9, 38016083), d, v, y[a + 15], 14, 3634488961), g, d, y[a + 4], 20, 3889429448), h, g, y[a + 9], 5, 568446438), v = n(v, h = n(h, g = n(g, d, v, h, y[a + 14], 9, 3275163606), d, v, y[a + 3], 14, 4107603335), g, d, y[a + 8], 20, 1163531501), h, g, y[a + 13], 5, 2850285829), v = n(v, h = n(h, g = n(g, d, v, h, y[a + 2], 9, 4243563512), d, v, y[a + 7], 14, 1735328473), g, d, y[a + 12], 20, 2368359562), h, g, y[a + 5], 4, 4294588738), v = r(v, h = r(h, g = r(g, d, v, h, y[a + 8], 11, 2272392833), d, v, y[a + 11], 16, 1839030562), g, d, y[a + 14], 23, 4259657740), h, g, y[a + 1], 4, 2763975236), v = r(v, h = r(h, g = r(g, d, v, h, y[a + 4], 11, 1272893353), d, v, y[a + 7], 16, 4139469664), g, d, y[a + 10], 23, 3200236656), h, g, y[a + 13], 4, 681279174), v = r(v, h = r(h, g = r(g, d, v, h, y[a + 0], 11, 3936430074), d, v, y[a + 3], 16, 3572445317), g, d, y[a + 6], 23, 76029189), h, g, y[a + 9], 4, 3654602809), v = r(v, h = r(h, g = r(g, d, v, h, y[a + 12], 11, 3873151461), d, v, y[a + 15], 16, 530742520), g, d, y[a + 2], 23, 3299628645), h, g, y[a + 0], 6, 4096336452),
|
||||
v = o(v = o(v = o(v = o(v, h = o(h, g = o(g, d, v, h, y[a + 7], 10, 1126891415), d, v, y[a + 14], 15, 2878612391), g, d, y[a + 5], 21, 4237533241), h = o(h, g = o(g, d = o(d, v, h, g, y[a + 12], 6, 1700485571), v, h, y[a + 3], 10, 2399980690), d, v, y[a + 10], 15, 4293915773), g, d, y[a + 1], 21, 2240044497), h = o(h, g = o(g, d = o(d, v, h, g, y[a + 8], 6, 1873313359), v, h, y[a + 15], 10, 4264355552), d, v, y[a + 6], 15, 2734768916), g, d, y[a + 13], 21, 1309151649), h = o(h, g = o(g, d = o(d, v, h, g, y[a + 4], 6, 4149444226), v, h, y[a + 11], 10, 3174756917), d, v, y[a + 2], 15, 718787259), g, d, y[a + 9], 21, 3951481745),
|
||||
d = u(d, s),
|
||||
v = u(v, l),
|
||||
h = u(h, f),
|
||||
g = u(g, p);
|
||||
return (i(d) + i(v) + i(h) + i(g)).toLowerCase()
|
||||
}
|
||||
|
||||
module.exports =
|
||||
{
|
||||
encryption
|
||||
};
|
18
xhs/server/server-x-s.js
Normal file
18
xhs/server/server-x-s.js
Normal file
@ -0,0 +1,18 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const encryption = require("../xhs-x-s");
|
||||
var bodyParser = require('body-parser');
|
||||
app.use(bodyParser());
|
||||
|
||||
|
||||
app.post('/get_x_s', function (req, res) {
|
||||
let result = req.body;
|
||||
let sign = result.sign;
|
||||
console.log(sign);
|
||||
result = encryption.encryption(sign);
|
||||
res.send(result.toString());
|
||||
});
|
||||
|
||||
app.listen(3000, () => {
|
||||
console.log("开启服务,端口3000")
|
||||
});
|
18
xhs/server/server.js
Normal file
18
xhs/server/server.js
Normal file
@ -0,0 +1,18 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const encryption = require("../encryption");
|
||||
var bodyParser = require('body-parser');
|
||||
app.use(bodyParser());
|
||||
|
||||
|
||||
app.post('/get_sign', function (req, res) {
|
||||
let result = req.body;
|
||||
let sign = result.sign;
|
||||
console.log(sign);
|
||||
result = encryption.encryption(sign + "hasaki");
|
||||
res.send(result.toString());
|
||||
});
|
||||
|
||||
app.listen(3001, () => {
|
||||
console.log("开启服务,端口3001")
|
||||
});
|
1287
xhs/xhs-x-s.js
Normal file
1287
xhs/xhs-x-s.js
Normal file
File diff suppressed because it is too large
Load Diff
34
yemu_js/1.js
Normal file
34
yemu_js/1.js
Normal file
@ -0,0 +1,34 @@
|
||||
// 函数自动执行
|
||||
(function auto() {
|
||||
console.log("自动执行")
|
||||
})();
|
||||
|
||||
// 函数自动执行2
|
||||
// $(function auto() {
|
||||
// console.log("自动执行");
|
||||
// });
|
||||
|
||||
function second() {
|
||||
console.log(first())
|
||||
}
|
||||
second();
|
||||
function first() {
|
||||
return "hi ai"
|
||||
}
|
||||
|
||||
function say() {
|
||||
return "定义函数"
|
||||
}
|
||||
|
||||
var say1= function(){
|
||||
return "定义函数"
|
||||
};
|
||||
|
||||
var obj = {
|
||||
"say": function () {
|
||||
return "对象内的成员"
|
||||
}
|
||||
};
|
||||
|
||||
console.log(say());
|
||||
console.log(obj['say']());
|
33
yemu_js/10.js
Normal file
33
yemu_js/10.js
Normal file
@ -0,0 +1,33 @@
|
||||
// 逆向中偶有见到,hook 常用
|
||||
|
||||
// apply,重定义指定对象。参数数组传递
|
||||
|
||||
// output
|
||||
|
||||
let person = {
|
||||
fullInfo: function (city, country) {
|
||||
return this.name + "-" + this.age + "-" + country + "-" + city
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
let person1 = {
|
||||
name: "jor",
|
||||
age: "25"
|
||||
};
|
||||
|
||||
console.log(person.fullInfo.apply(person1, ["osle", "norway"]));
|
||||
|
||||
// call 重定义指定对象,可以直接传参
|
||||
let person2 = {
|
||||
fullInfo: function (city, country) {
|
||||
return this.name + "-" + this.age + "-" + country + "-" + city;
|
||||
}
|
||||
};
|
||||
|
||||
let person3 = {
|
||||
name: "jor",
|
||||
age: "25"
|
||||
};
|
||||
|
||||
console.log(person.fullInfo.call(person3, "Oslo", "Norway"));
|
39
yemu_js/11.js
Normal file
39
yemu_js/11.js
Normal file
@ -0,0 +1,39 @@
|
||||
const CryptoJS = require("crypto-js");
|
||||
|
||||
let value = "123456"; //待加密的字符串
|
||||
let secret_value = "af25-87hk-a35v-5"; //密匙 16位
|
||||
let iv_value = "af25-87hk-a35v-5"; // 初始向量 initial vector 16位
|
||||
|
||||
// 密匙和向量处理
|
||||
let secret = CryptoJS.enc.Utf8.parse(secret_value);
|
||||
let iv = CryptoJS.enc.Utf8.parse(iv_value);
|
||||
|
||||
// 加密
|
||||
let encrypted = CryptoJS.AES.encrypt(value, secret, {
|
||||
iv: iv,
|
||||
// mode 支持 CBC, CFB,CTB,ECB,OFB,OFB, 默认CBC
|
||||
mode: CryptoJS.mode.CBC,
|
||||
|
||||
// NoPadding, zeropadding 默认Pkcs7 即 pkcs5
|
||||
padding: CryptoJS.pad.Pkcs7
|
||||
});
|
||||
|
||||
// 将加密结果转换为字符串
|
||||
encrypted = encrypted.toString();
|
||||
|
||||
// 解密,传入密文,密钥盒向量设置加密与填充模式
|
||||
let decrypted = CryptoJS.AES.decrypt(encrypted, secret, {
|
||||
iv: iv,
|
||||
// mode 支持 CBC, CFB,CTB,ECB,OFB,OFB, 默认CBC
|
||||
mode: CryptoJS.mode.CBC,
|
||||
|
||||
// NoPadding, zeropadding 默认Pkcs7 即 pkcs5
|
||||
padding: CryptoJS.pad.Pkcs7
|
||||
});
|
||||
|
||||
// 将解密结果转换为utf8字符串
|
||||
decrypted = CryptoJS.enc.Utf8.stringify(decrypted);
|
||||
|
||||
console.log(value);
|
||||
console.log(encrypted);
|
||||
console.log(decrypted);
|
28
yemu_js/12.js
Normal file
28
yemu_js/12.js
Normal file
@ -0,0 +1,28 @@
|
||||
const CryptoJS = require("crypto-js");
|
||||
|
||||
// 编码
|
||||
let value = "https://www.sfhfpc.com/";
|
||||
let trans = CryptoJS.enc.Utf8.parse(value);
|
||||
let encrypted = CryptoJS.enc.Base64.stringify(trans);
|
||||
|
||||
// 解码
|
||||
let trans_encypted = CryptoJS.enc.Base64.parse(encrypted);
|
||||
let decrypted = trans_encypted.toString(CryptoJS.enc.Utf8);
|
||||
|
||||
console.log(value);
|
||||
console.log(encrypted);
|
||||
console.log(decrypted);
|
||||
|
||||
console.log("-----------1111111111111111-----------");
|
||||
// md5
|
||||
let value1 = "messa]ge";
|
||||
let encrypyted2 = CryptoJS.MD5(value1);
|
||||
console.log(encrypyted2.toString());
|
||||
|
||||
console.log("-----------22222222222222222-----------");
|
||||
// 加密可以切换
|
||||
let hash = CryptoJS.SHA256(value1);
|
||||
console.log(value1);
|
||||
console.log(hash.toString());
|
||||
console.log(hash.toString(CryptoJS.enc.Hex));
|
||||
console.log(hash.toString(CryptoJS.enc.Base64));
|
63
yemu_js/13.js
Normal file
63
yemu_js/13.js
Normal file
@ -0,0 +1,63 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const sum = require("./sum");
|
||||
var bodyParser = require('body-parser');
|
||||
app.use(bodyParser());
|
||||
|
||||
app.post('/get_num', function (req, res) {
|
||||
let result = req.body;
|
||||
console.log("result", result);
|
||||
let a = parseInt(result.a);
|
||||
let b = parseInt(result.b);
|
||||
result = sum.add(a, b);
|
||||
res.send(result.toString());
|
||||
});
|
||||
|
||||
app.location(3000, () => {
|
||||
console.log("开启服务,端口3000")
|
||||
});
|
||||
|
||||
|
||||
function start_debug() {
|
||||
"debugger";
|
||||
}
|
||||
|
||||
console.log("--------1");
|
||||
console.log("--------2");
|
||||
console.log("--------3");
|
||||
|
||||
while (i < 10){
|
||||
start_debug();
|
||||
i ++;
|
||||
console.log("i:", i);
|
||||
}
|
||||
|
||||
console.log("--------4");
|
||||
console.log("--------5");
|
||||
console.log("--------6");
|
||||
|
||||
eval + "";
|
||||
|
||||
window.__cr_eval = window.eval;
|
||||
var myeval = function (src) {
|
||||
console.log("======== eval begin: length" + src.length + ",caller=" + (myeval.caller && myeval.caller.name) + "===========");
|
||||
console.log(">>>>>>>> eval injected: " + document.location + " <<<<<<<<<<<<<");
|
||||
console.log(src);
|
||||
console.log("============== eval end ==================");
|
||||
return window.__cr_eval(src)
|
||||
};
|
||||
myeval.toString = function(){return "function eval() { [native code] }"};
|
||||
Object.defineProperty(window, 'eval', {value: myeval});
|
||||
|
||||
//stringify()用于从一个对象解析出字符串
|
||||
var my_stringify = JSON.stringify;
|
||||
JSON.stringify = function (params) {
|
||||
console.log("yemu", params);
|
||||
return my_stringify(params);
|
||||
};
|
||||
//parse用于从一个字符串中解析出json对象
|
||||
var my_parse = JSON.parse;
|
||||
JSON.parse = function (params) {
|
||||
console.log("yemu", params);
|
||||
return my_parse(params);
|
||||
};
|
11
yemu_js/14.js
Normal file
11
yemu_js/14.js
Normal file
@ -0,0 +1,11 @@
|
||||
function test(){
|
||||
var input_str = [103, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100];
|
||||
input_str[0] = input_str[0] + 1;
|
||||
output_str = [];
|
||||
for(var index=0;index<input_str.length;index++){
|
||||
output_str.push(String.fromCharCode(input_str[index]))
|
||||
}
|
||||
return output_str
|
||||
}
|
||||
var s = test();
|
||||
console.log(s.join(''));
|
48
yemu_js/15.js
Normal file
48
yemu_js/15.js
Normal file
@ -0,0 +1,48 @@
|
||||
function test() {
|
||||
var a = {
|
||||
'YOryo': '0|2|1|4|3',
|
||||
'Qifez': function (f, g) {
|
||||
return f + g;
|
||||
},
|
||||
'ZjDEK': function (f, g) {
|
||||
return f < g;
|
||||
}
|
||||
};
|
||||
var b = a['YOryo']['split']('|');
|
||||
var c = 0x0;
|
||||
while (!![]) {
|
||||
switch (b[c++]) {
|
||||
case '0':
|
||||
var d = [
|
||||
0x67,
|
||||
0x65,
|
||||
0x6c,
|
||||
0x6c,
|
||||
0x6f,
|
||||
0x20,
|
||||
0x77,
|
||||
0x6f,
|
||||
0x72,
|
||||
0x6c,
|
||||
0x64
|
||||
];
|
||||
continue;
|
||||
case '1':
|
||||
output_str = [];
|
||||
continue;
|
||||
case '2':
|
||||
d[0x0] = a['Qifez'](d[0x0], 0x1);
|
||||
continue;
|
||||
case '3':
|
||||
return output_str;
|
||||
case '4':
|
||||
for (var e = 0x0; a['ZjDEK'](e, d['length']); e++) {
|
||||
output_str['push'](String['fromCharCode'](d[e]));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
var s = test();
|
||||
console['log'](s['join'](''));
|
30
yemu_js/16.js
Normal file
30
yemu_js/16.js
Normal file
@ -0,0 +1,30 @@
|
||||
const recast = require("recast");
|
||||
const check = recast.types.namedTypes;
|
||||
const {
|
||||
expressionStatement,
|
||||
memberExpression,
|
||||
identifier: id,
|
||||
callExpression,
|
||||
stringLiteral
|
||||
} = recast.types.builders;
|
||||
|
||||
recast.run(function (ast, printSource) {
|
||||
recast.visit(ast, {
|
||||
visitSwitchCase(node) {
|
||||
var codes = "";
|
||||
for (var i = 0; i < node.value.consequent.length; i++){
|
||||
if (check.ContinueStatement.check(node.value.consequent[i])){
|
||||
continue
|
||||
}
|
||||
codes += recast.print(node.value.consequent[i]).code + '\n';
|
||||
console.log(codes);
|
||||
console.log("-----------------------")
|
||||
}
|
||||
|
||||
exp = expressionStatement(callExpression(memberExpression(id('console'), id("log")), [stringLiteral(codes)]));
|
||||
node.value.consequent.unshift(exp);
|
||||
return false
|
||||
}
|
||||
});
|
||||
console.log(recast.print(ast).code)
|
||||
});
|
38
yemu_js/17.js
Normal file
38
yemu_js/17.js
Normal file
@ -0,0 +1,38 @@
|
||||
function test() {
|
||||
var a = {
|
||||
'YOryo': '0|2|1|4|3',
|
||||
'Qifez': function (f, g) {
|
||||
return f + g;
|
||||
},
|
||||
'ZjDEK': function (f, g) {
|
||||
return f < g;
|
||||
}
|
||||
};
|
||||
var b = a['YOryo']['split']('|');
|
||||
var c = 0x0;
|
||||
var d = [
|
||||
0x67,
|
||||
0x65,
|
||||
0x6c,
|
||||
0x6c,
|
||||
0x6f,
|
||||
0x20,
|
||||
0x77,
|
||||
0x6f,
|
||||
0x72,
|
||||
0x6c,
|
||||
0x64
|
||||
];
|
||||
|
||||
d[0x0] = a['Qifez'](d[0x0], 0x1);
|
||||
|
||||
output_str = [];
|
||||
|
||||
for (var e = 0x0; a['ZjDEK'](e, d['length']); e++) {
|
||||
output_str['push'](String['fromCharCode'](d[e]));
|
||||
}
|
||||
|
||||
return output_str;
|
||||
}
|
||||
var s = test();
|
||||
console['log'](s['join'](''));
|
20
yemu_js/18.js
Normal file
20
yemu_js/18.js
Normal file
@ -0,0 +1,20 @@
|
||||
// ==UserScript==
|
||||
// @name search decode
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 0.1
|
||||
// @description try to take over the world!
|
||||
// @author NightTeam
|
||||
// @include *
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
(function () {
|
||||
for (var p in window){
|
||||
var s = p.toLocaleLowerCase();
|
||||
if(s.indexOf('encode') != -1 || s.indexOf('ency') != -1){
|
||||
console.log("警告!检测编码功能\n", window[p])
|
||||
}
|
||||
if(s.indexOf('decode') != -1 || s.indexOf('decry') != -1){
|
||||
console.log("警告!检测编码功能\n", window[p])
|
||||
}
|
||||
}
|
||||
})();
|
17
yemu_js/19.js
Normal file
17
yemu_js/19.js
Normal file
@ -0,0 +1,17 @@
|
||||
// ==UserScript==
|
||||
// @name search decode
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 0.1
|
||||
// @description try to take over the world!
|
||||
// @author NightTeam
|
||||
// @include *
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
(function () {
|
||||
var rparse = JSON.parse;
|
||||
JSON.parse = function (a) {
|
||||
console.log("检测Json.parse", a);
|
||||
debugger
|
||||
return rparse(a);
|
||||
}
|
||||
})();
|
27
yemu_js/2.js
Normal file
27
yemu_js/2.js
Normal file
@ -0,0 +1,27 @@
|
||||
let value = 'hello';
|
||||
// console.log(btoa(value));
|
||||
console.log(Buffer.from(value).toString('base64'));
|
||||
|
||||
// 借用第三方库实现,例如 CryptoJS,output,
|
||||
const CryptoJS = require("crypto-js");
|
||||
let value1 = "hello";
|
||||
let trans = CryptoJS.enc.Utf8.parse(value1);
|
||||
let encrypted = CryptoJS.enc.Base64.stringify(trans);
|
||||
console.log(encrypted);
|
||||
|
||||
// 自己编写一套base64编码算法和解码算法
|
||||
|
||||
function Base64() {
|
||||
this.encode = function (val) {
|
||||
// 编码逻辑
|
||||
return val
|
||||
};
|
||||
this.decode = function (val) {
|
||||
// 解码裸机
|
||||
return val
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
encrypt = new Base64();
|
||||
console.log(encrypt.encode('encode'));
|
26
yemu_js/20.js
Normal file
26
yemu_js/20.js
Normal file
@ -0,0 +1,26 @@
|
||||
var CryptoJS = require("crypto-js");
|
||||
var key = "ABC123456789"; // key
|
||||
var iv = "1234567812345678"; // 初始向量
|
||||
|
||||
function encrypt(text) {
|
||||
// AES支持三种长度的密钥:128位,192位,256位
|
||||
return CryptoJS.AES.encrypt(text, CryptoJS.enc.Utf8.parse(key), {
|
||||
iv: CryptoJS.enc.Utf8.parse(iv),
|
||||
mode: CryptoJS.mode.CBC, // CBC模式
|
||||
padding: CryptoJS.pad.Pkcs7 // Pkcs7 填充模式
|
||||
})
|
||||
}
|
||||
|
||||
function decrypt(text) {
|
||||
var result = CryptoJS.AES.decrypt(text, CryptoJS.enc.Utf8.parse(key), {
|
||||
iv: CryptoJS.enc.Utf8.parse(iv),
|
||||
mode: CryptoJS.mode.CBC,
|
||||
padding: CryptoJS.pad.Pkcs7
|
||||
});
|
||||
return result.toString(CryptoJS.enc.Utf8)
|
||||
}
|
||||
|
||||
var text = "xianyuplus";
|
||||
var encoded = encrypt(text);
|
||||
console.log(encoded.toString());
|
||||
console.log(decrypt(encoded));
|
564
yemu_js/21.js
Normal file
564
yemu_js/21.js
Normal file
@ -0,0 +1,564 @@
|
||||
_$vD = window;
|
||||
!function (t, n) {
|
||||
"object" == typeof exports ? module.exports = exports = n() : "function" == typeof define && define.amd ? define([], n) : t.o00o0o00 = n()
|
||||
}(this, function () {
|
||||
var t = t || function (t, n) {
|
||||
var i = Object.create || function () {
|
||||
function t() {
|
||||
}
|
||||
|
||||
return function (n) {
|
||||
var i;
|
||||
return t.prototype = n, i = new t, t.prototype = null, i
|
||||
}
|
||||
}(), e = {}, r = e.lib = {}, o = r.Base = function () {
|
||||
return {
|
||||
extend: function (t) {
|
||||
var n = i(this);
|
||||
return t && n.mixIn(t), n.hasOwnProperty("init") && this.init !== n.init || (n.init = function () {
|
||||
n.$super.init.apply(this, arguments)
|
||||
}), n.init.prototype = n, n.$super = this, n
|
||||
}, create: function () {
|
||||
var t = this.extend();
|
||||
return t.init.apply(t, arguments), t
|
||||
}, init: function () {
|
||||
}, mixIn: function (t) {
|
||||
for (var n in t) t.hasOwnProperty(n) && (this[n] = t[n]);
|
||||
t.hasOwnProperty("toString") && (this.toString = t.toString)
|
||||
}, clone: function () {
|
||||
return this.init.prototype.extend(this)
|
||||
}
|
||||
}
|
||||
}(), s = r.WordArray = o.extend({
|
||||
init: function (t, i) {
|
||||
t = this.words = t || [], i != n ? this.sigBytes = i : this.sigBytes = 4 * t.length
|
||||
}, toString: function (t) {
|
||||
return (t || c).stringify(this)
|
||||
}, concat: function (t) {
|
||||
var n = this.words, i = t.words, e = this.sigBytes, r = t.sigBytes;
|
||||
if (this.clamp(), e % 4) for (var o = 0; o < r; o++) {
|
||||
var s = i[o >>> 2] >>> 24 - o % 4 * 8 & 255;
|
||||
n[e + o >>> 2] |= s << 24 - (e + o) % 4 * 8
|
||||
} else for (var o = 0; o < r; o += 4) n[e + o >>> 2] = i[o >>> 2];
|
||||
return this.sigBytes += r, this
|
||||
}, clamp: function () {
|
||||
var n = this.words, i = this.sigBytes;
|
||||
n[i >>> 2] &= 4294967295 << 32 - i % 4 * 8, n.length = t.ceil(i / 4)
|
||||
}, clone: function () {
|
||||
var t = o.clone.call(this);
|
||||
return t.words = this.words.slice(0), t
|
||||
}, random: function (n) {
|
||||
for (var i, e = [], r = function (n) {
|
||||
var n = n, i = 987654321, e = 4294967295;
|
||||
return function () {
|
||||
i = 36969 * (65535 & i) + (i >> 16) & e, n = 18e3 * (65535 & n) + (n >> 16) & e;
|
||||
var r = (i << 16) + n & e;
|
||||
return r /= 4294967296, r += .5, r * (t.random() > .5 ? 1 : -1)
|
||||
}
|
||||
}, o = 0; o < n; o += 4) {
|
||||
var a = r(4294967296 * (i || t.random()));
|
||||
i = 987654071 * a(), e.push(4294967296 * a() | 0)
|
||||
}
|
||||
return new s.init(e, n)
|
||||
}
|
||||
}), a = e.o00o0o00o = {}, c = a.Hex = {
|
||||
stringify: function (t) {
|
||||
for (var n = t.words, i = t.sigBytes, e = [], r = 0; r < i; r++) {
|
||||
var o = n[r >>> 2] >>> 24 - r % 4 * 8 & 255;
|
||||
e.push((o >>> 4).toString(16)), e.push((15 & o).toString(16))
|
||||
}
|
||||
return e.join("")
|
||||
}, o00o0o00o0o: function (t) {
|
||||
for (var n = t.length, i = [], e = 0; e < n; e += 2) i[e >>> 3] |= parseInt(t.substr(e, 2), 16) << 24 - e % 8 * 4;
|
||||
return new s.init(i, n / 2)
|
||||
}
|
||||
}, u = a.Latin1 = {
|
||||
stringify: function (t) {
|
||||
for (var n = t.words, i = t.sigBytes, e = [], r = 0; r < i; r++) {
|
||||
var o = n[r >>> 2] >>> 24 - r % 4 * 8 & 255;
|
||||
e.push(String.fromCharCode(o))
|
||||
}
|
||||
return e.join("")
|
||||
}, o00o0o00o0o: function (t) {
|
||||
for (var n = t.length, i = [], e = 0; e < n; e++) i[e >>> 2] |= (255 & t.charCodeAt(e)) << 24 - e % 4 * 8;
|
||||
return new s.init(i, n)
|
||||
}
|
||||
}, f = a.o00o0o00o0 = {
|
||||
stringify: function (t) {
|
||||
try {
|
||||
return decodeURIComponent(escape(u.stringify(t)))
|
||||
} catch (t) {
|
||||
throw new Error("Malformed UTF-8 data")
|
||||
}
|
||||
}, o00o0o00o0o: function (t) {
|
||||
return u.o00o0o00o0o(unescape(encodeURIComponent(t)))
|
||||
}
|
||||
}, h = r.BufferedBlockAlgorithm = o.extend({
|
||||
reset: function () {
|
||||
this._data = new s.init, this._nDataBytes = 0
|
||||
}, _append: function (t) {
|
||||
"string" == typeof t && (t = f.o00o0o00o0o(t)), this._data.concat(t), this._nDataBytes += t.sigBytes
|
||||
}, _process: function (n) {
|
||||
var i = this._data, e = i.words, r = i.sigBytes, o = this.blockSize, a = 4 * o, c = r / a;
|
||||
c = n ? t.ceil(c) : t.max((0 | c) - this._minBufferSize, 0);
|
||||
var u = c * o, f = t.min(4 * u, r);
|
||||
if (u) {
|
||||
for (var h = 0; h < u; h += o) this._doProcessBlock(e, h);
|
||||
var p = e.splice(0, u);
|
||||
i.sigBytes -= f
|
||||
}
|
||||
return new s.init(p, f)
|
||||
}, clone: function () {
|
||||
var t = o.clone.call(this);
|
||||
return t._data = this._data.clone(), t
|
||||
}, _minBufferSize: 0
|
||||
}), p = (r.Hasher = h.extend({
|
||||
cfg: o.extend(), init: function (t) {
|
||||
this.cfg = this.cfg.extend(t), this.reset()
|
||||
}, reset: function () {
|
||||
h.reset.call(this), this._doReset()
|
||||
}, update: function (t) {
|
||||
return this._append(t), this._process(), this
|
||||
}, finalize: function (t) {
|
||||
t && this._append(t);
|
||||
var n = this._doFinalize();
|
||||
return n
|
||||
}, blockSize: 16, _createHelper: function (t) {
|
||||
return function (n, i) {
|
||||
return new t.init(i).finalize(n)
|
||||
}
|
||||
}, _createHmacHelper: function (t) {
|
||||
return function (n, i) {
|
||||
return new p.HMAC.init(t, i).finalize(n)
|
||||
}
|
||||
}
|
||||
}), e.algo = {});
|
||||
return e
|
||||
}(Math);
|
||||
return t
|
||||
});
|
||||
!function (e, t, i) {
|
||||
"object" == typeof exports ? module.exports = exports = t(require("./core.min"), require("./sha1.min"), require("./hmac.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./sha1.min", "./hmac.min"], t) : t(e.o00o0o00)
|
||||
}(this, function (e) {
|
||||
return function () {
|
||||
var t = e, i = t.lib, r = i.Base, n = i.WordArray, o = t.algo, a = o.MD5, c = o.EvpKDF = r.extend({
|
||||
cfg: r.extend({keySize: 4, hasher: a, iterations: 1}), init: function (e) {
|
||||
this.cfg = this.cfg.extend(e)
|
||||
}, compute: function (e, t) {
|
||||
for (var i = this.cfg, r = i.hasher.create(), o = n.create(), a = o.words, c = i.keySize, f = i.iterations; a.length < c;) {
|
||||
s && r.update(s);
|
||||
var s = r.update(e).finalize(t);
|
||||
r.reset();
|
||||
for (var u = 1; u < f; u++) s = r.finalize(s), r.reset();
|
||||
o.concat(s)
|
||||
}
|
||||
return o.sigBytes = 4 * c, o
|
||||
}
|
||||
});
|
||||
t.EvpKDF = function (e, t, i) {
|
||||
return c.create(i).compute(e, t)
|
||||
}
|
||||
}(), e.EvpKDF
|
||||
});
|
||||
t = {
|
||||
d: _$vD["e" + "v" + "a" + "l"](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;
|
||||
}('{2:"1"+"0"+"3"+"5"+"4"+"0"}', 6, 6, '{{ m }}'.split('|'), 0, {}))
|
||||
};
|
||||
!function (r, e) {
|
||||
"object" == typeof exports ? module.exports = exports = e(require("./core.min")) : "function" == typeof define && define.amd ? define(["./core.min"], e) : e(r.o00o0o00)
|
||||
}(this, function (r) {
|
||||
return function () {
|
||||
function e(r, e, t) {
|
||||
for (var n = [], i = 0, o = 0; o < e; o++) if (o % 4) {
|
||||
var f = t[r.charCodeAt(o - 1)] << o % 4 * 2, c = t[r.charCodeAt(o)] >>> 6 - o % 4 * 2;
|
||||
n[i >>> 2] |= (f | c) << 24 - i % 4 * 8, i++
|
||||
}
|
||||
return a.create(n, i)
|
||||
}
|
||||
|
||||
var t = r, n = t.lib, a = n.WordArray, i = t.o00o0o00o;
|
||||
i.Base64 = {
|
||||
stringify: function (r) {
|
||||
var e = r.words, t = r.sigBytes, n = this._map;
|
||||
r.clamp();
|
||||
for (var a = [], i = 0; i < t; i += 3) for (var o = e[i >>> 2] >>> 24 - i % 4 * 8 & 255, f = e[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255, c = e[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255, s = o << 16 | f << 8 | c, h = 0; h < 4 && i + .75 * h < t; h++) a.push(n.charAt(s >>> 6 * (3 - h) & 63));
|
||||
var p = n.charAt(64);
|
||||
if (p) for (; a.length % 4;) a.push(p);
|
||||
return a.join("")
|
||||
}, o00o0o00o0o: function (r) {
|
||||
var t = r.length, n = this._map, a = this._reverseMap;
|
||||
if (!a) {
|
||||
a = this._reverseMap = [];
|
||||
for (var i = 0; i < n.length; i++) a[n.charCodeAt(i)] = i
|
||||
}
|
||||
var o = n.charAt(64);
|
||||
if (o) {
|
||||
var f = r.indexOf(o);
|
||||
f !== -1 && (t = f)
|
||||
}
|
||||
return e(r, t, a)
|
||||
}, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
||||
}
|
||||
}(), r.o00o0o00o.Base64
|
||||
});
|
||||
!function (e, t, r) {
|
||||
"object" == typeof exports ? module.exports = exports = t(require("./core.min"), require("./evpkdf.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./evpkdf.min"], t) : t(e.o00o0o00)
|
||||
}(this, function (e) {
|
||||
e.lib.Cipher || function (t) {
|
||||
var r = e, i = r.lib, n = i.Base, c = i.WordArray, o = i.BufferedBlockAlgorithm, s = r.o00o0o00o,
|
||||
a = (s.o00o0o00o0, s.Base64), f = r.algo, p = f.EvpKDF, d = i.Cipher = o.extend({
|
||||
cfg: n.extend(), createo00o0o00oryptor: function (e, t) {
|
||||
return this.create(this._o00o0o00o_XFORM_MODE, e, t)
|
||||
}, createDecryptor: function (e, t) {
|
||||
return this.create(this._DEC_XFORM_MODE, e, t)
|
||||
}, init: function (e, t, r) {
|
||||
this.cfg = this.cfg.extend(r), this._xformMode = e, this._key = t, this.reset()
|
||||
}, reset: function () {
|
||||
o.reset.call(this), this._doReset()
|
||||
}, process: function (e) {
|
||||
return this._append(e), this._process()
|
||||
}, finalize: function (e) {
|
||||
e && this._append(e);
|
||||
var t = this._doFinalize();
|
||||
return t
|
||||
}, keySize: 4, ivSize: 4, _o00o0o00o_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function () {
|
||||
function e(e) {
|
||||
return "string" == typeof e ? B : x
|
||||
}
|
||||
|
||||
return function (t) {
|
||||
return {
|
||||
o00o0o00orypt: function (r, i, n) {
|
||||
return e(i).o00o0o00orypt(t, r, i, n)
|
||||
}, decrypt: function (r, i, n) {
|
||||
return e(i).decrypt(t, r, i, n)
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
}), h = (i.StreamCipher = d.extend({
|
||||
_doFinalize: function () {
|
||||
var e = this._process(!0);
|
||||
return e
|
||||
}, blockSize: 1
|
||||
}), r.mode = {}), u = i.BlockCipherMode = n.extend({
|
||||
createo00o0o00oryptor: function (e, t) {
|
||||
return this.o00o0o00oryptor.create(e, t)
|
||||
}, createDecryptor: function (e, t) {
|
||||
return this.Decryptor.create(e, t)
|
||||
}, init: function (e, t) {
|
||||
this._cipher = e, this._iv = t
|
||||
}
|
||||
}), l = h.CBC = function () {
|
||||
function e(e, r, i) {
|
||||
var n = this._iv;
|
||||
if (n) {
|
||||
var c = n;
|
||||
this._iv = t
|
||||
} else var c = this._prevBlock;
|
||||
for (var o = 0; o < i; o++) e[r + o] ^= c[o]
|
||||
}
|
||||
|
||||
var r = u.extend();
|
||||
return r.o00o0o00oryptor = r.extend({
|
||||
processBlock: function (t, r) {
|
||||
var i = this._cipher, n = i.blockSize;
|
||||
e.call(this, t, r, n), i.o00o0o00oryptBlock(t, r), this._prevBlock = t.slice(r, r + n)
|
||||
}
|
||||
}), r.Decryptor = r.extend({
|
||||
processBlock: function (t, r) {
|
||||
var i = this._cipher, n = i.blockSize, c = t.slice(r, r + n);
|
||||
i.decryptBlock(t, r), e.call(this, t, r, n), this._prevBlock = c
|
||||
}
|
||||
}), r
|
||||
}(), _ = r.pad = {}, v = _.o00o0o00o0o0o0 = {
|
||||
pad: function (e, t) {
|
||||
for (var r = 4 * t, i = r - e.sigBytes % r, n = i << 24 | i << 16 | i << 8 | i, o = [], s = 0; s < i; s += 4) o.push(n);
|
||||
var a = c.create(o, i);
|
||||
e.concat(a)
|
||||
}, unpad: function (e) {
|
||||
var t = 255 & e.words[e.sigBytes - 1 >>> 2];
|
||||
e.sigBytes -= t
|
||||
}
|
||||
}, y = (i.BlockCipher = d.extend({
|
||||
cfg: d.cfg.extend({mode: l, padding: v}), reset: function () {
|
||||
d.reset.call(this);
|
||||
var e = this.cfg, t = e.iv, r = e.mode;
|
||||
if (this._xformMode == this._o00o0o00o_XFORM_MODE) var i = r.createo00o0o00oryptor; else {
|
||||
var i = r.createDecryptor;
|
||||
this._minBufferSize = 1
|
||||
}
|
||||
this._mode && this._mode.__creator == i ? this._mode.init(this, t && t.words) : (this._mode = i.call(r, this, t && t.words), this._mode.__creator = i)
|
||||
}, _doProcessBlock: function (e, t) {
|
||||
this._mode.processBlock(e, t)
|
||||
}, _doFinalize: function () {
|
||||
var e = this.cfg.padding;
|
||||
if (this._xformMode == this._o00o0o00o_XFORM_MODE) {
|
||||
e.pad(this._data, this.blockSize);
|
||||
var t = this._process(!0)
|
||||
} else {
|
||||
var t = this._process(!0);
|
||||
e.unpad(t)
|
||||
}
|
||||
return t
|
||||
}, blockSize: 4
|
||||
}), i.CipherParams = n.extend({
|
||||
init: function (e) {
|
||||
this.mixIn(e)
|
||||
}, toString: function (e) {
|
||||
return (e || this.formatter).stringify(this)
|
||||
}
|
||||
})), m = r.format = {}, k = m.OpenSSL = {
|
||||
stringify: function (e) {
|
||||
var t = e.ciphertext, r = e.salt;
|
||||
if (r) var i = c.create([1398893684, 1701076831]).concat(r).concat(t); else var i = t;
|
||||
return i.toString(a)
|
||||
}, o00o0o00o0o: function (e) {
|
||||
var t = a.o00o0o00o0o(e), r = t.words;
|
||||
if (1398893684 == r[0] && 1701076831 == r[1]) {
|
||||
var i = c.create(r.slice(2, 4));
|
||||
r.splice(0, 4), t.sigBytes -= 16
|
||||
}
|
||||
return y.create({ciphertext: t, salt: i})
|
||||
}
|
||||
}, x = i.SerializableCipher = n.extend({
|
||||
cfg: n.extend({format: k}), o00o0o00orypt: function (e, t, r, i) {
|
||||
i = this.cfg.extend(i);
|
||||
var n = e.createo00o0o00oryptor(r, i), c = n.finalize(t), o = n.cfg;
|
||||
return y.create({
|
||||
ciphertext: c,
|
||||
key: r,
|
||||
iv: o.iv,
|
||||
algorithm: e,
|
||||
mode: o.mode,
|
||||
padding: o.padding,
|
||||
blockSize: e.blockSize,
|
||||
formatter: i.format
|
||||
})
|
||||
}, decrypt: function (e, t, r, i) {
|
||||
i = this.cfg.extend(i), t = this._o00o0o00o0o(t, i.format);
|
||||
var n = e.createDecryptor(r, i).finalize(t.ciphertext);
|
||||
return n
|
||||
}, _o00o0o00o0o: function (e, t) {
|
||||
return "string" == typeof e ? t.o00o0o00o0o(e, this) : e
|
||||
}
|
||||
}), g = r.kdf = {}, S = g.OpenSSL = {
|
||||
execute: function (e, t, r, i) {
|
||||
i || (i = c.random(8));
|
||||
var n = p.create({keySize: t + r}).compute(e, i), o = c.create(n.words.slice(t), 4 * r);
|
||||
return n.sigBytes = 4 * t, y.create({key: n, iv: o, salt: i})
|
||||
}
|
||||
}, B = i.PasswordBasedCipher = x.extend({
|
||||
cfg: x.cfg.extend({kdf: S}), o00o0o00orypt: function (e, t, r, i) {
|
||||
i = this.cfg.extend(i);
|
||||
var n = i.kdf.execute(r, e.keySize, e.ivSize);
|
||||
i.iv = n.iv;
|
||||
var c = x.o00o0o00orypt.call(this, e, t, n.key, i);
|
||||
return c.mixIn(n), c
|
||||
}, decrypt: function (e, t, r, i) {
|
||||
i = this.cfg.extend(i), t = this._o00o0o00o0o(t, i.format);
|
||||
var n = i.kdf.execute(r, e.keySize, e.ivSize, t.salt);
|
||||
i.iv = n.iv;
|
||||
var c = x.decrypt.call(this, e, t, n.key, i);
|
||||
return c
|
||||
}
|
||||
})
|
||||
}()
|
||||
});
|
||||
!function (e, i) {
|
||||
"object" == typeof exports ? module.exports = exports = i(require("./core.min")) : "function" == typeof define && define.amd ? define(["./core.min"], i) : i(e.o00o0o00)
|
||||
}(this, function (e) {
|
||||
!function () {
|
||||
var i = e, t = i.lib, n = t.Base, s = i.o00o0o00o, r = s.o00o0o00o0, o = i.algo;
|
||||
o.HMAC = n.extend({
|
||||
init: function (e, i) {
|
||||
e = this._hasher = new e.init, "string" == typeof i && (i = r.o00o0o00o0o(i));
|
||||
var t = e.blockSize, n = 4 * t;
|
||||
i.sigBytes > n && (i = e.finalize(i)), i.clamp();
|
||||
for (var s = this._oKey = i.clone(), o = this._iKey = i.clone(), a = s.words, f = o.words, c = 0; c < t; c++) a[c] ^= 1549556828, f[c] ^= 909522486;
|
||||
s.sigBytes = o.sigBytes = n, this.reset()
|
||||
}, reset: function () {
|
||||
var e = this._hasher;
|
||||
e.reset(), e.update(this._iKey)
|
||||
}, update: function (e) {
|
||||
return this._hasher.update(e), this
|
||||
}, finalize: function (e) {
|
||||
var i = this._hasher, t = i.finalize(e);
|
||||
i.reset();
|
||||
var n = i.finalize(this._oKey.clone().concat(t));
|
||||
return n
|
||||
}
|
||||
})
|
||||
}()
|
||||
});
|
||||
!function (e, o, r) {
|
||||
"object" == typeof exports ? module.exports = exports = o(require("./core.min"), require("./cipher-core.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./cipher-core.min"], o) : o(e.o00o0o00)
|
||||
}(this, function (e) {
|
||||
return e.mode.o00o0o00o0o0o = function () {
|
||||
var o = e.lib.BlockCipherMode.extend();
|
||||
return o.o00o0o00oryptor = o.extend({
|
||||
processBlock: function (e, o) {
|
||||
this._cipher.o00o0o00oryptBlock(e, o)
|
||||
}
|
||||
}), o.Decryptor = o.extend({
|
||||
processBlock: function (e, o) {
|
||||
this._cipher.decryptBlock(e, o)
|
||||
}
|
||||
}), o
|
||||
}(), e.mode.o00o0o00o0o0o
|
||||
});
|
||||
!function (e, r, i) {
|
||||
"object" == typeof exports ? module.exports = exports = r(require("./core.min"), require("./cipher-core.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./cipher-core.min"], r) : r(e.o00o0o00)
|
||||
}(this, function (e) {
|
||||
return e.pad.o00o0o00o0o0o0
|
||||
});
|
||||
!function (e, r, i) {
|
||||
"object" == typeof exports ? module.exports = exports = r(require("./core.min"), require("./o00o0o00o-base64.min"), require("./md5.min"), require("./evpkdf.min"), require("./cipher-core.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./o00o0o00o-base64.min", "./md5.min", "./evpkdf.min", "./cipher-core.min"], r) : r(e.o00o0o00)
|
||||
}(this, function (e) {
|
||||
return function () {
|
||||
var r = e, i = r.lib, n = i.BlockCipher, o = r.algo, t = [], c = [], s = [], f = [], a = [], d = [], u = [],
|
||||
v = [], h = [], y = [];
|
||||
!function () {
|
||||
for (var e = [], r = 0; r < 256; r++) r < 128 ? e[r] = r << 1 : e[r] = r << 1 ^ 283;
|
||||
for (var i = 0, n = 0, r = 0; r < 256; r++) {
|
||||
var o = n ^ n << 1 ^ n << 2 ^ n << 3 ^ n << 4;
|
||||
o = o >>> 8 ^ 255 & o ^ 99, t[i] = o, c[o] = i;
|
||||
var p = e[i], l = e[p], _ = e[l], k = 257 * e[o] ^ 16843008 * o;
|
||||
s[i] = k << 24 | k >>> 8, f[i] = k << 16 | k >>> 16, a[i] = k << 8 | k >>> 24, d[i] = k;
|
||||
var k = 16843009 * _ ^ 65537 * l ^ 257 * p ^ 16843008 * i;
|
||||
u[o] = k << 24 | k >>> 8, v[o] = k << 16 | k >>> 16, h[o] = k << 8 | k >>> 24, y[o] = k, i ? (i = p ^ e[e[e[_ ^ p]]], n ^= e[e[n]]) : i = n = 1
|
||||
}
|
||||
}();
|
||||
var p = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], l = o.o00o0o00o0o0 = n.extend({
|
||||
_doReset: function () {
|
||||
if (!this._nRounds || this._keyPriorReset !== this._key) {
|
||||
for (var e = this._keyPriorReset = this._key, r = e.words, i = e.sigBytes / 4, n = this._nRounds = i + 6, o = 4 * (n + 1), c = this._keySchedule = [], s = 0; s < o; s++) if (s < i) c[s] = r[s]; else {
|
||||
var f = c[s - 1];
|
||||
s % i ? i > 6 && s % i == 4 && (f = t[f >>> 24] << 24 | t[f >>> 16 & 255] << 16 | t[f >>> 8 & 255] << 8 | t[255 & f]) : (f = f << 8 | f >>> 24, f = t[f >>> 24] << 24 | t[f >>> 16 & 255] << 16 | t[f >>> 8 & 255] << 8 | t[255 & f], f ^= p[s / i | 0] << 24), c[s] = c[s - i] ^ f
|
||||
}
|
||||
for (var a = this._invKeySchedule = [], d = 0; d < o; d++) {
|
||||
var s = o - d;
|
||||
if (d % 4) var f = c[s]; else var f = c[s - 4];
|
||||
d < 4 || s <= 4 ? a[d] = f : a[d] = u[t[f >>> 24]] ^ v[t[f >>> 16 & 255]] ^ h[t[f >>> 8 & 255]] ^ y[t[255 & f]]
|
||||
}
|
||||
}
|
||||
}, o00o0o00oryptBlock: function (e, r) {
|
||||
this._doCryptBlock(e, r, this._keySchedule, s, f, a, d, t)
|
||||
}, decryptBlock: function (e, r) {
|
||||
var i = e[r + 1];
|
||||
e[r + 1] = e[r + 3], e[r + 3] = i, this._doCryptBlock(e, r, this._invKeySchedule, u, v, h, y, c);
|
||||
var i = e[r + 1];
|
||||
e[r + 1] = e[r + 3], e[r + 3] = i
|
||||
}, _doCryptBlock: function (e, r, i, n, o, t, c, s) {
|
||||
for (var f = this._nRounds, a = e[r] ^ i[0], d = e[r + 1] ^ i[1], u = e[r + 2] ^ i[2], v = e[r + 3] ^ i[3], h = 4, y = 1; y < f; y++) {
|
||||
var p = n[a >>> 24] ^ o[d >>> 16 & 255] ^ t[u >>> 8 & 255] ^ c[255 & v] ^ i[h++],
|
||||
l = n[d >>> 24] ^ o[u >>> 16 & 255] ^ t[v >>> 8 & 255] ^ c[255 & a] ^ i[h++],
|
||||
_ = n[u >>> 24] ^ o[v >>> 16 & 255] ^ t[a >>> 8 & 255] ^ c[255 & d] ^ i[h++],
|
||||
k = n[v >>> 24] ^ o[a >>> 16 & 255] ^ t[d >>> 8 & 255] ^ c[255 & u] ^ i[h++];
|
||||
a = p, d = l, u = _, v = k
|
||||
}
|
||||
var p = (s[a >>> 24] << 24 | s[d >>> 16 & 255] << 16 | s[u >>> 8 & 255] << 8 | s[255 & v]) ^ i[h++],
|
||||
l = (s[d >>> 24] << 24 | s[u >>> 16 & 255] << 16 | s[v >>> 8 & 255] << 8 | s[255 & a]) ^ i[h++],
|
||||
_ = (s[u >>> 24] << 24 | s[v >>> 16 & 255] << 16 | s[a >>> 8 & 255] << 8 | s[255 & d]) ^ i[h++],
|
||||
k = (s[v >>> 24] << 24 | s[a >>> 16 & 255] << 16 | s[d >>> 8 & 255] << 8 | s[255 & u]) ^ i[h++];
|
||||
e[r] = p, e[r + 1] = l, e[r + 2] = _, e[r + 3] = k
|
||||
}, keySize: 8
|
||||
});
|
||||
r.o00o0o00o0o0 = n._createHelper(l)
|
||||
}(), e.o00o0o00o0o0
|
||||
});
|
||||
!function (e, n) {
|
||||
"object" == typeof exports ? module.exports = exports = n(require("./core.min")) : "function" == typeof define && define.amd ? define(["./core.min"], n) : n(e.o00o0o00)
|
||||
}(this, function (e) {
|
||||
return e.o00o0o00o.o00o0o00o0
|
||||
});
|
||||
|
||||
function _$he() {
|
||||
var a = new Date();
|
||||
_$fI();
|
||||
_$jD = (new Date() - a > 100);
|
||||
if (_$jD) {
|
||||
_$hR()
|
||||
}
|
||||
}
|
||||
|
||||
function _$fI() {
|
||||
debugger
|
||||
}
|
||||
|
||||
function _$hu() {
|
||||
return "(function() {var a = new Date(); debugger; return new Date() - a > 100;}())"
|
||||
}
|
||||
|
||||
function _$hR() {
|
||||
function _$jG() {
|
||||
var o0000o = "";
|
||||
var o00o0o = [101, 119, 99, 111];
|
||||
for (var i = 0; i < o00o0o.length; i++) {
|
||||
var o00o00 = o00o0o[i] - i;
|
||||
o0000o += String.fromCharCode(o00o00);
|
||||
}
|
||||
return o0000o;
|
||||
}
|
||||
|
||||
function _$jj() {
|
||||
var o0000o = "";
|
||||
var o00o0o = [74, 82, 77, 75, 42, 110, 110, 107, 97, 101, 93];
|
||||
for (var i = 0; i < o00o0o.length; i++) {
|
||||
var o00o00 = o00o0o[i] + i;
|
||||
o0000o += String.fromCharCode(o00o00);
|
||||
}
|
||||
return o0000o;
|
||||
}
|
||||
|
||||
_$r3 = _$vD[_$jG()];
|
||||
if ((_$r3 + "").indexOf("native") == -1) {
|
||||
while (1) {
|
||||
_$fI()
|
||||
}
|
||||
}
|
||||
_$r4 = _$r3(_$jj() + "ify");
|
||||
if ((_$r4 + "").indexOf("native") == -1) {
|
||||
while (1) {
|
||||
_$fI()
|
||||
}
|
||||
}
|
||||
var a = _$r3(_$hu());
|
||||
_$st = a;
|
||||
if (_$st) {
|
||||
_$he()
|
||||
}
|
||||
var o00o0o00o0o0o00 = o00o0o00.o00o0o00o.o00o0o00o0.o00o0o00o0o((_$vD["t"]["d"] + "{{ yemu }}" + _$he()).substring(0, 16));
|
||||
o0oo0o00 = o00o0o00.o00o0o00o0o0.o00o0o00orypt(_$vD[_$jG()](_$jj() + "ify")({o00o0o00o0o0o0: _$jG() + "0514" + _$he()}), o00o0o00o0o0o00, {
|
||||
mode: o00o0o00.mode.o00o0o00o0o0o,
|
||||
padding: o00o0o00.pad.o00o0o00o0o0o0
|
||||
}).ciphertext.toString();
|
||||
}
|
||||
|
||||
(function () {
|
||||
setInterval(function () {
|
||||
_$he()
|
||||
}, 4000)
|
||||
}());
|
||||
$("#b").click(function () {
|
||||
_$he();
|
||||
_$hR();
|
||||
htmlobj = $.ajax({url: "/crypt_demo.html?arg=" + o0oo0o00 + "&t=" + new Date().getTime(), async: false});
|
||||
$("#a").html(htmlobj.responseText);
|
||||
})
|
23
yemu_js/22.js
Normal file
23
yemu_js/22.js
Normal file
@ -0,0 +1,23 @@
|
||||
var CryptoJS = require("crypto-js");
|
||||
var key = "ABC123456789"; // key
|
||||
|
||||
function encrypt(text) {
|
||||
// AES支持三种长度的密钥:128位,192位,256位
|
||||
return CryptoJS.AES.encrypt(text, CryptoJS.enc.Utf8.parse(key), {
|
||||
mode: CryptoJS.mode.ECB, // ECB模式
|
||||
padding: CryptoJS.pad.Pkcs7 // Pkcs7 填充模式
|
||||
})
|
||||
}
|
||||
|
||||
function decrypt(text) {
|
||||
var result = CryptoJS.AES.decrypt(text, CryptoJS.enc.Utf8.parse(key), {
|
||||
mode: CryptoJS.mode.ECB,
|
||||
padding: CryptoJS.pad.Pkcs7
|
||||
});
|
||||
return result.toString(CryptoJS.enc.Utf8)
|
||||
}
|
||||
|
||||
var text = "xianyuplus";
|
||||
var encoded = encrypt(text);
|
||||
console.log(encoded.toString());
|
||||
console.log(decrypt(encoded));
|
12
yemu_js/3.js
Normal file
12
yemu_js/3.js
Normal file
@ -0,0 +1,12 @@
|
||||
// 将js对象转换为字符串, output
|
||||
|
||||
var params = {
|
||||
"username": "sfhfpc",
|
||||
"password": "123456"
|
||||
};
|
||||
|
||||
console.log(JSON.stringify(params));
|
||||
|
||||
// 将字符串转换为对象,output
|
||||
var params = '{"username":"sfhfpc","password":"123456"}';
|
||||
console.log(JSON.parse(params), typeof(JSON.parse(params)));
|
29
yemu_js/4.js
Normal file
29
yemu_js/4.js
Normal file
@ -0,0 +1,29 @@
|
||||
// 定义一个空数组
|
||||
// let mousePos = [];
|
||||
// 定义一个空数组
|
||||
let mousePos = new Array();
|
||||
|
||||
// 向数组添加元素 output
|
||||
mousePos.push([100, 50, 1586998787]);
|
||||
console.log(mousePos);
|
||||
|
||||
// 删除并返回一个元素
|
||||
console.log(mousePos.pop());
|
||||
|
||||
// 数组转字符串
|
||||
let mousePos1 = new Array();
|
||||
mousePos1.push([100, 50, 1586998787]);
|
||||
mousePos1.push([101, 50, 1586998787]);
|
||||
mousePos1.push([102, 50, 1586998787]);
|
||||
mousePos1.push([103, 50, 1586998787]);
|
||||
mousePos1.push([104, 50, 1586998787]);
|
||||
console.log(mousePos1.join(","));
|
||||
|
||||
// 数组转字符串-2
|
||||
let mousePos2 = new Array();
|
||||
mousePos2.push([100, 50, 1586998787]);
|
||||
mousePos2.push([101, 50, 1586998787]);
|
||||
mousePos2.push([102, 50, 1586998787]);
|
||||
mousePos2.push([103, 50, 1586998787]);
|
||||
mousePos2.push([104, 50, 1586998787]);
|
||||
console.log(mousePos2.join(","));
|
7
yemu_js/5.js
Normal file
7
yemu_js/5.js
Normal file
@ -0,0 +1,7 @@
|
||||
// 编码转字符
|
||||
let value = String.fromCharCode(72,69,76,77);
|
||||
console.log(value);
|
||||
|
||||
// 字符转编码
|
||||
let value1 = 'h';
|
||||
console.log(value1.charCodeAt());
|
21
yemu_js/6.js
Normal file
21
yemu_js/6.js
Normal file
@ -0,0 +1,21 @@
|
||||
// tostring 在逆向过程中是非常常见的
|
||||
|
||||
// 数组转字符串
|
||||
let param = [5, 6, 8];
|
||||
console.log(param.toString());
|
||||
|
||||
// 字符串转二进制
|
||||
let value = 6;
|
||||
console.log(value.toString(2));
|
||||
|
||||
// 字符串转16进制
|
||||
let value2 = 26;
|
||||
console.log(value2.toString(16));
|
||||
|
||||
// 布尔值转字符串
|
||||
let value1 = false;
|
||||
console.log(value1.toString());
|
||||
|
||||
// 判断类型
|
||||
let arr = [1,2,3];
|
||||
console.log(toString.call(arr));
|
47
yemu_js/7.js
Normal file
47
yemu_js/7.js
Normal file
@ -0,0 +1,47 @@
|
||||
// 单行return,这很正常
|
||||
function _tokeVale(v) {
|
||||
let _token = v.join("-");
|
||||
return _token
|
||||
}
|
||||
|
||||
console.log(_tokeVale([56, 78, 33]));
|
||||
|
||||
// 多行 return,return 处给了多个值,但真正的返回的只有最后一个
|
||||
function first() {
|
||||
console.log("diao xi wo,wo hen sao qi");
|
||||
return "first"
|
||||
}
|
||||
|
||||
let second = function first() {
|
||||
console.log("diao xi wo,wo hen sao qi");
|
||||
return "second"
|
||||
};
|
||||
|
||||
function _tokenValue(v) {
|
||||
// 假装这里对着v值一顿转换he操作
|
||||
let _token = v.join("-");
|
||||
return first(), second(), _token;
|
||||
}
|
||||
console.log(_tokenValue([56, 78, 33]));
|
||||
|
||||
console.log("----------------");
|
||||
|
||||
// 多行 return
|
||||
// 跟上面是一样,只不过换了一个案例对比,依旧只返回最后一个
|
||||
function first() {
|
||||
console.log("diao xi wo,wo hen sao qi")
|
||||
return "first";
|
||||
}
|
||||
|
||||
let second1 = function () {
|
||||
console.log("diao xi wo,wo hen sao qi");
|
||||
return "second1";
|
||||
};
|
||||
|
||||
function _tokenValue(v) {
|
||||
// 假装这里对着v值一顿转换he操作
|
||||
let _token = v.join("-");
|
||||
return first(), _token, second1();
|
||||
}
|
||||
|
||||
console.log(_tokenValue([56, 78, 33]));
|
47
yemu_js/8.js
Normal file
47
yemu_js/8.js
Normal file
@ -0,0 +1,47 @@
|
||||
// 几乎每天都在逆向的时候看到混淆
|
||||
|
||||
// 16进制混淆
|
||||
let objects = {
|
||||
"\x66\x69\x6c\x74\x65\x72": function () {
|
||||
// 假装这里一顿操作
|
||||
return "\x6c\x74\x65";
|
||||
}
|
||||
};
|
||||
|
||||
// unicode 混淆
|
||||
let objects1 = {
|
||||
"\u0073\u0069\u0067\u006e\u0056\u0061\u006c\u0075\u0065": function () {
|
||||
// 假装这里一顿操作
|
||||
return "ENG987KJS732njH7273NH23";
|
||||
}
|
||||
};
|
||||
|
||||
// 数组混淆,将字符串放到数组中,通过下标访问
|
||||
let values = ["sign", "publicKey", "Base64", "encrypt", "toString", "decode", "atob", "btoa"];
|
||||
let url = "http://www.sfhfpc.com/";
|
||||
values[0] = "SI209U+230D86+7NB=";
|
||||
let full = url + "?" + values[0] + "_";
|
||||
console.log(values[0]);
|
||||
console.log(full);
|
||||
|
||||
// 变量名硬混淆
|
||||
let _sh78x6 = ["sign", "publicKey", "Base64", "encrypt", "toString", "decode", "atob", "btoa"];
|
||||
let _ac87x5 = "http://www.sfhfpc.com/";
|
||||
_sh78x6[0] = "SI209U+230D86+7NB=";
|
||||
let _ac87x6 = _ac87x5 + "?" + _sh78x6[0] + "_";
|
||||
console.log(_sh78x6[0]);
|
||||
console.log(_ac87x6);
|
||||
|
||||
// 数组+ 16进制+ Unicode+ 变量名混淆
|
||||
let _sh78x61 = ["\x73\x69\x67\x6e", "\x70\x75\x62\x6c\x69\x63\x4b\x65\x79",
|
||||
"\x42\x61\x73\x65\x36\x34", "\x5f\x61\x63\x38\x37\x78\x35"];
|
||||
_sh78x61[3] = "\u0073\u0069\u0067\u006e\u0056\u0061\u006c\u0075\u0065";
|
||||
_sh78x61[0] = "\u0073\u0069\u0067\u006e\u0056\u0061\u006c\u0075\u0065";
|
||||
let _ac87x61 = _sh78x61[3] + "\x3f" + _sh78x61[0] + "\x5f";
|
||||
function _$BCD() {
|
||||
// 假装这里很多操作
|
||||
return _sh78x61[4]
|
||||
}
|
||||
console.log(_sh78x61[0]);
|
||||
console.log(_ac87x61);
|
||||
console.log(_$BCD);
|
24
yemu_js/9.1.js
Normal file
24
yemu_js/9.1.js
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
゚ω゚ノ = /`m´)ノ ~┻━┻ //*´∇`*/ ['_'];
|
||||
o = (゚ー゚) = _ = 3;
|
||||
c = (゚Θ゚) = (゚ー゚) - (゚ー゚);
|
||||
(゚Д゚) = (゚Θ゚) = (o ^ _ ^ o) / (o ^ _ ^ o);
|
||||
(゚Д゚) = {
|
||||
゚Θ゚: '_',
|
||||
゚ω゚ノ: ((゚ω゚ノ == 3) + '_') [゚Θ゚],
|
||||
゚ー゚ノ: (゚ω゚ノ + '_')[o ^ _ ^ o - (゚Θ゚)],
|
||||
゚Д゚ノ: ((゚ー゚ == 3) + '_')[゚ー゚]
|
||||
};
|
||||
(゚Д゚) [゚Θ゚] = ((゚ω゚ノ == 3) + '_') [c ^ _ ^ o];
|
||||
(゚Д゚) ['c'] = ((゚Д゚) + '_') [(゚ー゚) + (゚ー゚) - (゚Θ゚)];
|
||||
(゚Д゚) ['o'] = ((゚Д゚) + '_') [゚Θ゚];
|
||||
(゚o゚) = (゚Д゚) ['c'] + (゚Д゚) ['o'] + (゚ω゚ノ + '_')[゚Θ゚] + ((゚ω゚ノ == 3) + '_') [゚ー゚] + ((゚Д゚) + '_') [(゚ー゚) + (゚ー゚)] + ((゚ー゚ == 3) + '_') [゚Θ゚] + ((゚ー゚ == 3) + '_') [(゚ー゚) - (゚Θ゚)] + (゚Д゚) ['c'] + ((゚Д゚) + '_') [(゚ー゚) + (゚ー゚)] + (゚Д゚) ['o'] + ((゚ー゚ == 3) + '_') [゚Θ゚];
|
||||
(゚Д゚) ['_'] = (o ^ _ ^ o) [゚o゚] [゚o゚];
|
||||
(゚ε゚) = ((゚ー゚ == 3) + '_') [゚Θ゚] + (゚Д゚).゚Д゚ノ + ((゚Д゚) + '_') [(゚ー゚) + (゚ー゚)] + ((゚ー゚ == 3) + '_') [o ^ _ ^ o - ゚Θ゚] + ((゚ー゚ == 3) + '_') [゚Θ゚] + (゚ω゚ノ + '_') [゚Θ゚];
|
||||
(゚ー゚) += (゚Θ゚);
|
||||
(゚Д゚)[゚ε゚] = '\\';
|
||||
(゚Д゚).゚Θ゚ノ = (゚Д゚ + ゚ー゚)[o ^ _ ^ o - (゚Θ゚)];
|
||||
(o゚ー゚o) = (゚ω゚ノ + '_')[c ^ _ ^ o];
|
||||
(゚Д゚) [゚o゚] = '\"';
|
||||
|
||||
console.log((゚Д゚));
|
460
yemu_js/9.7.js
Normal file
460
yemu_js/9.7.js
Normal file
File diff suppressed because one or more lines are too long
39
yemu_js/9.js
Normal file
39
yemu_js/9.js
Normal file
@ -0,0 +1,39 @@
|
||||
// 发出 xhr 和 ajxa 请求的两种的方式
|
||||
// 逆向过程中通常需要找参数构造或者请求发送的地方
|
||||
// 看懂语法有助于逆向
|
||||
|
||||
|
||||
// ajax
|
||||
// $.ajax({
|
||||
// // 构造请求头
|
||||
// url: loginUrl + "?uuid=" + uuid + "&" + location.search.substring(1) + "&r=" + Math.random()
|
||||
// type: "POST",
|
||||
// dataType: "text",
|
||||
// contentType: "application/x-www-from-urlencoded; charset=urf-8",
|
||||
// data: {
|
||||
// //构造请求正文
|
||||
// uuid:$('#uuid').val(),
|
||||
// eid:$('#eid').val(),
|
||||
// },
|
||||
// error: function () {
|
||||
// // 错误的触发
|
||||
// },
|
||||
// success: function (result) {
|
||||
// // 成功返回响应正文时触发
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
// XHR
|
||||
function SendXHR() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', 'http://www.sfhfpc.com/index.html?p=123');
|
||||
xhr.send(null);
|
||||
xhr.onreadystatechange = function () {
|
||||
if(xhr.readyState == 4){
|
||||
console.log(xhr.responseText)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SendXHR();
|
150
yemu_js/md5.js
Normal file
150
yemu_js/md5.js
Normal file
@ -0,0 +1,150 @@
|
||||
"use strict";
|
||||
|
||||
function t(t) {
|
||||
t ? (f[0] = f[16] = f[1] = f[2] = f[3] = f[4] = f[5] = f[6] = f[7] = f[8] = f[9] = f[10] = f[11] = f[12] = f[13] =
|
||||
f[14] = f[15] = 0, this.blocks = f) : this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||
this.h0 = 1732584193, this.h1 = 4023233417, this.h2 = 2562383102, this.h3 = 271733878, this.h4 = 3285377520,
|
||||
this.block = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = !1, this.first = !0
|
||||
}
|
||||
|
||||
var h = "object" == typeof window ? window : {},
|
||||
s = !h.JS_SHA1_NO_NODE_JS && "object" == typeof process && process.versions && process.versions.node;
|
||||
s && (h = global);
|
||||
var i = !h.JS_SHA1_NO_COMMON_JS && "object" == typeof module && module.exports,
|
||||
e = "function" == typeof define && define.amd,
|
||||
r = "0123456789abcdef".split(""),
|
||||
o = [-2147483648, 8388608, 32768, 128],
|
||||
n = [24, 16, 8, 0],
|
||||
a = ["hex", "array", "digest", "arrayBuffer"],
|
||||
f = [],
|
||||
u = function (h) {
|
||||
return function (s) {
|
||||
return new t(!0).update(s)[h]()
|
||||
}
|
||||
},
|
||||
c = function () {
|
||||
var h = u("hex");
|
||||
s && (h = p(h)), h.create = function () {
|
||||
return new t
|
||||
}, h.update = function (t) {
|
||||
return h.create().update(t)
|
||||
};
|
||||
for (var i = 0; i < a.length; ++i) {
|
||||
var e = a[i];
|
||||
h[e] = u(e)
|
||||
}
|
||||
return h
|
||||
},
|
||||
p = function (t) {
|
||||
var h = eval("require('crypto')"),
|
||||
s = eval("require('buffer').Buffer"),
|
||||
i = function (i) {
|
||||
if ("string" == typeof i) return h.createHash("sha1").update(i, "utf8").digest("hex");
|
||||
if (i.constructor === ArrayBuffer) i = new Uint8Array(i);
|
||||
else if (void 0 === i.length) return t(i);
|
||||
return h.createHash("sha1").update(new s(i)).digest("hex")
|
||||
};
|
||||
return i
|
||||
};
|
||||
t.prototype.update = function (t) {
|
||||
if (!this.finalized) {
|
||||
var s = "string" != typeof t;
|
||||
s && t.constructor === h.ArrayBuffer && (t = new Uint8Array(t));
|
||||
for (var i, e, r = 0, o = t.length || 0, a = this.blocks; r < o;) {
|
||||
if (this.hashed && (this.hashed = !1, a[0] = this.block, a[16] = a[1] = a[2] = a[3] = a[4] = a[5] =
|
||||
a[6] = a[7] = a[8] = a[9] = a[10] = a[11] = a[12] = a[13] = a[14] = a[15] = 0), s)
|
||||
for (e = this.start; r < o && e < 64; ++r) a[e >> 2] |= t[r] << n[3 & e++];
|
||||
else
|
||||
for (e = this.start; r < o && e < 64; ++r) (i = t.charCodeAt(r)) < 128 ? a[e >> 2] |= i << n[3 &
|
||||
e++] : i < 2048 ? (a[e >> 2] |= (192 | i >> 6) << n[3 & e++], a[e >> 2] |= (128 | 63 &
|
||||
i) << n[3 & e++]) : i < 55296 || i >= 57344 ? (a[e >> 2] |= (224 | i >> 12) << n[3 & e++],
|
||||
a[e >> 2] |= (128 | i >> 6 & 63) << n[3 & e++], a[e >> 2] |= (128 | 63 & i) << n[3 & e++]
|
||||
) : (i = 65536 + ((1023 & i) << 10 | 1023 & t.charCodeAt(++r)), a[e >> 2] |= (240 | i >> 18) <<
|
||||
n[3 & e++], a[e >> 2] |= (128 | i >> 12 & 63) << n[3 & e++], a[e >> 2] |= (128 | i >> 6 &
|
||||
63) << n[3 & e++], a[e >> 2] |= (128 | 63 & i) << n[3 & e++]);
|
||||
this.lastByteIndex = e, this.bytes += e - this.start, e >= 64 ? (this.block = a[16], this.start = e -
|
||||
64, this.hash(), this.hashed = !0) : this.start = e
|
||||
}
|
||||
return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes %
|
||||
4294967296), this
|
||||
}
|
||||
}, t.prototype.finalize = function () {
|
||||
if (!this.finalized) {
|
||||
this.finalized = !0;
|
||||
var t = this.blocks,
|
||||
h = this.lastByteIndex;
|
||||
t[16] = this.block, t[h >> 2] |= o[3 & h], this.block = t[16], h >= 56 && (this.hashed || this.hash(),
|
||||
t[0] = this.block, t[16] = t[1] = t[2] = t[3] = t[4] = t[5] = t[6] = t[7] = t[8] = t[9] = t[10] =
|
||||
t[11] = t[12] = t[13] = t[14] = t[15] = 0), t[14] = this.hBytes << 3 | this.bytes >>> 29, t[15] =
|
||||
this.bytes << 3, this.hash()
|
||||
}
|
||||
}, t.prototype.hash = function () {
|
||||
var t, h, s = this.h0,
|
||||
i = this.h1,
|
||||
e = this.h2,
|
||||
r = this.h3,
|
||||
o = this.h4,
|
||||
n = this.blocks;
|
||||
for (t = 16; t < 80; ++t) h = n[t - 3] ^ n[t - 8] ^ n[t - 14] ^ n[t - 16], n[t] = h << 1 | h >>> 31;
|
||||
for (t = 0; t < 20; t += 5) s = (h = (i = (h = (e = (h = (r = (h = (o = (h = s << 5 | s >>> 27) + (i & e |
|
||||
~i & r) + o + 1518500249 + n[t] << 0) << 5 | o >>> 27) + (s & (i = i << 30 |
|
||||
i >>> 2) | ~s & e) + r + 1518500249 + n[t + 1] << 0) << 5 | r >>> 27) + (o & (s = s <<
|
||||
30 | s >>> 2) | ~o & i) + e + 1518500249 + n[t + 2] << 0) << 5 | e >>> 27) + (r & (o = o <<
|
||||
30 | o >>> 2) | ~r & s) + i + 1518500249 + n[t + 3] << 0) << 5 | i >>> 27) + (e & (r = r << 30 | r >>>
|
||||
2) | ~e & o) + s + 1518500249 + n[t + 4] << 0, e = e << 30 | e >>> 2;
|
||||
for (; t < 40; t += 5) s = (h = (i = (h = (e = (h = (r = (h = (o = (h = s << 5 | s >>> 27) + (i ^ e ^ r) +
|
||||
o + 1859775393 + n[t] << 0) << 5 | o >>> 27) + (s ^ (i = i << 30 | i >>> 2) ^
|
||||
e) + r + 1859775393 + n[t + 1] << 0) << 5 | r >>> 27) + (o ^ (s = s << 30 | s >>>
|
||||
2) ^ i) + e + 1859775393 + n[t + 2] << 0) << 5 | e >>> 27) + (r ^ (o = o << 30 | o >>> 2) ^
|
||||
s) + i + 1859775393 + n[t + 3] << 0) << 5 | i >>> 27) + (e ^ (r = r << 30 | r >>> 2) ^ o) + s +
|
||||
1859775393 + n[t + 4] << 0, e = e << 30 | e >>> 2;
|
||||
for (; t < 60; t += 5) s = (h = (i = (h = (e = (h = (r = (h = (o = (h = s << 5 | s >>> 27) + (i & e | i & r |
|
||||
e & r) + o - 1894007588 + n[t] << 0) << 5 | o >>> 27) + (s & (i = i << 30 |
|
||||
i >>> 2) | s & e | i & e) + r - 1894007588 + n[t + 1] << 0) << 5 | r >>> 27) + (o &
|
||||
(s = s << 30 | s >>> 2) | o & i | s & i) + e - 1894007588 + n[t + 2] << 0) << 5 | e >>>
|
||||
27) + (r & (o = o << 30 | o >>> 2) | r & s | o & s) + i - 1894007588 + n[t + 3] << 0) << 5 | i >>>
|
||||
27) + (e & (r = r << 30 | r >>> 2) | e & o | r & o) + s - 1894007588 + n[t + 4] << 0, e = e << 30 |
|
||||
e >>> 2;
|
||||
for (; t < 80; t += 5) s = (h = (i = (h = (e = (h = (r = (h = (o = (h = s << 5 | s >>> 27) + (i ^ e ^ r) +
|
||||
o - 899497514 + n[t] << 0) << 5 | o >>> 27) + (s ^ (i = i << 30 | i >>> 2) ^
|
||||
e) + r - 899497514 + n[t + 1] << 0) << 5 | r >>> 27) + (o ^ (s = s << 30 | s >>> 2) ^
|
||||
i) + e - 899497514 + n[t + 2] << 0) << 5 | e >>> 27) + (r ^ (o = o << 30 | o >>> 2) ^ s) +
|
||||
i - 899497514 + n[t + 3] << 0) << 5 | i >>> 27) + (e ^ (r = r << 30 | r >>> 2) ^ o) + s - 899497514 +
|
||||
n[t + 4] << 0, e = e << 30 | e >>> 2;
|
||||
this.h0 = this.h0 + s << 0, this.h1 = this.h1 + i << 0, this.h2 = this.h2 + e << 0, this.h3 = this.h3 + r <<
|
||||
0, this.h4 = this.h4 + o << 0
|
||||
}, t.prototype.hex = function () {
|
||||
this.finalize();
|
||||
var t = this.h0,
|
||||
h = this.h1,
|
||||
s = this.h2,
|
||||
i = this.h3,
|
||||
e = this.h4;
|
||||
return r[t >> 28 & 15] + r[t >> 24 & 15] + r[t >> 20 & 15] + r[t >> 16 & 15] + r[t >> 12 & 15] + r[t >> 8 &
|
||||
15] + r[t >> 4 & 15] + r[15 & t] + r[h >> 28 & 15] + r[h >> 24 & 15] + r[h >> 20 & 15] + r[h >> 16 &
|
||||
15] + r[h >> 12 & 15] + r[h >> 8 & 15] + r[h >> 4 & 15] + r[15 & h] + r[s >> 28 & 15] + r[s >> 24 &
|
||||
15] + r[s >> 20 & 15] + r[s >> 16 & 15] + r[s >> 12 & 15] + r[s >> 8 & 15] + r[s >> 4 & 15] + r[15 &
|
||||
s] + r[i >> 28 & 15] + r[i >> 24 & 15] + r[i >> 20 & 15] + r[i >> 16 & 15] + r[i >> 12 & 15] + r[i >>
|
||||
8 & 15] + r[i >> 4 & 15] + r[15 & i] + r[e >> 28 & 15] + r[e >> 24 & 15] + r[e >> 20 & 15] + r[e >>
|
||||
16 & 15] + r[e >> 12 & 15] + r[e >> 8 & 15] + r[e >> 4 & 15] + r[15 & e]
|
||||
}, t.prototype.toString = t.prototype.hex, t.prototype.digest = function () {
|
||||
this.finalize();
|
||||
var t = this.h0,
|
||||
h = this.h1,
|
||||
s = this.h2,
|
||||
i = this.h3,
|
||||
e = this.h4;
|
||||
return [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, 255 & t, h >> 24 & 255, h >> 16 & 255, h >> 8 & 255,
|
||||
255 & h, s >> 24 & 255, s >> 16 & 255, s >> 8 & 255, 255 & s, i >> 24 & 255, i >> 16 & 255, i >> 8 &
|
||||
255, 255 & i, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, 255 & e]
|
||||
}, t.prototype.array = t.prototype.digest, t.prototype.arrayBuffer = function () {
|
||||
this.finalize();
|
||||
var t = new ArrayBuffer(20),
|
||||
h = new DataView(t);
|
||||
return h.setUint32(0, this.h0), h.setUint32(4, this.h1), h.setUint32(8, this.h2), h.setUint32(12, this.h3),
|
||||
h.setUint32(16, this.h4), t
|
||||
};
|
||||
var y = c();
|
||||
i ? module.exports = y : (h.md5 = y, e && define(function () {
|
||||
return y
|
||||
}));
|
0
yemu_js/一种常见于CDN和WAF的反爬操作.js
Normal file
0
yemu_js/一种常见于CDN和WAF的反爬操作.js
Normal file
505
yemu_js/使用多种混淆对Javascript 代码进行保护.js
Normal file
505
yemu_js/使用多种混淆对Javascript 代码进行保护.js
Normal file
File diff suppressed because one or more lines are too long
158
yemu_js/使用颜文字对 Javascript 代码进行混淆.js
Normal file
158
yemu_js/使用颜文字对 Javascript 代码进行混淆.js
Normal file
@ -0,0 +1,158 @@
|
||||
const request = require('request');
|
||||
const md5 = require('./md5');
|
||||
|
||||
function Base64() {
|
||||
// private property
|
||||
_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
// public method for encoding
|
||||
this.encode = function (input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
input = _utf8_encode(input);
|
||||
while (i < input.length) {
|
||||
chr1 = input.charCodeAt(i++);
|
||||
chr2 = input.charCodeAt(i++);
|
||||
chr3 = input.charCodeAt(i++);
|
||||
enc1 = chr1 >> 2;
|
||||
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
||||
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
||||
enc4 = chr3 & 63;
|
||||
if (isNaN(chr2)) {
|
||||
enc3 = enc4 = 64;
|
||||
} else if (isNaN(chr3)) {
|
||||
enc4 = 64;
|
||||
}
|
||||
output = output +
|
||||
_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
|
||||
_keyStr.charAt(enc3) + _keyStr.charAt(enc4);
|
||||
}
|
||||
return output;
|
||||
};
|
||||
|
||||
// public method for decoding
|
||||
this.decode = function (input) {
|
||||
var output = "";
|
||||
var chr1, chr2, chr3;
|
||||
var enc1, enc2, enc3, enc4;
|
||||
var i = 0;
|
||||
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||
while (i < input.length) {
|
||||
enc1 = _keyStr.indexOf(input.charAt(i++));
|
||||
enc2 = _keyStr.indexOf(input.charAt(i++));
|
||||
enc3 = _keyStr.indexOf(input.charAt(i++));
|
||||
enc4 = _keyStr.indexOf(input.charAt(i++));
|
||||
chr1 = (enc1 << 2) | (enc2 >> 4);
|
||||
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
||||
chr3 = ((enc3 & 3) << 6) | enc4;
|
||||
output = output + String.fromCharCode(chr1);
|
||||
if (enc3 != 64) {
|
||||
output = output + String.fromCharCode(chr2);
|
||||
}
|
||||
if (enc4 != 64) {
|
||||
output = output + String.fromCharCode(chr3);
|
||||
}
|
||||
}
|
||||
output = _utf8_decode(output);
|
||||
return output;
|
||||
};
|
||||
|
||||
// private method for UTF-8 encoding
|
||||
_utf8_encode = function (string) {
|
||||
string = string.replace(/\r\n/g, "\n");
|
||||
var utftext = "";
|
||||
for (var n = 0; n < string.length; n++) {
|
||||
var c = string.charCodeAt(n);
|
||||
if (c < 128) {
|
||||
utftext += String.fromCharCode(c);
|
||||
} else if ((c > 127) && (c < 2048)) {
|
||||
utftext += String.fromCharCode((c >> 6) | 192);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
} else {
|
||||
utftext += String.fromCharCode((c >> 12) | 224);
|
||||
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
||||
utftext += String.fromCharCode((c & 63) | 128);
|
||||
}
|
||||
|
||||
}
|
||||
return utftext;
|
||||
};
|
||||
|
||||
// private method for UTF-8 decoding
|
||||
_utf8_decode = function (utftext) {
|
||||
var string = "";
|
||||
var i = 0;
|
||||
var c = c1 = c2 = 0;
|
||||
while (i < utftext.length) {
|
||||
c = utftext.charCodeAt(i);
|
||||
if (c < 128) {
|
||||
string += String.fromCharCode(c);
|
||||
i++;
|
||||
} else if ((c > 191) && (c < 224)) {
|
||||
c2 = utftext.charCodeAt(i + 1);
|
||||
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
||||
i += 2;
|
||||
} else {
|
||||
c2 = utftext.charCodeAt(i + 1);
|
||||
c3 = utftext.charCodeAt(i + 2);
|
||||
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
||||
i += 3;
|
||||
}
|
||||
}
|
||||
return string;
|
||||
};
|
||||
};
|
||||
|
||||
function uuid() {
|
||||
var s = [];
|
||||
var hexDigits = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
for (var i = 0; i < 36; i++) {
|
||||
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
||||
}
|
||||
s[14] = "4";
|
||||
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
|
||||
s[8] = s[13] = s[18] = s[23] = "-";
|
||||
var uuid = s.join("");
|
||||
return uuid;
|
||||
}
|
||||
|
||||
function getparam() {
|
||||
"use strict";
|
||||
let base64 = new Base64();
|
||||
let key = uuid();
|
||||
let time = (Math.floor((new Date().getTime() + 10010) / 99)).toString();
|
||||
let sign = md5(key + base64.encode(time));
|
||||
let param = {
|
||||
"key": key,
|
||||
"time": time,
|
||||
"sign": sign
|
||||
};
|
||||
return param
|
||||
};
|
||||
|
||||
a = getparam();
|
||||
console.log(a);
|
||||
console.log("----------------------------------------------------");
|
||||
|
||||
request({
|
||||
timeout: 5000,
|
||||
method: 'GET',
|
||||
url: 'http://js-crack-course-9-1.crawler-lab.com/detail/5794?',
|
||||
qs: {
|
||||
key: a.key,
|
||||
time: a.time,
|
||||
sign: a.sign
|
||||
},
|
||||
headers: {
|
||||
'Cookie': '__cfduid=d8880dad64ce892775f986eeafec00d8d1610084455; __yjs_duid=1_3e52d7ad71479dc6823752e24475' +
|
||||
'7d001610088150639; crawlerlab_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTE2NTM4OTk' +
|
||||
'sImlkIjoxODE1LCJuYW1lIjoiMTgyNjIwMzE3MjUifQ.NZF3nxvjG3PF5rBlcItQzcZ9sqAH6-HSfNHKLwskEgA'
|
||||
}
|
||||
|
||||
}, function (error, response, body) {
|
||||
if (!error && response.statusCode == 200) {
|
||||
console.log(body);
|
||||
} else {
|
||||
console.log("error");
|
||||
}
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user