⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vmmz.asm

📁 Chikago_src.zip
💻 ASM
📖 第 1 页 / 共 2 页
字号:
include local.inc

StartCDecl Call_Priority_VM_Event@24

    push    ebx
    push	esi
    push	edi

    mov		edi, [esp+36]	; Timeout
    mov		esi, [esp+32]	; Event callback
    mov		edx, [esp+28]	; Ref data
    mov     ecx, [esp+24]	; Flags
    mov		ebx, [esp+20]	; hVM
    mov		eax, [esp+16]	; Priority boost
    VxDCall	Call_Priority_VM_Event
    mov		eax, esi

    pop		edi
    pop		esi
    pop		ebx
    ret		6*4

EndCDecl Call_Priority_VM_Event@24

StartCDecl Cancel_Thread_Event@8

    push	esi
    push	edi

    mov		edi, [esp+16]	; Event handle
    mov		esi, [esp+12]	; Thread handle
    VxDCall	Cancel_Thread_Event

    pop		edi
    pop		esi
    ret		2*4

EndCDecl Cancel_Thread_Event@8

StartCDecl Schedule_Thread_Event@12

    push    esi
    push    edi

    mov     edx, [esp+20]	; Ref data
    mov     esi, [esp+16]	; Event callback
    mov     edi, [esp+12]	; Thread handle
    VxDCall Schedule_Thread_Event
    mov     eax, esi

    pop     edi
    pop     esi
    ret     3*4

EndCDecl Schedule_Thread_Event@12

StartCDecl Test_Sys_VM_Handle@4

    push    ebx

    mov     ebx, [esp+8]	; VM handle to test
    VxDCall Test_Sys_VM_Handle
    setnc   al
    and     eax, 1

    pop     ebx
    ret     1*4

EndCDecl Test_Sys_VM_Handle@4

StartCDecl Validate_VM_Handle@4

    push    ebx

    mov     ebx, [esp+8]	; VM handle to test
    VxDCall Validate_VM_Handle
    setnc   al
    and     eax, 1         ; Returns TRUE if handle is valid

    pop     ebx
    ret     1*4

EndCDecl Validate_VM_Handle@4

StartCDecl Call_When_VM_Returns@12

    push    esi

    mov     esi, [esp+16]  ; callback function address
    mov     edx, [esp+12]  ; reference data
    mov     eax, [esp+8]   ; msec until time out

    VxDCall Call_When_VM_Returns

    pop     esi
    ret     3*4

EndCDecl Call_When_VM_Returns@12

StartCDecl Schedule_VM_Event@12

    push    ebx
    push    esi

    mov     edx, [esp+20]  ; Reference data
    mov     esi, [esp+16]  ; Event callback
    mov     ebx, [esp+12]  ; VM handle

    VxDCall Schedule_VM_Event
    mov     eax, esi

    pop     esi
    pop     ebx
    ret     3*4

EndCDecl Schedule_VM_Event@12

StartCDecl Call_Global_Event@8

    push    esi

    mov     edx, [esp+12]     ; Reference data
    mov     esi, [esp+8]      ; Global event callback

    VxDCall Call_Global_Event
    mov     eax, esi

    pop     esi
    ret     2*4

EndCDecl Call_Global_Event@8

StartCDecl Call_VM_Event@12

    push    ebx
    push    esi

    mov     edx, [esp+20]   ; Reference data
    mov     esi, [esp+16]   ; Event callback
    mov     ebx, [esp+12]   ; VM Handle

    VxDCall Call_VM_Event
    mov     eax, esi

    pop     esi
    pop     ebx
    ret     3*4

EndCDecl Call_VM_Event@12

StartCDecl Cancel_VM_Event@8

    push    ebx
    push    esi

    mov     esi, [esp+16]   ; Event handle
    mov     ebx, [esp+12]   ; VM Handle

    VxDCall	Cancel_VM_Event

    pop     esi
    pop     ebx
    ret     2*4

EndCDecl Cancel_VM_Event@8

StartCDecl Cancel_Priority_VM_Event@4

    push    esi

    mov     esi, [esp+8]   ; Event handle
	      
    VxDCall	Cancel_Priority_VM_Event

    pop     esi
    ret     1*4

EndCDecl Cancel_Priority_VM_Event@4

StartCDecl Map_Flat@8

    mov     ecx, [esp+4]   ; Segment
    shl     ecx, 8
    mov     eax, [esp+8]   ; Offset
    or      eax, ecx
		     
    VxDCall	Map_Flat       ; eax holds -1 on error, else ring-0 address

    ret     2*4

EndCDecl Map_Flat@8

StartCDecl Map_Lin_To_VM_Addr@16

    mov     ecx, [esp+8]      ; Segment limit
    mov     eax, [esp+4]      ; Linear address to convert
		     
    VxDCall Map_Lin_To_VM_Addr
    setnc   al
    and     eax, 1
    push    eax

    mov     eax, [esp+20]     ; Get offset pointer
    mov     [eax], edx        ; Return offset
    mov     eax, [esp+16]     ; Get segment pointer
    mov     [eax], ecx        ; Return segment

    pop     eax
    ret     4*4

EndCDecl Map_Lin_To_VM_Addr@16

StartCDecl Adjust_Exec_Priority@8

    push    ebx

    mov     ebx, [esp+12]   ; VM handle
    mov     eax, [esp+8]    ; Priority boost
	      
    VxDCall Adjust_Exec_Priority

    pop     ebx
    ret     2*4

EndCDecl Adjust_Exec_Priority@8

StartCDecl End_Crit_And_Suspend@0

    VxDCall	Adjust_Exec_Priority
    setnc   al
    and     eax, 1

    ret     0*4		
        
EndCDecl End_Crit_And_Suspend@0

StartCDecl Claim_Critical_Section@8

    mov     ecx, [esp+8]    ; Flags
    mov     eax, [esp+4]    ; Claims

    VxDCall	Claim_Critical_Section

    ret     2*4
                
EndCDecl Claim_Critical_Section@8

StartCDecl Release_Critical_Section@4

    mov     ecx, [esp+4]    ; Claims

    VxDCall	Release_Critical_Section

    ret     1*4
                
EndCDecl Release_Critical_Section@4

StartCDecl Call_When_Not_Critical@8

    push    esi

    mov     edx, [esp+12]   ; Reference data
    mov     esi, [esp+8]    ; Critical section callback

    VxDCall Call_When_Not_Critical

    pop     esi
    ret     2*4
                
EndCDecl Call_When_Not_Critical@8

StartCDecl Get_Crit_Section_Status@8

    push    ebx

    VxDCall Get_Crit_Section_Status

    setc    al
    and     eax, 1          ; Return TRUE if carry set
    push    eax

    mov     eax, [esp+12]   ; Get pointer to VM handle
    mov     [eax], ebx      ; Return VM handle
    mov     eax, [esp+16]   ; Get pointer to claims
    mov     [eax], ecx      ; Return claims

    pop     eax
    pop     ebx
    ret     2*4
                
EndCDecl Get_Crit_Section_Status@8

StartCDecl Call_When_Task_Switched@4

    push    esi

    mov     esi, [esp+8] ; Task switch callback
    VxDCall	Call_When_Task_Switched

    pop     esi
    ret     1*4
                
EndCDecl Call_When_Task_Switched@4

StartCDecl Suspend_VM@4

    push    ebx

    mov     ebx, [esp+8]        ; VM handle
    VxDCall	Suspend_VM
    setnc   al
    and     eax, 1

    pop     ebx
    ret     1*4
                
EndCDecl Suspend_VM@4

StartCDecl Resume_VM@4

    push    ebx

    mov     ebx, [esp+8]        ; VM handle
    VxDCall	Resume_VM
    setnc   al
    and     eax, 1

    pop     ebx
    ret     1*4
                
EndCDecl Resume_VM@4

StartCDecl No_Fail_Resume_VM@4

    push    ebx

    mov     ebx, [esp+8]        ; VM handle
    VxDCall	No_Fail_Resume_VM
    
    pop     ebx
    ret     1*4
                
EndCDecl No_Fail_Resume_VM@4

StartCDecl Nuke_VM@4

    push    ebx

    mov     ebx, [esp+8]        ; VM handle
    VxDCall	Nuke_VM
    
    pop     ebx
    ret     1*4
                
EndCDecl Nuke_VM@4

StartCDecl Crash_Cur_VM@0

    VxDCall	Crash_Cur_VM

    ret     0*4
                                
EndCDecl Crash_Cur_VM@0

StartCDecl Set_Execution_Focus@4

    push    ebx

    mov     ebx, [esp+8]        ; VM handle
    VxDCall	Set_Execution_Focus
    setnc   al
    and     eax, 1

    pop     ebx
    ret     1*4
                
EndCDecl Set_Execution_Focus@4

StartCDecl Get_Time_Slice_Info@12

    push    ebx

    VxDCall	Get_Time_Slice_Info
    mov     edx, eax        ; Save num scheduled
    mov     eax, [esp+16]   ; Return num idle
    mov     [eax], ecx
    mov     eax, [esp+12]   ; Return current VM
    mov     [eax], ebx
    mov     eax, [esp+8]    ; Return num scheduled
    mov     [eax], edx

    pop     ebx
    ret     3*4
                        
EndCDecl Get_Time_Slice_Info@12

StartCDecl Release_Time_Slice@0

    VxDCall	Release_Time_Slice

    ret     0*4
                                
EndCDecl Release_Time_Slice@0

StartCDecl Wake_Up_VM@4

    push    ebx

    mov     ebx, [esp+8]        ; VM handle

    VxDCall	Wake_Up_VM
    
    pop     ebx
    ret     1*4
                        
EndCDecl Wake_Up_VM@4

StartCDecl Get_Next_VM_Handle@4

    push    ebx

    mov     ebx, [esp+8]        ; VM handle

    VxDCall	Get_Next_VM_Handle
    mov     eax, ebx

    pop     ebx
    ret     1*4
                        
EndCDecl Get_Next_VM_Handle@4

StartCDecl Get_System_Time@0

    VxDCall	Get_System_Time
    ret     0*4
                                
EndCDecl Get_System_Time@0

StartCDecl Get_VM_Exec_Time@4

    push    ebx

    mov     ebx, [esp+8]        ; VM handle
    VxDCall	Get_VM_Exec_Time

    pop     ebx
    ret     1*4
                    
EndCDecl Get_VM_Exec_Time@4

StartCDecl Set_PM_Int_Vector@12

    mov     edx, [esp+12]       ; Offset for interrupt routine
    mov     ecx, [esp+8]        ; Selector for interrupt routine
    mov     eax, [esp+4]        ; Interrupt number

    VxDCall	Set_PM_Int_Vector
    
    ret     3*4
                        
EndCDecl Set_PM_Int_Vector@12

StartCDecl Simulate_Int@4

    mov     eax, [esp+4]        ; Interrupt number

    VxDCall	Simulate_Int
    
    ret     1*4
                        
EndCDecl Simulate_Int@4

StartCDecl Simulate_Iret@0

    VxDCall	Simulate_Iret

    ret     0*4
                                
EndCDecl Simulate_Iret@0

StartCDecl Simulate_Far_Call@8

    mov     edx, [esp+8]        ; offset of procedure
    mov     cx,  [esp+4]        ; Segment containing procedure
    
    VxDCall	Simulate_Far_Call
    
    ret     2*4
                        
EndCDecl Simulate_Far_Call@8

StartCDecl Simulate_Far_Jmp@8

    mov     edx, [esp+8]        ; offset of procedure
    mov     ecx, [esp+4]        ; Segment containing procedure
    
    VxDCall	Simulate_Far_Jmp
    
    ret     2*4
                        
EndCDecl Simulate_Far_Jmp@8

StartCDecl Simulate_Far_Ret@0

    VxDCall	Simulate_Far_Ret

    ret     0*4
                                
EndCDecl Simulate_Far_Ret@0

StartCDecl Simulate_Far_Ret_N@4

    mov     eax, [esp+4]        ; no of bytes to pop from stack
           
    VxDCall	Simulate_Far_Ret_N
    
    ret     1*4
                        
EndCDecl Simulate_Far_Ret_N@4

StartCDecl Simulate_Pop@0
                       
    VxDCall	Simulate_Pop
    ret     0*4
                                
EndCDecl Simulate_Pop@0

StartCDecl Simulate_Push@4

    mov     eax, [esp+4]        ; value to push
           
    VxDCall	Simulate_Push
    
    ret     1*4
                        
EndCDecl Simulate_Push@4

StartCDecl Build_Int_Stack_Frame@8

    mov     edx, [esp+8]        ; offset of routine to call
    mov     cx,  [esp+4]        ; code segment of routine to call
    
    VxDCall	Build_Int_Stack_Frame
    
    ret     2*4
                        
EndCDecl Build_Int_Stack_Frame@8

StartCDecl MMGR_SetNULPageAddr@4

    mov     eax, [esp+4]        ; physical address for system nul page
            
    VxDCall	MMGR_SetNULPageAddr
    
    ret     1*4
                        
EndCDecl MMGR_SetNULPageAddr@4

StartCDecl Hook_VMM_Fault@12

    push    esi

    mov     esi, [esp+12]       ; points to a fault handler
    mov     eax, [esp+8]        ; fault number to hook
            
    VxDCall	Hook_VMM_Fault
    setnc   al
    and     eax, 1
    push    eax
        
    mov     eax, [esp+20]       ; get pointer to previous hook
    mov     [eax], esi          ; return previous hook

    pop     eax
    pop     esi
    ret     3*4
                        
EndCDecl Hook_VMM_Fault@12

StartCDecl Exec_Int@4

    push    [esp+4]         ; push interrupt number

    VxDCall	Exec_Int
    ret     1*4
                        
EndCDecl Exec_Int@4

StartCDecl Allocate_PM_App_CB_Area@4

    mov     ecx, [esp+4]        ; Size
            
    VxDCall	Allocate_PM_App_CB_Area
    mov     eax, ecx
    
    ret     1*4
                        
EndCDecl Allocate_PM_App_CB_Area@4

StartCDecl Save_Client_State@4

    push    edi

    mov     edi, [esp+8]        ; Buffer
            
    VxDCall	Save_Client_State
    
    pop     edi
    ret     1*4
                        
EndCDecl Save_Client_State@4

StartCDecl Restore_Client_State@4

    push    esi

    mov     esi, [esp+8]        ; Buffer
            
    VxDCall	Restore_Client_State
    
    pop     esi
    ret     1*4
                        
EndCDecl Restore_Client_State@4

; Offsets into REGISTERS structure
EDI_reg EQU 0
ESI_reg EQU 4
EBP_reg EQU 8
ESP_reg EQU 12
EBX_reg EQU 16
EDX_reg EQU 20
ECX_reg EQU 24
EAX_reg EQU 28
Flags   EQU 32

StartCDecl Exec_VxD_Int@8

	push ebx
	push esi
	push edi
	push ebp

	mov eax, [esp+20]		; Interrupt number
	push eax

	mov eax, [esp+28]		; REGISTERS ptr
	mov edi, [eax]
	mov esi, [eax+ESI_reg]
	mov ebp, [eax+EBP_reg]
	mov ebx, [eax+EBX_reg]
	mov edx, [eax+EDX_reg]
	mov ecx, [eax+ECX_reg]
	mov eax, [eax+EAX_reg]

	VxDCall	Exec_VxD_Int

	pushfd					; save flags

	push eax
	mov eax, [esp+32]		; get REGISTERS ptr
	pop [eax+EAX_reg]		; save registers
	pop [eax+Flags]
	mov [eax], edi
	mov [eax+ESI_reg], esi
	mov [eax+EBP_reg], ebp
	mov [eax+ESP_reg], esp
	mov [eax+EBX_reg], ebx
	mov [eax+EDX_reg], edx
	mov [eax+ECX_reg], ecx

	pop ebp
	pop edi
	pop esi
	pop ebx

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -