热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

微信防撤回补丁脚本

之前用od手动patch的微信防撤回补丁,自从微信更新后,就失效了!这次写了个python脚本,一键patch,

之前用od手动patch的微信防撤回补丁,自从微信更新后,就失效了!这次写了个python脚本,一键patch,再也不怕微信更新了!

特征码:

8B 06 8B CE FF 50 18 85 C0 0F 84 31 FF FF FF 68 ?? ?? ?? ?? 8B C8 E8 1F AC 58 00 8B F0 85 F6 0F 84 1B FF FF FF 68 ?? ?? ?? ?? 8B CE E8 09 AC 58 00 85 C0 74 7B 8B C8 E8 8E B4 58 00 85 C0 75 62 0F 10 05 ?? ?? ?? ?? 83 EC 10

由于其中一个参数是重定位的全局变量,所以需要在patch代码里加上 add esp, 4
patch后:
在这里插入图片描述

使用下面py脚本,会生成一个WeChatWin_patched.dll版本,将这个文件改名并替换微信安装目录下的WeChatWin.dll即可:

# -*- coding: utf-8 -*-# crucial opcode in WeChatWin.dll
crucial_opcode = b"\x8B\x06\x8B\xCE\xFF\x50\x18\x85\xC0\x0F\x84\x31\xFF\xFF\xFF\x68"
patch_opcode = b"\x83\xC4\x04\x90\x90\x90\x90"# main
if __name__ == "__main__":with open("WeChatWin.dll", "rb") as fs:byte_buf = bytes(fs.read())position = byte_buf.find(crucial_opcode)if position == -1:print "[-] can not find crucial code in WeChatWin.dll"else:print "[+] find the crucial code offset at {}".format(hex(position))precise_pos = position + len(crucial_opcode) + 4print "[+] after adjusting offset of crucial code {}".format(hex(precise_pos))print "[+] modifying crucial code with {} NOP's".format(len(patch_opcode))print "[+] generating patched file named WeChatWin_patched.dll"with open("WeChatWin_patched.dll", "wb") as wfs:wfs.write(byte_buf[0:precise_pos])wfs.write(patch_opcode)wfs.write(byte_buf[precise_pos + len(patch_opcode):])wfs.close()print "[+] Please rename the patched file according to WeChatWin.dll in WeChat installation directory"fs.close()

推荐阅读
author-avatar
maggieting0334_990
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有