599比分wasm逆向

声明

本文章中所有内容仅供学习交流使用,不用于其他任何目的,抓包 内容、敏感网址、数据接口等均已做脱敏处理,严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关!侵权通过头像私信或名字简介叫我删除博客谢谢。
部分python代码

复制代码
import asyncio

import execjs
import websockets
import json
import ssl
import time
from datetime import datetime
from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad
import base64



class FootballScoreClient:
    def __init__(self, ads_tracker_baidu):
        ads = ads_tracker_baidu
        ck = f'ads-tracker-baidu={ads}'
        self.url = "scorepush/football"
        self.headers = {
            'cookie':f'{ck}',
        }
        self.initial_message = {
        }
        self.websocket = None
        self.is_running = False

    async def connect(self):
        """建立WebSocket连接"""
        try:
            ssl_context = ssl.create_default_context()
            ssl_context.check_hostname = False
            ssl_context.verify_mode = ssl.CERT_NONE

            self.websocket = await websockets.connect(
                self.url,
                extra_headers=self.headers,
            )
            print(f"[{self._get_timestamp()}] 已连接到服务器")
            return True
        except Exception as e:
            print(f"[{self._get_timestamp()}] 连接失败: {e}")
            return False

    async def send_initial_message(self):
        """发送初始消息"""
        try:
            await self.websocket.send(json.dumps(self.initial_message))
            print(f"[{self._get_timestamp()}] 发送初始消息: {self.initial_message}")
        except Exception as e:
            print(f"[{self._get_timestamp()}] 发送消息失败: {e}")

    async def receive_messages(self):
        """接收消息循环"""
        try:
            async for message in self.websocket:
                print(f"[{self._get_timestamp()}] 收到消息: {message}")
                await self.handle_message(message)
        except websockets.exceptions.ConnectionClosed as e:
            print(f"[{self._get_timestamp()}] 连接关闭: {e}")
            self.is_running = False
        except Exception as e:
            print(f"[{self._get_timestamp()}] 接收消息错误: {e}")
            self.is_running = False

    async def handle_message(self, message):
        """处理接收到的消息"""
        try:
            data = decrypt_aes_cbc(message)
            # 在这里添加你的消息处理逻辑
            print(f"解析后的数据: {data}")
            pass
        except json.JSONDecodeError:
            print(f"无法解析消息: {message}")

    async def run(self, auto_reconnect=True):
        """主运行函数"""
        self.is_running = True

        while self.is_running:
            if await self.connect():
                await self.send_initial_message()
                await self.receive_messages()

            if auto_reconnect and self.is_running:
                print(f"[{self._get_timestamp()}] 5秒后重新连接...")
                await asyncio.sleep(5)
            else:
                break

    async def stop(self):
        """停止客户端"""
        self.is_running = False
        if self.websocket:
            await self.websocket.close()

    def _get_timestamp(self):
        """获取当前时间戳"""
        return datetime.now().strftime("%Y-%m-%d %H:%M:%S")


async def main():
    cp = execjs.compile(open('1.js', 'r', encoding='utf-8', errors='ignore').read())
    ads_tracker_baidu = cp.call('getAdsTrackerBaidu').split("ads-tracker-baidu=")[-1]
    print(ads_tracker_baidu)
    client = FootballScoreClient(ads_tracker_baidu)
    try:
        await client.run()
    except KeyboardInterrupt:
        print("\n正在关闭客户端...")
        await client.stop()


if __name__ == "__main__":
    asyncio.run(main())

结果

总结

1.出于安全考虑,本章未提供完整流程,调试环节省略较多,只提供大致思路,具体细节要你自己还原,相信你也能调试出来。

2.具体更多细节请看名字进入详情了解更多细节,具体细节要你自己还原,相信你也能调试出来。

相关推荐
我不会起名字32214 小时前
未接入最终读上限的参数:`websocketMaxMsgLen` 与 12.5 倍差距
后端·websocket·go·即时通讯·im·故障排查
刘马想放假3 天前
CANviz 使用指南|Linux 安装、DBC 解码、实时曲线与 J1939 实战
linux·python·websocket
张小姐的猫4 天前
【基于 WebSocket 的多用户网页五子棋】—— 项目结构设计与实用工具类模块
网络·websocket·网络协议
新*4 天前
从一段 WebSocket 代码聊开:bytes 不是 zlib、binaryType 决定一切,15MB 大消息的零拷贝优化
javascript·python·websocket·性能优化·blob·zlib·arraybuffer
️公子5 天前
可插拔 13 款实时棋牌对战平台实践:房间容器、Plugin SDK 与幂等账本
websocket·typescript·游戏开发·monorepo·插件架构·棋牌平台·实时对战
guizhoumen12 天前
net core下WebSocket请求总是断开的解决方案
网络·websocket·网络协议
QianhangQianping14 天前
WebSocket实时推送+ HTTP 定时轮询:一块大屏两套取数怎么不打架
前端·websocket·网络协议·http·低代码·架构·数据可视化
web打印社区15 天前
Lodop排障总纲-常见报错一张表
开发语言·前端·javascript·chrome·websocket
Da Da 泓15 天前
五子棋 Web 端测试用例报告
前端·网络·websocket·网络协议·测试用例·项目
web打印社区17 天前
Chrome-kiosk-printing能上生产吗
开发语言·前端·javascript·chrome·websocket