项目作者: ax330d

项目描述 :
MSHTML Patcher Script
高级语言: Python
项目地址: git://github.com/ax330d/mshtml-patcher.git
创建时间: 2014-08-16T14:36:01Z
项目社区:https://github.com/ax330d/mshtml-patcher

开源协议:MIT License

下载


Patch Script For mshtml.dll

This software is discontinued and not maintained anymore.

What for?

Microsoft introduced several mitigations in Internet Explorer, one of them is
ProtectedFree. This feature may be disturbing if you are doing fuzzing or
debugging. The purpose of this script is to patch mshtml.dll and optionally
either disable protection, or customize freed memory pattern. Be aware that this
script uses hard-coded values and may break your browser (unlikely however),
therefore, use it at your own risk. I also do not recommend to use Internet
Explorer for browsing after this patch.

How to use this script?

Script accepts following arguments:

  1. C:\Users\debug\Desktop>mshtml-patcher.py --help
  2. --------------------------------------------------------------------------------
  3. mshtml.dll Memory Protection Feature Patcher, v.0.2.0
  4. (Tested on Windows 7/8 x32/x64, IE9 - IE11 x32 bit versions)
  5. usage: mshtml-patcher.py [-h]
  6. (--patch-memset XX | --patch-disable | --restore | --print-info)
  7. [--path-to-dll-default PATH]
  8. [--path-to-dll-saved PATH] [--msver {9,10,11}]
  9. [--md5-hash MD5_HASH]
  10. optional arguments:
  11. -h, --help show this help message and exit
  12. --patch-memset XX patch memset
  13. --patch-disable disable protection
  14. --restore restore original file
  15. --print-info only print information
  16. --path-to-dll-default PATH
  17. override path to binary to patch
  18. --path-to-dll-saved PATH
  19. override path to original binary
  20. --msver {9,10,11} override major IE version
  21. --md5-hash MD5_HASH override md5 file hash

This script will automatically find Internet Explorer version and path to
mshtml.dll to patch. You can also specify them explicitly in arguments. Before
patching, script creates file backup named “original-mshtml.dll”.

—patch-memset XX

Will patch memset arguments in MemoryProtection::CMemoryProtector::ProtectedFree
so you can see some recognizable pattern instead of zeros. In place of XX put
some hex value.

—patch-disable

Disables Memory Protection mitigation.

—print-info

Print information about files.

—restore

Restore original (previously saved) dll file.

Script supports Internet Explorer version 9, 10, 11, only 32 bit binaries.
Tested on Windows 7/8.

Important

To use this script, you need to have rights to modify mshtml.dll.

Please be aware that after update you have to move original-mshtml.dll file
somewhere else, otherwise script will replace new mshtml.dll with older version.
The script will show versions of both files.

Example

  1. C:\Users\debug\Desktop>mshtml-patcher.py --patch-memset ba
  2. --------------------------------------------------------------------------------
  3. mshtml.dll Memory Protection Feature Patcher, v.0.2.0
  4. (Tested on Windows 7/8 x32/x64, IE9 - IE11 x32 bit versions)
  5. OS Version: Windows 7
  6. Path to mshtml.dll: C:\Windows\System32\mshtml.dll
  7. md5 hash: 61c74d794c14e9fc94d93f5f0f72a3f9
  8. version: [11, 0, 9600, 17631]
  9. Path to original-mshtml.dll: C:\Users\debug\Desktop\original-mshtml.dll
  10. md5 hash: 61c74d794c14e9fc94d93f5f0f72a3f9
  11. version: [11, 0, 9600, 17631]
  12. WARNING: patching mshtml.dll binary may break it!
  13. Do you wish to continue? (y/N)y
  14. Restoring original file... (copying from C:\Users\debug\Desktop\original-mshtml.dll to C:\Windows\System32\mshtml.dll) done.
  15. Will patch MemoryProtection::CMemoryProtector::ProtectedFree
  16. Before:
  17. +0x000735b4 d2 e0 08 04 1a 3b fe 72 dc 8b 7d 08 8b 5d f0 53
  18. +0x000735c4 6a 00 57 e8 19 8c fd ff 83 c4 0c 5e 5f 5b 8b e5
  19. +0x000735d4 5d c2 04 00 20 48 7d 63 70 13 71 63 90 13 71 63
  20. Patching mshtml.dll with 0xba... done.
  21. After:
  22. +0x000735b4 d2 e0 08 04 1a 3b fe 72 dc 8b 7d 08 8b 5d f0 53
  23. +0x000735c4 6a ba 57 e8 19 8c fd ff 83 c4 0c 5e 5f 5b 8b e5
  24. +0x000735d4 5d c2 04 00 20 48 7d 63 70 13 71 63 90 13 71 63