js船讯 逆向

本文探讨了如何对船讯网的JavaScript代码进行逆向工程,以揭示其背后的运行机制。通过分析JS代码,可以理解网页动态加载和数据获取的方法,为网络爬虫或自动化工具提供可能的实现路径。
摘要由CSDN通过智能技术生成

船讯网js

// document.write("<script language='javascript' src='ElaneMap.min.js'></script>");
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
// function decode64(_0x2973a6) {
   
//     var _0x49a411, _0x167b3a, _0x2efdd7, _0x2e6c4d, _0x40f3f9, _0x2662ad = '', _0x5113de = '', _0x2808cc = '', _0x491336 = 0x0;
//     do {
   
//         _0x2efdd7 = keyStr['indexOf'](_0x2973a6[_0x431e('0x1043')](_0x491336++)),
//         _0x2e6c4d = keyStr[_0x431e('0x1b8')](_0x2973a6['charAt'](_0x491336++)),
//         _0x40f3f9 = keyStr[_0x431e('0x1b8')](_0x2973a6[_0x431e('0x1043')](_0x491336++)),
//         _0x2808cc = keyStr[_0x431e('0x1b8')](_0x2973a6[_0x431e('0x1043')](_0x491336++)),
//         _0x49a411 = _0x2efdd7 << 0x2 | _0x2e6c4d >> 0x4,
//         _0x167b3a = (0xf & _0x2e6c4d) << 0x4 | _0x40f3f9 >> 0x2,
//         _0x5113de = (0x3 & _0x40f3f9) << 0x6 | _0x2808cc,
//         _0x2662ad += String['fromCharCode'](_0x49a411), 0x40 != _0x40f3f9 && (_0x2662ad += String[_0x431e('0x9')](_0x167b3a)), 0x40 != _0x2808cc && (_0x2662ad += String[_0x431e('0x9')](_0x5113de)),
//         _0x49a411 = _0x167b3a = _0x5113de = '',
//         _0x2efdd7 = _0x2e6c4d = _0x40f3f9 = _0x2808cc = '';
//     } while (_0x491336 < _0x2973a6[_0x431e('0xbf1')]);return _0x2662ad;
// }
function decode64(_0x3c74bc) {
   
    var _0x449637,
        _0x492ea8,
        _0x55ef96,
        _0x265e41,
        _0x870723,
        _0x2dbb70 = '',
        _0x3c80d2 = '',
        _0x48efc6 = '',
        _0x23c340 = 0x0;

    do {
   
        _0x55ef96 = keyStr["indexOf"](_0x3c74bc["charAt"](_0x23c340++)),
            _0x265e41 = keyStr["indexOf"](_0x3c74bc["charAt"](_0x23c340++)),
            _0x870723 = keyStr['indexOf'](_0x3c74bc["charAt"](_0x23c340++)),
            _0x48efc6 = keyStr["indexOf"](_0x3c74bc["charAt"](_0x23c340++)),
            _0x449637 = _0x55ef96 << 0x2 | _0x265e41 >> 0x4,
            _0x492ea8 = (0xf & _0x265e41) << 0x4 | _0x870723 >> 0x2,
            _0x3c80d2 = (0x3 & _0x870723) << 0x6 | _0x48efc6,
            _0x2dbb70 += String["fromCharCode"](_0x449637),
        0x40 != _0x870723 && (_0x2dbb70 += String["fromCharCode"](_0x492ea8)),
        0x40 != _0x48efc6 && (_0x2dbb70 += String["fromCharCode"](_0x3c80d2)),
            _0x449637 = _0x492ea8 = _0x3c80d2 = '',
            _0x55ef96 = _0x265e41 = _0x870723 = _0x48efc6 = '';
    } while (_0x23c340 < _0x3c74bc["length"]);

    return _0x2dbb70;
}
a3d = {
   };
Class = function () {
   };
Class["extend"] = function (_0x5a9fc6) {
   
    function _0x2afe92() {
   
        !_0x2c09f8 && this["init"] && this["init"]["apply"](this, arguments);
    }

    var _0x96fb11 = this["prototype"];
    _0x2c09f8 = !0x0;

    var _0x168520 = new this();

    _0x2c09f8 = !0x1;

    for (var _0x319388 in _0x5a9fc6) _0x168520[_0x319388] = 'function' == typeof _0x5a9fc6[_0x319388] && "function" == typeof _0x96fb11[_0x319388] && _0x3348ad["test"](_0x5a9fc6[_0x319388]) ? function (_0x242784, _0x3a3cba) {
   
        return function () {
   
            var _0x4e83e3 = this["_super"];
            this['_super'] = _0x96fb11[_0x242784];

            var _0x2374c1 = _0x3a3cba['apply'](this, arguments);

            return this["_super"] = _0x4e83e3, _0x2374c1;
        };
    }(_0x319388, _0x5a9fc6[_0x319388]) : _0x5a9fc6[_0x319388];

    return _0x2afe92["prototype"] = _0x168520, _0x2afe92['constructor'] = _0x2afe92, _0x2afe92["extend"] = arguments["callee"], _0x2afe92;
};
a3d["Endian"] = {
   
    'BIG': 0x0,
    'LITTLE': 0x1
}, a3d["ByteArray"] = Class["extend"]({
   
        'data': '',
        'length': 0x0,
        'pos': 0x0,
        'pow': Math["pow"],
        'endian': a3d["Endian"]["BIG"],
        'TWOeN23': Math['pow'](0x2, -0x17),
        'TWOeN52': Math["pow"](0x2, -0x34),
        'init': function (_0xc574c1, _0x32eea2) {
   
            this['data'] = void 0x0 !== _0xc574c1 ? _0xc574c1 : '',
            void 0x0 !== _0x32eea2 && (this['endian'] = _0x32eea2),
                this["length"] = _0xc574c1['length'];

            var _0x1cf77a = _0x32eea2 == a3d["Endian"]['BIG'] ? 'BE' : 'LE',
                _0xe2f8f7 = ["readInt32", 'readInt16', 'readUInt32', 'readUInt16', "readFloat32", "readFloat64"];

            for (var _0x2f914f in _0xe2f8f7) this[_0xe2f8f7[_0x2f914f]] = this[_0xe2f8f7[_0x2f914f] + _0x1cf77a];

            var _0x1ef00e = {
   
                'readUnsignedByte': "readByte",
                'readUnsignedInt': "readUInt32",
                'readFloat': 'readFloat32',
                'readDouble': "readFloat64",
                'readShort': "readInt16",
                'readBoolean': "readBool",
                'readInt': 'readInt32'
            };

            for (var _0x2f914f in _0x1ef00e) this[_0x2f914f] = this[_0x1ef00e[_0x2f914f]];
        },
        'readByte': function () {
   
            return 0xff & this["data"]["charCodeAt"](this["pos"]++);
        },
        'readBool': function () {
   
            return !!(0xff & this["data"]["charCodeAt"](this["pos"]++));
        },
        'readUInt32BE': function () {
   
            var _0x5c587c = this["data"],
                _0x2eee75 = (this['pos'] += 0x4) - 0x4;

            return (0xff & _0x5c587c["charCodeAt"](_0x2eee75)) << 0x18 | (0xff & _0x5c587c["charCodeAt"](++_0x2eee75)) << 0x10 | (0xff & _0x5c587c["charCodeAt"](++_0x2eee75)) << 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值