004010D7 ; ************** S U B R O U T I N E *****************************************
004010D7
004010D7 ; Attributes: thunk
004010D7
004010D7 VNop proc near
004010D7 jmp short InterpretingEntry
004010D7 VNop endp
00401203 ; ************** S U B R O U T I N E *****************************************
00401203
00401203 ; Attributes: bp-based frame
00401203
00401203 VDiv proc near
00401203
00401203 var_RegEdi = dword ptr -1Ch
00401203 var_RegEcx = dword ptr -18h
00401203 var_RegEsp = dword ptr -0Fh
00401203 var_RegEax = dword ptr -0Bh
00401203 var_SFlag = byte ptr -3
00401203 var_ZFlag = byte ptr -2
00401203
00401203 mov eax, [ebp+var_RegEax]
00401206 sub [ebp+var_RegEsp], 4
0040120A mov ebx, [ebp+var_RegEsp]
0040120D mov [ebp+var_RegEdi], ebx
00401210 mov ebx, [ebx]
00401212 mov [ebp+var_RegEcx], ebx
00401215 xor edx, edx
00401217 mov word ptr ds:loc_401220, 0F3F7h ; SMC
00401220
00401220 loc_401220:
00401220 xor eax, eax ; change to "div ebx"
00401222 mov [ebp+var_RegEcx], eax
00401225 setz [ebp+var_ZFlag] ; 根据计算结果置Z标志
00401229 sets [ebp+var_SFlag] ; 根据计算结果置S标志
0040122D push [ebp+var_RegEcx]
00401230 pop [ebp+var_RegEax]
00401233 mov eax, [ebp+var_RegEcx]
00401236 mov ebx, [ebp+var_RegEsp]
00401239 mov [ebx], eax
0040123B jmp InterpretingEntry
0040123B VDiv endp
A. VAnd,从虚拟机堆栈区弹出一个dword,与上一条指令的返回值中相“与”,结果保存在var_RegEax中
00401240 ; ************** S U B R O U T I N E *****************************************
00401240
00401240 ; Attributes: bp-based frame
00401240
00401240 VAnd proc near
00401240
00401240 var_RegEdi = dword ptr -1Ch
00401240 var_RegEcx = dword ptr -18h
00401240 var_RegEsp = dword ptr -0Fh
00401240 var_RegEax = dword ptr -0Bh
00401240
00401240 mov eax, [ebp+var_RegEax]
00401243 sub [ebp+var_RegEsp], 4
00401247 mov ebx, [ebp+var_RegEsp]
0040124A mov [ebp+var_RegEdi], ebx
0040124D mov edx, [ebx]
0040124F mov [ebp+var_RegEcx], edx
00401252 xchg eax, [ebp+var_RegEcx]
00401255 and [ebp+var_RegEcx], eax
00401258 push [ebp+var_RegEcx]
0040125B pop [ebp+var_RegEax]
0040125E mov eax, [ebp+var_RegEcx]
00401261 mov [ebx], eax
00401263 jmp InterpretingEntry
00401263 VAnd endp
B. VOr,从虚拟机堆栈区弹出一个dword,与上一条指令的返回值中相“或”,结果保存在var_RegEax中
00401268 ; ************** S U B R O U T I N E *****************************************
00401268
00401268 ; Attributes: bp-based frame
00401268
00401268 VOr proc near
00401268
00401268 var_RegEdi = dword ptr -1Ch
00401268 var_RegEcx = dword ptr -18h
00401268 var_RegEsp = dword ptr -0Fh
00401268 var_RegEax = dword ptr -0Bh
00401268
00401268 mov eax, [ebp+var_RegEax]
0040126B sub [ebp+var_RegEsp], 4
0040126F mov ebx, [ebp+var_RegEsp]
00401272 mov [ebp+var_RegEdi], ebx
00401275 mov edx, [ebx]
00401277 mov [ebp+var_RegEcx], edx
0040127A xchg eax, [ebp+var_RegEcx]
0040127D or [ebp+var_RegEcx], eax
00401280 push [ebp+var_RegEcx]
00401283 pop [ebp+var_RegEax]
00401286 mov eax, [ebp+var_RegEcx]
00401289 mov [ebx], eax
0040128B jmp InterpretingEntry
0040128B VOr endp
C. VXor,从虚拟机堆栈区弹出一个dword,与上一条指令的返回值“异或”,结果保存在var_RegEax中
00401290 ; ************** S U B R O U T I N E *****************************************
00401290
00401290 ; Attributes: bp-based frame
00401290
00401290 VXor proc near
00401290
00401290 var_RegEdi = dword ptr -1Ch
00401290 var_RegEcx = dword ptr -18h
00401290 var_RegEsp = dword ptr -0Fh
00401290 var_RegEax = dword ptr -0Bh
00401290
00401290 mov eax, [ebp+var_RegEax]
00401293 sub [ebp+var_RegEsp], 4
00401297 mov ebx, [ebp+var_RegEsp]
0040129A mov [ebp+var_RegEdi], ebx
0040129D mov edx, [ebx]
0040129F mov [ebp+var_RegEcx], edx
004012A2 xchg eax, [ebp+var_RegEcx]
004012A5 xor [ebp+var_RegEcx], eax
004012A8 push [ebp+var_RegEcx]
004012AB pop [ebp+var_RegEax]
004012AE mov eax, [ebp+var_RegEcx]
004012B1 mov [ebx], eax
004012B3 jmp InterpretingEntry
004012B3 VXor endp
7. VPushRegEax,将var_RegEax的值压入虚拟机堆栈区
004012B8 ; ************** S U B R O U T I N E *****************************************
004012B8
004012B8 ; All the Arithmetic Results are Returned in RegEax
004012B8 ; and should be thereafter Pushed into the Stack Manually
004012B8 ; Attributes: bp-based frame
004012B8
004012B8 VPushRegEax proc near
004012B8
004012B8 var_RegEdi = dword ptr -1Ch
004012B8 var_RegEcx = dword ptr -18h
004012B8 var_RegEsp = dword ptr -0Fh
004012B8 var_RegEax = dword ptr -0Bh
004012B8
004012B8 add [ebp+var_RegEsp], 4
004012BC mov ebx, [ebp+var_RegEax]
004012BF mov [ebp+var_RegEcx], ebx
004012C2 mov eax, [ebp+var_RegEsp]
004012C5 mov [ebp+var_RegEdi], eax
004012C8 mov [eax], ebx
004012CA jmp InterpretingEntry
004012CA VPushRegEax endp
D. VPop2RegEax,从虚拟机堆栈区弹出一个dword,保存至var_RegEax
004012CF ; ************** S U B R O U T I N E *****************************************
004012CF
004012CF ; Attributes: bp-based frame
004012CF
004012CF VPop2RegEax proc near
004012CF
004012CF var_RegEdi = dword ptr -1Ch
004012CF var_RegEcx = dword ptr -18h
004012CF var_RegEsp = dword ptr -0Fh
004012CF var_RegEax = dword ptr -0Bh
004012CF
004012CF sub [ebp+var_RegEsp], 4
004012D3 mov eax, [ebp+var_RegEsp]
004012D6 mov [ebp+var_RegEdi], eax
004012D9 mov ebx, [eax]
004012DB mov [ebp+var_RegEcx], ebx
004012DE mov [ebp+var_RegEax], ebx
004012E1 jmp InterpretingEntry
004012E1 VPop2RegEax endp
E. VPushByteVArg,将输入参数的一个字节无符号扩展以后压入虚拟机堆栈区,并保存至var_RegEax
004012E6 ; ************** S U B R O U T I N E *****************************************
004012E6
004012E6 ; Attributes: bp-based frame
004012E6
004012E6 VPushByteVArg proc near
004012E6
004012E6 var_lpVArg = dword ptr -30h
004012E6 var_VArgIndex = dword ptr -2Ch
004012E6 var_RegEdi = dword ptr -1Ch
004012E6 var_RegEcx = dword ptr -18h
004012E6 var_RegEsp = dword ptr -0Fh
004012E6 var_RegEax = dword ptr -0Bh
004012E6
004012E6 mov eax, [ebp+var_lpVArg]
004012E9 add eax, [ebp+var_VArgIndex]
004012EC inc [ebp+var_VArgIndex]
004012EF movzx eax, byte ptr [eax]
004012F2 mov [ebp+var_RegEax], eax
004012F5 add [ebp+var_RegEsp], 4
004012F9 mov ebx, [ebp+var_RegEsp]
004012FC mov [ebp+var_RegEdi], ebx
004012FF mov [ebp+var_RegEcx], eax
00401302 mov [ebx], eax
00401304 jmp InterpretingEntry
00401304 PushByteVArg endp
F. VSaveRegEax2ByteVRetVal,从堆栈中弹出一个dword,保存var_RegEax的最低字节至返回字节串
00401309 ; ************** S U B R O U T I N E *****************************************
00401309
00401309 ; Attributes: bp-based frame
00401309
00401309 VSaveRegEax2ByteVRetVal proc near
00401309
00401309 var_lpVRetVal= dword ptr -28h
00401309 var_VRetValIndex= dword ptr -24h
00401309 var_RegEdi = dword ptr -1Ch
00401309 var_RegEcx = dword ptr -18h
00401309 var_RegEsp = dword ptr -0Fh
00401309 var_RegEax = dword ptr -0Bh
00401309
00401309 mov eax, [ebp+var_RegEax]
0040130C sub [ebp+var_RegEsp], 4
00401310 mov ebx, [ebp+var_RegEsp]
00401313 mov [ebp+var_RegEdi], ebx
00401316 mov [ebp+var_RegEcx], eax
00401319 mov ebx, [ebx]
0040131B mov [ebp+var_RegEax], ebx
0040131E mov ebx, [ebp+var_lpVRetVal]
00401321 add ebx, [ebp+var_VRetValIndex]
00401324 inc [ebp+var_VRetValIndex]
00401327 mov [ebx], al
00401329 jmp InterpretingEntry
00401329 VSaveRegEax2ByteVRetVal endp
10. VJmp,无条件跳转指令,偏移量为操作码后面紧跟的一个word(相对于伪代码区基址)
0040132E ; ************** S U B R O U T I N E *****************************************
0040132E
0040132E ; Attributes: bp-based frame
0040132E
0040132E VJmp proc near
0040132E
0040132E var_RegEip = dword ptr -14h
0040132E var_RegDl = byte ptr -10h
0040132E var_7 = dword ptr -7
0040132E arg_lpVMCode = dword ptr 10h
0040132E
0040132E inc [ebp+var_RegEip]
00401331 mov eax, [ebp+var_RegEip]
00401334 movzx eax, byte ptr [eax]
00401337 mov [ebp+var_RegDl], al
0040133A shl eax, 8
0040133D mov [ebp+var_7], eax
00401340 inc [ebp+var_RegEip]
00401343 mov eax, [ebp+var_RegEip]
00401346 movzx eax, byte ptr [eax]
00401349 mov [ebp+var_RegDl], al
0040134C add [ebp+var_7], eax
0040134F mov eax, [ebp+var_7]
00401352 add eax, [ebp+arg_lpVMCode]
00401355 mov [ebp+var_RegEip], eax
00401358 jmp InterpretingEntry
00401358 VJmp endp
004013C7 ; ************** S U B R O U T I N E *****************************************
004013C7
004013C7 ; Attributes: bp-based frame
004013C7
004013C7 VJs proc near
004013C7
004013C7 var_RegEip = dword ptr -14h
004013C7 var_RegDl = byte ptr -10h
004013C7 var_7 = dword ptr -7
004013C7 var_SFlag = byte ptr -3
004013C7 arg_lpVMCode = dword ptr 10h
004013C7
004013C7 inc [ebp+var_RegEip]
004013CA mov eax, [ebp+var_RegEip]
004013CD movzx eax, byte ptr [eax]
004013D0 mov [ebp+var_RegDl], al
004013D3 shl eax, 8
004013D6 mov [ebp+var_7], eax
004013D9 inc [ebp+var_RegEip]
004013DC mov eax, [ebp+var_RegEip]
004013DF movzx eax, byte ptr [eax]
004013E2 mov [ebp+var_RegDl], al
004013E5 add [ebp+var_7], eax
004013E8 mov eax, [ebp+var_7]
004013EB cmp [ebp+var_SFlag], 1 ; 标志位测试
004013EF jnz short loc_4013F7
004013F1 add eax, [ebp+arg_lpVMCode]
004013F4 mov [ebp+var_RegEip], eax
004013F7
004013F7 loc_4013F7:
004013F7 jmp InterpretingEntry
004013F7 VJs endp
6. VRet10,返回指令,从虚拟机解释引擎中返回
004013FC ; ************** S U B R O U T I N E *****************************************
004013FC
004013FC
004013FC VRet10 proc near
004013FC leave
004013FD retn 10h
004013FD VRet10 endp ; sp = 4
004013FD