吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 6290|回复: 45
收起左侧

[Unpackers] VMProtect 3.x IAT Fix

  [复制链接]
风吹屁屁凉 发表于 2022-7-26 16:06

VMProtect 3.x IAT Fix

This Program is a dynamic x86/x64 VMProtect 3.x import fixer(Tested on VMP3.3). The main goal of this project was to build correct and reliable tool to fix imports in x86/x64 applications.

Note: this tool can dump and rebuild import directory.

​          Fix 32bit program,please use 32bit version,vice versa.

Before

image-20220716105829428

After

image-20220716105855534

new IAT:

image-20220716110043838

Compile

VS2019

Usage

image-20220723214955839

-p:target process pid

-s:This tool first search call IAT address in sections,-s option specify ignore  sections default [.vmp0,.vmp1,.vmp2]

-i:specify the section that is used to storage IAT in memory,if you don't  specify this option, this tool default will use VirtualAlloc alloc memory that is used to store IAT content

-d:dump file and rebuild import table

Tips:VMProtect unpacking must be complete before running this tool,

Example:

when target program is reach to OEP

image-20220716111549696

execute this tool

.\vmp3-import-fix.exe -p 31652

if you want dump and rebuild import table

.\vmp3-import-fix.exe -p 31652 -d

if you want dump,rebuild import table and fix new iat in .vmp0 section

.\vmp3-import-fix.exe -p 31652 -d -i ".vmp0"

below is dump and fix import table result for ida.vmp.exe

image-20220723215541893

new IAT section in the last section

image-20220723215557934

you can see log  file in log/logger.txt

image-20220716111801572

image-20220716111829226

VMProtect Encrypt IAT detail

VMProtect encrypt IAT through 3 modes

  1. call ret or call int3 or call 0xXX
  2. push call
  3. pop call

Call Ret mode

original code:

.text:0040D87E 50                              push   eax       *; hFile*

.text:0040D87F FF 15 1C C1 45 00               call   ds:FlushFileBuffers

.text:0040D885 85 C0                            test   eax, eax

encdrypt IAT

0040D87E | 50                         | push eax                                                   |
0040D87F | E8 47890B00                | call test1_vmp.4C61CB                                      |
0040D884 | C3                         | ret                                                        |
0040D885 | 85C0                       | test eax,eax                                               |

at address 0x0040D87F,code call   ds:FlushFileBuffers has changed to call test1_vmp.4C61CB ;ret

we follow encrypt IAT code,below code analyze process that VMProtect decrypt API Address

004C61CC | 55                         | push ebp                                                   |保存ebp
004C61CD | 0FCD                       | bswap ebp                                                  |
004C61CF | 66:8BE9                    | mov bp,cx                                                  |
004C61D2 | 66:BD F53D                 | mov bp,3DF5                                                |
004C61D6 | 8B6C24 04                  | mov ebp,dword ptr ss:[esp+4]                               |ebp=call返回地址
0048718D | 8D6D 01                    | lea ebp,dword ptr ss:[ebp+1]                               |ebp=call返回地址+1
0056A3E4 | 896C24 04                  | mov dword ptr ss:[esp+4],ebp                               |[esp+4]=call返回地址+1
0056A3E8 | 66:0F47EB                  | cmova bp,bx                                                |
0056A3EC | 0FBFED                     | movsx ebp,bp                                               |
0056A3EF | BD E6224000                | mov ebp,test1_vmp.4022E6                                   |
004B2DCA | 8BAD 432F0800              | mov ebp,dword ptr ss:[ebp+82F43]                           |
004BF11F | 8DAD C713DE73              | lea ebp,dword ptr ss:[ebp+73DE13C7]                        |
004F561B | 872C24                     | xchg dword ptr ss:[esp],ebp                                |恢复ebp,esp[0]=api地址
                                        ret                                                         |ret返回到Api

Push Call  mode

original code

.text:004099DF 56                                                           push    esi
.text:004099E0 8B 35 0C C0 45 00                                            mov     esi,ds:InitializeCriticalSection
.text:004099E6 FF 35 A4 41 41 00                                            push    lpCriticalSection ; lpCriticalSection

encrypt IAT call

004099DF | 56                         | push esi                                                   |
004099E0 | 53                         | push ebx                                                   |
004099E1 | E8 299B1600                | call test1_vmp.57350F                                      |
004099E6 | FF35 A4414100              | push dword ptr ds:[4141A4]                                 | 004141A4:"@kA"

code mov     esi,ds:InitializeCriticalSection has changed to push ebx  call test1_vmp.57350F

Thanks

unicorn

BlackBone

vmpfix

Scylla

zydis

spdlog

Down

https://github.com/woxihuannisja/vmp3-import-fix

免费评分

参与人数 7吾爱币 +5 热心值 +7 收起 理由
笙若 + 1 + 1 谢谢@Thanks!
朝太阳奔跑 + 1 + 1 我很赞同!
835677429 + 1 + 1 我很赞同!
李佑辰 + 1 我很赞同!
loo1221ool + 1 + 1 我很赞同!
earmer + 1 + 1 谢谢@Thanks!
kingzswang + 1 谢谢@Thanks!

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

chishingchan 发表于 2022-7-26 16:11
好无奈!在中文论坛里看帖子还需要 右击 选择 翻译为中文(简体)!
chishingchan 发表于 2022-7-27 16:03
qwert0312 发表于 2022-7-27 09:07
虽然我也看不懂怎么的英文,但是我不支持你的说法。

不好意思!我应该以英语回复。
so helpless! To read the posts in the Chinese forum, you also need to right-click and select Translate to Chinese (Simplified)!
fangchang819 发表于 2022-7-26 16:44
qh00048484 发表于 2022-7-26 17:04
感谢分享!
头像被屏蔽
aiyikegu522 发表于 2022-7-26 17:55
提示: 作者被禁止或删除 内容自动屏蔽
夜泉 发表于 2022-7-26 18:12
Thank you very much, I have to learn English!!!
hackerbob 发表于 2022-7-26 19:10
Why do you write articles in English?
Are you a foreigner?
小生帝王 发表于 2022-7-26 19:49
大大牛逼
sam喵喵 发表于 2022-7-26 20:30
感谢分享,大佬们英文都这么牛吗
Cortex 发表于 2022-7-26 21:25
感谢大佬,学习到了
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-1 23:02

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表