	.386p
	ifndef	??version
?debug	macro
	endm
publicdll macro	name
	public	name
	endm
	endif
	?debug	V 300h
	?debug	S "VHOOK.CPP"
	?debug	C E98F948F1D0956484F4F4B2E435050
	?debug	C E94019CA1817453A5C424333315C494E434C5544455C434F4E494F+
	?debug	C 2E48
	?debug	C E94019CA1817453A5C424333315C494E434C5544455C5F44454653+
	?debug	C 2E48
	?debug	C E94019CA1815453A5C424333315C494E434C5544455C444F532E48
VHOOK_TEXT	segment byte public use16 'CODE'
VHOOK_TEXT	ends
DGROUP	group	_DATA,_BSS
	assume	cs:VHOOK_TEXT,ds:DGROUP
_DATA	segment word public use16 'DATA'
d@	label	byte
d@w	label	word
_DATA	ends
_BSS	segment word public use16 'BSS'
b@	label	byte
b@w	label	word
oldhandler	label	dword
	db	4 dup (?)
_BSS	ends
VHOOK_TEXT	segment byte public use16 'CODE'
	?debug	C E8010956484F4F4B2E4350508F948F1D
   ;	
   ;	static void _interrupt far hook(int bp, int di, int si, int ds, int es, int dx, int cx, int bx, int ax, int flags) {
   ;	
	?debug	L 101
	assume	cs:VHOOK_TEXT
@hook$qiiiiiiiiii	proc	far
	?debug	B
	push	ax
	push	bx
	push	cx
	push	dx
	push	es
	push	ds
	push	si
	push	di
	push	bp
	mov	bp,DGROUP
	mov	ds,bp
	mov	bp,sp
	?debug	C E605666C616773040A120000026178040A100000+
	?debug	C 026278040A0E0000026378040A0C000002647804+
	?debug	C 0A0A0000026573040A080000026473040A060000+
	?debug	C 027369040A040000026469040A02000002627004+
	?debug	C 0A000000
	?debug	B
   ;	
   ;		if(_AH==0x0e) {
   ;	
	?debug	L 102
	cmp	ah,14
	jne	short @1@170
   ;	
   ;			//Teletype output
   ;			asm pusha;
   ;	
	?debug	L 104
 	pusha	
   ;	
   ;			putch(_AL);
   ;	
	?debug	L 105
	mov	ah,0
	push	ax
	call	far ptr _putch
	add	sp,2
   ;	
   ;			asm popa;
   ;	
	?debug	L 106
 	popa	
   ;	
   ;		} else {
   ;	
	?debug	L 107
	pop	bp
	pop	di
	pop	si
	pop	ds
	pop	es
	pop	dx
	pop	cx
	pop	bx
	pop	ax
	iret	
@1@170:
   ;	
   ;			oldhandler();
   ;	
	?debug	L 108
	pushf	
	call	dword ptr DGROUP:oldhandler
   ;	
   ;			ax=_AX;
   ;	
	?debug	L 109
	mov	word ptr [bp+16],ax
   ;	
   ;			bx=_BX;
   ;	
	?debug	L 110
	mov	word ptr [bp+14],bx
   ;	
   ;			cx=_CX;
   ;	
	?debug	L 111
	mov	word ptr [bp+12],cx
   ;	
   ;			dx=_DX;
   ;	
	?debug	L 112
	mov	word ptr [bp+10],dx
   ;	
   ;			es=_ES;
   ;	
	?debug	L 113
	mov	word ptr [bp+8],es
   ;	
   ;			//-ds
   ;			si=_SI;
   ;	
	?debug	L 115
	mov	word ptr [bp+4],si
   ;	
   ;			di=_DI;
   ;	
	?debug	L 116
	mov	word ptr [bp+2],di
   ;	
   ;			//-bp
   ;	                flags=_FLAGS;
   ;	
	?debug	L 118
	pushf	
	pop	ax
	mov	word ptr [bp+18],ax
   ;	
   ;		}
   ;	}
   ;	
	?debug	L 120
	pop	bp
	pop	di
	pop	si
	pop	ds
	pop	es
	pop	dx
	pop	cx
	pop	bx
	pop	ax
	iret	
	?debug	C E6026270040A000000026469040A020000027369+
	?debug	C 040A040000026473040A060000026573040A0800+
	?debug	C 00026478040A0A0000026378040A0C0000026278+
	?debug	C 040A0E0000026178040A10000005666C61677304+
	?debug	C 0A120000
	?debug	E
	?debug	E
@hook$qiiiiiiiiii	endp
   ;	
   ;	void HookVideo(int left, int top, int right, int bottom) {
   ;	
	?debug	L 123
	assume	cs:VHOOK_TEXT
@HookVideo$qiiii	proc	far
	?debug	B
	push	bp
	mov	bp,sp
	?debug	C E606626F74746F6D040A0C000005726967687404+
	?debug	C 0A0A000003746F70040A080000046C656674040A+
	?debug	C 060000
	?debug	B
   ;	
   ;		oldhandler = (void _interrupt (far*)(...))getvect(0x10);
   ;	
	?debug	L 124
	push	16
	call	far ptr _getvect
	add	sp,2
	mov	word ptr DGROUP:oldhandler+2,dx
	mov	word ptr DGROUP:oldhandler,ax
   ;	
   ;		setvect(0x10,(void _interrupt (far*)(...))hook);
   ;	
	?debug	L 125
	push	seg @hook$qiiiiiiiiii
	push	offset @hook$qiiiiiiiiii
	push	16
	call	far ptr _setvect
	add	sp,6
   ;	
   ;		directvideo=1;
   ;	
	?debug	L 126
	mov	word ptr DGROUP:_directvideo,1
   ;	
   ;	}
   ;	
	?debug	L 127
	pop	bp
	ret	
	?debug	C E6046C656674040A06000003746F70040A080000+
	?debug	C 057269676874040A0A000006626F74746F6D040A+
	?debug	C 0C0000
	?debug	E
	?debug	E
@HookVideo$qiiii	endp
   ;	
   ;	void UnhookVideo() {
   ;	
	?debug	L 129
	assume	cs:VHOOK_TEXT
@UnhookVideo$qv	proc	far
	?debug	B
	?debug	B
   ;	
   ;		setvect(0x10,oldhandler);
   ;	
	?debug	L 130
	push	dword ptr DGROUP:oldhandler
	push	16
	call	far ptr _setvect
	add	sp,6
   ;	
   ;	}
   ;	
	?debug	L 131
	ret	
	?debug	E
	?debug	E
@UnhookVideo$qv	endp
	?debug	C E9
	?debug	C FA00000000
VHOOK_TEXT	ends
_DATA	segment word public use16 'DATA'
s@	label	byte
_DATA	ends
VHOOK_TEXT	segment byte public use16 'CODE'
VHOOK_TEXT	ends
	public	@UnhookVideo$qv
	public	@HookVideo$qiiii
_oldhandler	equ	oldhandler
	extrn	_setvect:far
	extrn	_getvect:far
_pokeb	equ	pokeb
_poke	equ	poke
_peekb	equ	peekb
_peek	equ	peek
	extrn	_putch:far
	extrn	_directvideo:word
_s@	equ	s@
	?debug	C EA050C
	?debug	C E31800000023010400
	?debug	C EC0F40556E686F6F6B566964656F247176181800
	?debug	C E31900000023010400
	?debug	C EC1040486F6F6B566964656F2471696969691918+
	?debug	C 00
	?debug	C E31A00000023010700
	?debug	C E31C00000023010701
	?debug	C E31B000400161C00
	?debug	C E31D00000023010400
	?debug	C EB085F736574766563741D00
	?debug	C E32000000023010701
	?debug	C E31F000400162000
	?debug	C E31E000000231F0400
	?debug	C EB085F676574766563741E00
	?debug	C E32100000023010400
	?debug	C E32200000023010400
	?debug	C E32300000023080400
	?debug	C E32400000023040400
	?debug	C E3250666696E645F742C001E01
	?debug	C E3260015001A08
	?debug	C E327000D001A08
	?debug	C E328056666626C6B2C001E08
	?debug	C E3290015001A08
	?debug	C E32A000D001A08
	?debug	C E32B075245475041434B14001E0F
	?debug	C E32C05535245475308001E1A
	?debug	C E32D045245475310001F1F
	?debug	C E32E08574F52445245475310001E22
	?debug	C E32F08425954455245475308001E2B
	?debug	C E33009646F73646174655F7406001E34
	?debug	C E331046461746504001E39
	?debug	C E33209646F7374696D655F7404001E3D
	?debug	C E3330474696D6504001E42
	?debug	C E3340664657668647212001E47
	?debug	C E3350008001A08
	?debug	C E33607666174696E666F06001E4D
	?debug	C E3370A6469736B667265655F7408001E52
	?debug	C E33805646672656508001E57
	?debug	C E33908444F534552524F5206001E5C
	?debug	C E33A07434F554E54525922001E61
	?debug	C E33B0005001A08
	?debug	C E33C0002001A08
	?debug	C E33D0002001A08
	?debug	C E33E0002001A08
	?debug	C E33F0002001A08
	?debug	C E3400002001A08
	?debug	C E341000A001A08
	?debug	C E34204786663622E001E6E
	?debug	C E3430005001A08
	?debug	C E3440366636226001E74
	?debug	C E3450008001A08
	?debug	C E3460003001A08
	?debug	C E347000A001A08
	?debug	C E34800000023040400
	?debug	C EB065F70757463684800
	?debug	C EB0C5F646972656374766964656F0400
	?debug	C E34909746578745F696E666F0C001E8080
	?debug	C E60A6F6C6468616E646C65721B00000300000006+
	?debug	C 66696E645F74250700056666626C6B2807000752+
	?debug	C 45475041434B2B07000553524547532C07000452+
	?debug	C 4547532D07000842595445524547532F07000857+
	?debug	C 4F5244524547532E070009646F73646174655F74+
	?debug	C 300700046461746531070009646F7374696D655F+
	?debug	C 743207000474696D653307000664657668647234+
	?debug	C 070007666174696E666F3607000A6469736B6672+
	?debug	C 65655F7437070005646672656538070008444F53+
	?debug	C 4552524F5239070007434F554E5452593A070004+
	?debug	C 786663624207000366636244070009746578745F+
	?debug	C 696E666F490700
	?debug	F @hook$qiiiiiiiiii 26 152 0
	?debug	F pokeb 33 24 0
	?debug	F poke 34 24 0
	?debug	F peekb 35 24 0
	?debug	F peek 36 24 0
	?debug	C E200087265736572766564260006617474726962+
	?debug	C 08000777725F74696D650A000777725F64617465+
	?debug	C 0A000473697A650600046E616D6527C02C000000
	?debug	C E2000B66665F726573657276656429000966665F+
	?debug	C 61747472696208000866665F6674696D650A0008+
	?debug	C 66665F66646174650A000866665F6673697A6506+
	?debug	C 000766665F6E616D652AC02C000000
	?debug	C E20004725F61780A0004725F62780A0004725F63+
	?debug	C 780A0004725F64780A0004725F62700A0004725F+
	?debug	C 73690A0004725F64690A0004725F64730A000472+
	?debug	C 5F65730A0007725F666C6167730AC014000000
	?debug	C E2000265730A000263730A000273730A00026473+
	?debug	C 0AC008000000
	?debug	C E20001782E0001682FC010000000
	?debug	C E2000261780A000262780A000263780A00026478+
	?debug	C 0A000273690A000264690A000563666C61670A00+
	?debug	C 05666C6167730AC010000000
	?debug	C E20002616C0800026168080002626C0800026268+
	?debug	C 080002636C0800026368080002646C0800026468+
	?debug	C 08C008000000
	?debug	C E200036461790800056D6F6E7468080004796561+
	?debug	C 720A00096461796F667765656B08C006000000
	?debug	C E2000764615F7965617204000664615F64617908+
	?debug	C 000664615F6D6F6E08C004000000
	?debug	C E20004686F75720800066D696E75746508000673+
	?debug	C 65636F6E64080007687365636F6E6408C0040000+
	?debug	C 00
	?debug	C E2000674695F6D696E08000774695F686F757208+
	?debug	C 000774695F68756E6408000674695F73656308C0+
	?debug	C 04000000
	?debug	C E2000764685F6E65787406000764685F61747472+
	?debug	C 04000864685F73747261740A000864685F696E74+
	?debug	C 65720A000764685F6E616D6535C012000000
	?debug	C E2000866695F73636C757308000866695F666174+
	?debug	C 696408000866695F6E636C75730A000866695F62+
	?debug	C 7973656304C006000000
	?debug	C E2000E746F74616C5F636C7573746572730A000E+
	?debug	C 617661696C5F636C7573746572730A0013736563+
	?debug	C 746F72735F7065725F636C75737465720A001062+
	?debug	C 797465735F7065725F736563746F720AC0080000+
	?debug	C 00
	?debug	C E2000864665F617661696C0A000864665F746F74+
	?debug	C 616C0A000764665F627365630A000864665F7363+
	?debug	C 6C75730AC008000000
	?debug	C E2000B64655F6578746572726F7204000864655F+
	?debug	C 636C61737308000964655F616374696F6E080008+
	?debug	C 64655F6C6F63757308C006000000
	?debug	C E20007636F5F64617465040007636F5F63757272+
	?debug	C 3B0008636F5F74687365703C0008636F5F646573+
	?debug	C 65703D0008636F5F64747365703E0008636F5F74+
	?debug	C 6D7365703F000C636F5F637572727374796C6508+
	?debug	C 0009636F5F646967697473080007636F5F74696D+
	?debug	C 65080007636F5F63617365060008636F5F646173+
	?debug	C 6570400007636F5F66696C6C41C022000000
	?debug	C E20009786663625F666C6167080009786663625F+
	?debug	C 72657376430009786663625F6174747208400800+
	?debug	C 00000008786663625F66636244C02E000000
	?debug	C E200096663625F64726976650800086663625F6E+
	?debug	C 616D654500076663625F65787446000A6663625F+
	?debug	C 637572626C6B04000B6663625F72656373697A65+
	?debug	C 04000B6663625F66696C73697A65060008666362+
	?debug	C 5F646174650400086663625F7265737647000A66+
	?debug	C 63625F637572726563084022000000000A666362+
	?debug	C 5F72616E646F6D06C026000000
	?debug	C E2000777696E6C65667408000677696E746F7008+
	?debug	C 000877696E726967687408000977696E626F7474+
	?debug	C 6F6D0800096174747269627574650800086E6F72+
	?debug	C 6D61747472080008637572726D6F646508000C73+
	?debug	C 637265656E68656967687408000B73637265656E+
	?debug	C 7769647468080004637572780800046375727908+
	?debug	C C00C000000
	end
