Virus Labs & Distribution
VLAD #3 - HD Port Writing

;       Writing to the hard disk using the ports!     by qark
;       +---------------------------------------+
;  The only differences between reading and writing using the ports is
;  that 30h is sent to the command register, and instead of INSW you
;  OUTSW.  
;  I chose to write to sector 2 because some idiot would trash their MBR
;  by running this.

	mov     dx,1f6h         ;Drive and head port
	mov     al,0a0h         ;Drive 0, head 0
	out     dx,al

	mov     dx,1f2h         ;Sector count port
	mov     al,1            ;Write one sector
	out     dx,al

	mov     dx,1f3h         ;Sector number port
	mov     al,2            ;Wrote to sector two
	out     dx,al

	mov     dx,1f4h         ;Cylinder low port
	mov     al,0            ;Cylinder 0
	out     dx,al

	mov     dx,1f5h         ;Cylinder high port
	mov     al,0            ;The rest of the cylinder 0
	out     dx,al

	mov     dx,1f7h         ;Command port
	mov     al,30h          ;Write with retry.
	out     dx,al
	in      al,dx
	test    al,8            ;Wait for sector buffer ready.
	jz      oogle
	mov     cx,512/2        ;One sector /2
	mov     si,offset buffer
	mov     dx,1f0h         ;Data port - data comes in and out of here.
	rep     outsw           ;Send it.

;    ------------

	mov     ax,201h                 ;We'll read in sector 2 using
	mov     bx,offset buffer2       ;int13h and see if we are successful.
	mov     cx,2
	mov     dx,80h
	int     13h

	mov     cx,512
	mov     si,offset buffer
	mov     di,offset buffer2
	repe    cmpsb                   ;Compare the buffers.
	jne     failure

	mov     ah,9
	mov     dx,offset write_msg
	int     21h
	jmp     w_exit
	mov     ah,9
	mov     dx,offset fail
	int     21h
	mov     ax,4c00h        ;Exit the program
	int     21h
	write_msg       db      'Sector two written to using the ports.$'
	fail            db      'Writing using ports failed.$'

buffer  db      512 dup ('A')
buffer2 db      512 dup ('D')



ARTICLE.1_2       Aims and Policies
ARTICLE.1_3       Greets
ARTICLE.1_4       Members/Joining
ARTICLE.1_5       Dist/Contact Info
ARTICLE.1_6       Hidden Area Info
ARTICLE.1_7       Coding the Mag


The Press
ARTICLE.2_2       Fooling TBScan
ARTICLE.2_3       Backdoors
ARTICLE.2_4       Tracing Int21
ARTICLE.2_5       Replication
ARTICLE.2_6       VSUM denial
ARTICLE.2_7       Proview


TBTSR Checking
ARTICLE.3_2       TBScan Flags
ARTICLE.3_3       HD Port Reading
ARTICLE.3_4       HD Port Writing
ARTICLE.3_5       TBAV Monitor
ARTICLE.3_6       Micro128 Disasm
ARTICLE.3_7       Aust403 Disasm


Virus Descriptions
ARTICLE.4_2       Hemlock
ARTICLE.4_3       Antipode
ARTICLE.4_4       Insert
ARTICLE.4_6       Quantum Magick
ARTICLE.4_7       Mon Ami La Pendule


ARTICLE.5_2       Small Virus
ARTICLE.5_3       Catch-22
ARTICLE.5_4       ART Engine
ARTICLE.5_5       Megastealth
ARTICLE.5_6       Virus Scripts
ARTICLE.5_7       What's Next ?

About VLAD - Links - Contact Us - Main