[逆向工具] 详解pbtk解析steam中的protobuf协议

导读:
Protobuf 是由 Google 开发的一种序列化格式,并在越来越多的 Android、Web、桌面和更多应用程序中使用。
在逆向工作中的,protobuf逆向的重要性也越来越多的体现来。
今天就跟大家一起使用pbtk神器,对steam平台协议,进行简单的分析。
pbtk的github地址:https://github.com/marin-m/pbtk
小编克隆岛gitee地址,方便国内用户下载:https://gitee.com/yeahmao/tools_reverse__pbtk
gitee项目中还将持续上传一些爬取到的proto代码。

环境搭建

准备个空的python虚拟环境:J:\_ALL\CODE\venv\py386_everything\Scripts

REM 下载代码
cd /d J:\_ALL\CODE\gitee\yeahmao\
git clone https://gitee.com/yeahmao/tools_reverse__pbtk
cd tools_reverse__pbtk


REM python环境准备(记得设置阿里云镜像)
J:\_ALL\CODE\venv\py386_everything\Scripts\activate.bat
pip3 install protobuf pyqt5 pyqtwebengine requests websocket-client
REM 测试环境是否搭建成功,出现如下图片,即表示环境搭建成功了
python gui.py

在这里插入图片描述

确认proto所在模块

启动steam,通过CheatEngine搜索steam进程内存,如下图:

在这里插入图片描述
选中绿色结果,右键(或者ctrl+B)浏览内存区域,确认内存内容和内存所在模块。
在这里插入图片描述
在这里插入图片描述
通过上述方法,我们可以判断出以下模块包含proto信息:

  • steam.exe
  • steamclient.dll
  • steamui.dll
  • steamservice.dll

工具使用

这里我们使用from_binary.py直接解析可执行文件就能拿到proto原始文件了。

对于一些vmp加壳的可执行程序,我们需要通过第三方工具dump下内存,然后再执行from_binary.py

python ./extractors/from_binary.py "G:\Program Files (x86)\Steam\steam.exe" _proto\steam\steam.exe
python ./extractors/from_binary.py "G:\Program Files (x86)\Steam\steamclient.dll" _proto\steam\steamclient.dll
python ./extractors/from_binary.py "G:\Program Files (x86)\Steam\steamui.dll" _proto\steam\steamui.dll
python ./extractors/from_binary.py "G:\Program Files (x86)\Steam\bin\steamservice.dll" _proto\steam\steamservice.dll

参考资料

  • qq群:夜猫逐梦技术交流裙/953949723
    逐梦中原技术交流QQ群

**ps:**文章中内容仅用于技术交流,请勿用于违规违法行为。

猜你喜欢

转载自blog.csdn.net/kinghzking/article/details/122359830