Hallo,
folgender Quelltext bereit mir Probleme...
<pre>
; DSperre.asm
.386p
; .xlist
; .list
include vmm.inc
include vwin32.inc
include shell.inc
include ifsmgr.inc
include ifs.inc
DECLARE_VIRTUAL_DEVICE DSPERRE,1,0, DSPERRE_Control,\
UNDEFINED_DEVICE_ID, UNDEFINED_INIT_ORDER
;================================================= ===========================
;
; D E V I C E C O N T R O L P R O C E D U R E
;
;================================================= ===========================
Begin_control_dispatch DSPERRE
; hier werden die GLOBALEN Funktionen, die beim Start ausgeführt werden sollen
; aufgelistet:
Control_Dispatch w32_DeviceIoControl, OnDeviceIoControl
End_control_dispatch DSPERRE
VxD_PAGEABLE_DATA_SEG
pTitle dd ?
pMessage dd ?
VxD_PAGEABLE_DATA_ENDS
VxD_PAGEABLE_CODE_SEG
BeginProc OnDeviceIoControl
assume esitr DIOCParams
; .if [esi].lpoOverlapped==0
.if [esi].dwIoControlCode==DIOC_Open
xor eax,eax
.elseif [esi].dwIoControlCode==1
;--- Installs a file system API hook ---
mov eax, OFFSET32 CreatefileHook ; Proc to redirect the API hook
push eax
VxDcall IFSMgr_InstallFileSystemApiHook ; Install the API hook
add esp, 4
or eax,eax
jz Install_Error
mov [PrevHook], eax
;--- DOS-BEEP: ---
Push_Client_State
VMMCall Begin_Nest_V86_Exec
assume ebptr Client_Byte_Reg_Struc
mov [ebp].Client_dl,7
mov [ebp].Client_ah,2
mov eax,21h
VMMCall Exec_Int
VMMCall End_Nest_Exec
Pop_Client_State
;--- Beep Ende ---
.endif
ret
EndProc OnDeviceIoControl
;---------------------------------------------------------------------------
;
; CreatefileHook
;
; Entry ('C' callable proc => parameters pushed on the stack) :
; ebp+1Ch : pir
; ebp+18h : CodePage
; ebp+14h : ResourceFlags
; ebp+10h : Drive
; ebp+0Ch : FunctionNum
; ebp+8 : FSDFnAddr
;
; Exit: - Clear the ir_ppath if the caller opens a file
; from the 'Favorites' directory or if it is MSHTML.DLL and
; return an 'access denied' message.
; - Clear both ir_pos and ir_length if the caller is
; an M$ app writing to a file and truncate it to 0 byte.
; - Restore the previous hook in chain.
; - Restore both ir_pos and ir_length to fool the app.
; - Modify the ret error code (ir_error).
;
;---------------------------------------------------------------------------
BeginProc CreatefileHook
push ebp
mov ebp,esp
sub esp,20h
pushad
call Clear_OpenWriteFlag ; clear M$ OpenWrite flag
; ------------------------------------------------
; Check if it is an open/create or write operation
; ------------------------------------------------
cmp [ebp+0Ch], 24h ; Open/create file (IFSFN_OPEN)?
jz GetOpenFileName
cmp [ebp+0ch], 01h ; Write to file (IFSFN_WRITE)?
jnz Quit
mov OpenWriteFlag, 'W' ; set flag to M$ 'W'rite operation
jmp GetTaskName ; and get the name of the app.
; ------------------------
; Get open file ASCII name
; ------------------------
GetOpenFileName:
mov OpenWriteFlag, 'O' ; set flag to M$ 'O'pen operation
mov ebx, offset32 File_Name
mov eax, [ebp+10h] ; get current drive (A=1, B=2
folgender Quelltext bereit mir Probleme...
<pre>
; DSperre.asm
.386p
; .xlist
; .list
include vmm.inc
include vwin32.inc
include shell.inc
include ifsmgr.inc
include ifs.inc
DECLARE_VIRTUAL_DEVICE DSPERRE,1,0, DSPERRE_Control,\
UNDEFINED_DEVICE_ID, UNDEFINED_INIT_ORDER
;================================================= ===========================
;
; D E V I C E C O N T R O L P R O C E D U R E
;
;================================================= ===========================
Begin_control_dispatch DSPERRE
; hier werden die GLOBALEN Funktionen, die beim Start ausgeführt werden sollen
; aufgelistet:
Control_Dispatch w32_DeviceIoControl, OnDeviceIoControl
End_control_dispatch DSPERRE
VxD_PAGEABLE_DATA_SEG
pTitle dd ?
pMessage dd ?
VxD_PAGEABLE_DATA_ENDS
VxD_PAGEABLE_CODE_SEG
BeginProc OnDeviceIoControl
assume esitr DIOCParams
; .if [esi].lpoOverlapped==0
.if [esi].dwIoControlCode==DIOC_Open
xor eax,eax
.elseif [esi].dwIoControlCode==1
;--- Installs a file system API hook ---
mov eax, OFFSET32 CreatefileHook ; Proc to redirect the API hook
push eax
VxDcall IFSMgr_InstallFileSystemApiHook ; Install the API hook
add esp, 4
or eax,eax
jz Install_Error
mov [PrevHook], eax
;--- DOS-BEEP: ---
Push_Client_State
VMMCall Begin_Nest_V86_Exec
assume ebptr Client_Byte_Reg_Struc
mov [ebp].Client_dl,7
mov [ebp].Client_ah,2
mov eax,21h
VMMCall Exec_Int
VMMCall End_Nest_Exec
Pop_Client_State
;--- Beep Ende ---
.endif
ret
EndProc OnDeviceIoControl
;---------------------------------------------------------------------------
;
; CreatefileHook
;
; Entry ('C' callable proc => parameters pushed on the stack) :
; ebp+1Ch : pir
; ebp+18h : CodePage
; ebp+14h : ResourceFlags
; ebp+10h : Drive
; ebp+0Ch : FunctionNum
; ebp+8 : FSDFnAddr
;
; Exit: - Clear the ir_ppath if the caller opens a file
; from the 'Favorites' directory or if it is MSHTML.DLL and
; return an 'access denied' message.
; - Clear both ir_pos and ir_length if the caller is
; an M$ app writing to a file and truncate it to 0 byte.
; - Restore the previous hook in chain.
; - Restore both ir_pos and ir_length to fool the app.
; - Modify the ret error code (ir_error).
;
;---------------------------------------------------------------------------
BeginProc CreatefileHook
push ebp
mov ebp,esp
sub esp,20h
pushad
call Clear_OpenWriteFlag ; clear M$ OpenWrite flag
; ------------------------------------------------
; Check if it is an open/create or write operation
; ------------------------------------------------
cmp [ebp+0Ch], 24h ; Open/create file (IFSFN_OPEN)?
jz GetOpenFileName
cmp [ebp+0ch], 01h ; Write to file (IFSFN_WRITE)?
jnz Quit
mov OpenWriteFlag, 'W' ; set flag to M$ 'W'rite operation
jmp GetTaskName ; and get the name of the app.
; ------------------------
; Get open file ASCII name
; ------------------------
GetOpenFileName:
mov OpenWriteFlag, 'O' ; set flag to M$ 'O'pen operation
mov ebx, offset32 File_Name
mov eax, [ebp+10h] ; get current drive (A=1, B=2
Comment