Download WINDOWS ASSEMBLY LANGUAGE & SYSTEMS PROGRAMMING

Transcript
354 Windows Assembly Language & Systems Programming
?
VDEMOD Owner DD
VxD - LO&ZD_DATA_ENDS
;...........................................,..........
iinitilisation code...
VxD - ICODE_SEG
BeginProc VDEMOD_Device_Init
beep:
push
mov
out
mov
mov
out
mov
out
in
or
out
POP
eax
al,OB6h
43h,al
bx,OSCSh
al,bl
42h,al
al,bh
42h,al
a1,61h
al,3
61h,al
eax
I*turn on loudspeaker
I-firstly, let's hook anything (port 200h) and show a
;generalised handler...
mov edx, 2oOh
mov esi, OFFSET32 My_VDEMOD_Hook
VMMCall Install_IO_Handler
;now, let's prevent printing...
mov
*lpt status
edx, 3BDh
mov
esi, OFFSET32 My_VDEMOD_lpt_Hook'
VMMCall Install_IO_Handler
mov
edx, 379h
mov esi, OFFSET32 My_VDEMOD_lpt_Hook
VMMCall Install_IO_Handler
mov
edx, 27911
mov esi, OFFSET32 My_VDEMOD_lpt_Hook
VMMCall Install_IO_Handler
elpt status
’
I*lpt status
, . . . . .
-1pt control
mov
edx, 3BEh
mov esi, OFFSET32 ctrl_VDEMOD_lpt_Hook ’
VMMCall Install_IO_Handler
mov
edx, 37Ah
,elpt control
mov esi, OFFSET32 ctrl_VDEMOD_lpt_Hook
VMMCall Install_IO_Handler
mov
edx, 27Ah
mov esi, OFFSET32 ctrl VDEMOD_lpt_Hook
VMMCall Install_IO_HandTer
xor
eax, eax
mov VDEMOD_Owner, eax
Imlpt control
; no current owner