ReC98/th04_zuninit.asm

409 lines
9.5 KiB
NASM
Raw Normal View History

;
; +-------------------------------------------------------------------------+
; | This file has been generated by The Interactive Disassembler (IDA) |
; | Copyright (c) 2009 by Hex-Rays, <support@hex-rays.com> |
; +-------------------------------------------------------------------------+
;
; Input MD5 : F233A9AA186A9CC15E9B9109979AF52B
; File Name : th04/ZUN.COM:ZUNINIT (-I)
; Format : MS-DOS COM-file
; Base Address: 0h Range: 100h-575h Loaded length: 475h
; OS type : MS DOS
; Application type: Executable 16bit
.8086
.model tiny
.code
org 100h
; =============== S U B R O U T I N E =======================================
; Attributes: noreturn thunk
public start
start proc near
jmp start_0
start endp
; =============== S U B R O U T I N E =======================================
sub_103 proc far
cmp cs:byte_216, 0
jnz short locret_114
mov cs:byte_216, 1
call sub_127
locret_114:
iret
sub_103 endp
; =============== S U B R O U T I N E =======================================
sub_115 proc far
cmp cs:byte_216, 0
jnz short locret_126
mov cs:byte_216, 2
call sub_127
locret_126:
iret
sub_115 endp
; =============== S U B R O U T I N E =======================================
sub_127 proc near
pushf
push ax
push bx
push cx
push dx
push ds
push di
push es
mov ah, 41h
int 18h
cmp cs:byte_216, 2
jz short loc_15A
mov ax, 650h
mov dx, offset aVVtvVVrvsvnvog ; "<22>ނ<EFBFBD><DE82>݂ɂr<C982>s<EFBFBD>n<EFBFBD>o<EFBFBD>L<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȃ<EFBFBD>$"
call sub_1CF
mov ax, 6F0h
mov dx, offset asc_23A ; "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǝv<C68E><76><EFBFBD>́B<CC81>i<EFBFBD>Q<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>͂ˁj$"
call sub_1CF
mov ax, 790h
mov dx, offset aBivrvsvnvoglbV ; "<22>i<EFBFBD>r<EFBFBD>s<EFBFBD>n<EFBFBD>o<EFBFBD>L<EFBFBD>[<5B>Ŗ߂<C596><DF82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>˂<EFBFBD><CB82>j<EFBFBD>@$"
call sub_1CF
mov bl, 1
jmp short loc_177
; ---------------------------------------------------------------------------
loc_15A:
mov ax, 650h
mov dx, offset aVV ; "<22>Ȃ<EFBFBD><C882>łb<C582>n<EFBFBD>o<EFBFBD>x<EFBFBD>L<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482><EFBFBD>$"
call sub_1CF
mov ax, 6F0h
mov dx, offset aVivBBbvVVmbBbb ; "<22><><EFBFBD>ȁ`<60>B<EFBFBD>ӂ<EFBFBD><D382><EFBFBD><EFBFBD>`<60>B<EFBFBD>@<40>@<40>i<EFBFBD><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>x<EFBFBD>A$"
call sub_1CF
mov ax, 790h
mov dx, offset aVbvnvovxglbIqv ; "<22>b<EFBFBD>n<EFBFBD>o<EFBFBD>x<EFBFBD>L<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>Ζ߂<CE96><DF82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>˂<EFBFBD><CB82>j$"
call sub_1CF
mov bl, 2
loc_177:
mov ah, 4
mov al, 0Ch
int 18h
test ah, bl
jnz short loc_177
loc_181:
mov ah, 4
mov al, 0Ch
int 18h
test ah, bl
jz short loc_181
mov ah, 40h
int 18h
mov ax, 650h
mov dx, offset aB@b@b@b@b@b@b@ ; "<22>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@$"
call sub_1CF
mov ax, 6F0h
mov dx, offset aB@b@b@b@b@b@b@ ; "<22>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@$"
call sub_1CF
mov ax, 790h
mov dx, offset aB@b@b@b@b@b@b@ ; "<22>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@$"
call sub_1CF
mov ah, 6
int 18h
pop es
pop di
pop ds
pop dx
pop cx
pop bx
pop ax
popf
mov cs:byte_216, 0
retn
sub_127 endp
; =============== S U B R O U T I N E =======================================
sub_1BD proc near
shl ah, 1
cmp al, 9Fh
jnb short loc_1C8
cmp al, 80h
adc ax, 0FEDFh
loc_1C8:
sbb ax, 0DFFEh
and ax, 7F7Fh
retn
sub_1BD endp
; =============== S U B R O U T I N E =======================================
sub_1CF proc near
mov bx, dx
mov di, 0A000h
mov es, di
assume es:nothing
mov di, ax
mov dx, ax
xor ax, ax
xor cx, cx
loc_1DE:
mov ax, cs:[bx]
cmp al, 24h
jz short loc_1F9
xchg ah, al
call sub_1BD
xchg ah, al
sub al, 20h
stosw
or ah, 80h
stosw
inc bx
inc bx
inc cx
inc cx
jmp short loc_1DE
; ---------------------------------------------------------------------------
loc_1F9:
mov di, 0A200h
mov es, di
assume es:nothing
mov di, dx
mov ax, 41h
loc_203:
dec cx
stosw
jz short locret_209
jmp short loc_203
; ---------------------------------------------------------------------------
locret_209:
retn
sub_1CF endp
; ---------------------------------------------------------------------------
ZUNP dw 'ZU', 'NP'
dword_20E dd 0
dword_212 dd 0
byte_216 db 0
aVVtvVVrvsvnvog db '<27>ނ<EFBFBD><DE82>݂ɂr<C982>s<EFBFBD>n<EFBFBD>o<EFBFBD>L<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȃ<EFBFBD>$'
asc_23A db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǝv<C68E><76><EFBFBD>́B<CC81>i<EFBFBD>Q<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>͂ˁj$'
aBivrvsvnvoglbV db '<27>i<EFBFBD>r<EFBFBD>s<EFBFBD>n<EFBFBD>o<EFBFBD>L<EFBFBD>[<5B>Ŗ߂<C596><DF82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>˂<EFBFBD><CB82>j<EFBFBD>@$'
aB@b@b@b@b@b@b@ db '<27>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@<40>@$'
aVV db '<27>Ȃ<EFBFBD><C882>łb<C582>n<EFBFBD>o<EFBFBD>x<EFBFBD>L<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482><EFBFBD>$'
aVivBBbvVVmbBbb db '<27><><EFBFBD>ȁ`<60>B<EFBFBD>ӂ<EFBFBD><D382><EFBFBD><EFBFBD>`<60>B<EFBFBD>@<40>@<40>i<EFBFBD><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>x<EFBFBD>A$'
aVbvnvovxglbIqv db '<27>b<EFBFBD>n<EFBFBD>o<EFBFBD>x<EFBFBD>L<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD>Ζ߂<CE96><DF82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>˂<EFBFBD><CB82>j$'
; =============== S U B R O U T I N E =======================================
sub_30C proc near
mov dx, offset aIntvectorSetPr ; "\r\n\r\nINTvector set program zuninit.com "...
mov ah, 9
int 21h ; DOS - PRINT STRING
; DS:DX -> string terminated by "$"
mov ax, 3506h
int 21h ; DOS - 2+ - GET INTERRUPT VECTOR
; AL = interrupt number
; Return: ES:BX = value of interrupt vector
cmp es:ZUNP+0, 'ZU'
jnz short loc_32F
cmp es:ZUNP+2, 'NP'
jnz short loc_32F
mov ax, 1
jmp short locret_332
; ---------------------------------------------------------------------------
loc_32F:
mov ax, 0
locret_332:
retn
sub_30C endp
; =============== S U B R O U T I N E =======================================
start_0 proc near
mov si, 81h
loc_336:
lodsb
cmp al, 0Dh
jz short loc_347
cmp al, '/'
jz short loc_351
cmp al, '-'
jz short loc_351
cmp al, ' '
jbe short loc_336
loc_347:
call sub_30C
test ax, ax
jz short loc_36C
jmp loc_3ED
; ---------------------------------------------------------------------------
loc_351:
lodsb
cmp al, ' '
ja short loc_359
jmp loc_3FF
; ---------------------------------------------------------------------------
loc_359:
and al, 0DFh
cmp al, 'R'
jz short loc_362
jmp loc_3FF
; ---------------------------------------------------------------------------
loc_362:
call sub_30C
test ax, ax
jnz short loc_3B0
jmp loc_3F6
; ---------------------------------------------------------------------------
loc_36C:
mov ah, 35h
mov al, 6
int 21h ; DOS - 2+ - GET INTERRUPT VECTOR
; AL = interrupt number
; Return: ES:BX = value of interrupt vector
mov word ptr cs:dword_212+0, bx
mov word ptr cs:dword_212+2, es
mov dx, offset sub_103
mov ax, 2506h
int 21h ; DOS - SET INTERRUPT VECTOR
; AL = interrupt number
; DS:DX = new vector to be used for specified interrupt
mov ah, 35h
mov al, 5
int 21h ; DOS - 2+ - GET INTERRUPT VECTOR
; AL = interrupt number
; Return: ES:BX = value of interrupt vector
mov word ptr cs:dword_20E+0, bx
mov word ptr cs:dword_20E+2, es
mov dx, offset sub_115
mov ax, 2505h
int 21h ; DOS - SET INTERRUPT VECTOR
; AL = interrupt number
; DS:DX = new vector to be used for specified interrupt
mov dx, offset aVVxvVVGbgvgkvi ; "<22><><EFBFBD><EFBFBD><E582B1><EFBFBD>ƃ<EFBFBD><C683><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\n\r\n$"
mov ah, 9
int 21h ; DOS - PRINT STRING
; DS:DX -> string terminated by "$"
mov dx, offset sub_30C
mov cl, 4
shr dx, cl
inc dx
mov ax, 3100h
int 21h ; DOS - DOS 2+ - TERMINATE BUT STAY RESIDENT
; AL = exit code, DX = program size, in paragraphs
; ---------------------------------------------------------------------------
loc_3B0:
push ds
mov dx, word ptr es:dword_212+0
mov ds, word ptr es:dword_212+2
mov ax, 2506h
int 21h ; DOS - SET INTERRUPT VECTOR
; AL = interrupt number
; DS:DX = new vector to be used for specified interrupt
mov dx, word ptr es:dword_20E+0
mov ds, word ptr es:dword_20E+2
mov ax, 2505h
int 21h ; DOS - SET INTERRUPT VECTOR
; AL = interrupt number
; DS:DX = new vector to be used for specified interrupt
pop ds
push es
mov es, word ptr es:2Ch
assume es:nothing
mov ah, 49h
int 21h ; DOS - 2+ - FREE MEMORY
; ES = segment address of area to be freed
pop es
mov ah, 49h
int 21h ; DOS - 2+ - FREE MEMORY
; ES = segment address of area to be freed
mov dx, offset aGbgvgkvivcpVjv ; "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĂȂ<C482><C882>Ȃ<EFBFBD><C882><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǁA?"...
jnb short loc_3E7
mov dx, offset aGbgvgki ; "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>G<EFBFBD><47><EFBFBD>[<5B>ł<EFBFBD><C582>B : zuninit.com\r\n$"...
loc_3E7:
mov ah, 9
int 21h ; DOS - PRINT STRING
; DS:DX -> string terminated by "$"
jmp short loc_408
; ---------------------------------------------------------------------------
loc_3ED:
mov dx, offset aVVVPatuvVVsv ; "<22><><EFBFBD>łɏ풓<C98F><ED9293><EFBFBD>Ă<EFBFBD><C482><EFBFBD>\r\n\r\n$"
mov ah, 9
int 21h ; DOS - PRINT STRING
; DS:DX -> string terminated by "$"
jmp short loc_408
; ---------------------------------------------------------------------------
loc_3F6:
mov dx, offset aVVBapatuvVVVvv ; "<22>܂<EFBFBD><DC82>A<EFBFBD><EFBFBD><ED9293><EFBFBD>ĂȂ<C482><C882>킟\r\n\r\n$"
mov ah, 9
int 21h ; DOS - PRINT STRING
; DS:DX -> string terminated by "$"
jmp short loc_408
; ---------------------------------------------------------------------------
loc_3FF:
mov dx, offset aICbxscVGigvgvg ; "<22>Ӗ<EFBFBD><D396>s<EFBFBD><73><EFBFBD>ȃI<C883>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD>I<EFBFBD>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "...
mov ah, 9
int 21h ; DOS - PRINT STRING
; DS:DX -> string terminated by "$"
jmp short $+2
loc_408:
mov ax, 4C00h
int 21h ; DOS - 2+ - QUIT WITH EXIT CODE (EXIT)
start_0 endp ; AL = exit code
; ---------------------------------------------------------------------------
aIntvectorSetPr db 0Dh,0Ah
db 0Dh,0Ah
db 'INTvector set program zuninit.com Version1.01 (c)zun 1998',0Dh,0Ah,'$'
aVVxvVVGbgvgkvi db '<27><><EFBFBD><EFBFBD><E582B1><EFBFBD>ƃ<EFBFBD><C683><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0Dh,0Ah
db 0Dh,0Ah,'$'
aVVVPatuvVVsv db '<27><><EFBFBD>łɏ풓<C98F><ED9293><EFBFBD>Ă<EFBFBD><C482><EFBFBD>',0Dh,0Ah
db 0Dh,0Ah,'$'
aGbgvgkvivcpVjv db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĂȂ<C482><C882>Ȃ<EFBFBD><C882><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǁA<C781><41><EFBFBD><EFBFBD><EFBFBD>Ƃ܂<C682><DC82><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>˂<EFBFBD>',0Dh,0Ah
db 0Dh,0Ah,'$'
aVVBapatuvVVVvv db '<27>܂<EFBFBD><DC82>A<EFBFBD><EFBFBD><ED9293><EFBFBD>ĂȂ<C482><C882>킟',0Dh,0Ah
db 0Dh,0Ah,'$'
aICbxscVGigvgvg db '<27>Ӗ<EFBFBD><D396>s<EFBFBD><73><EFBFBD>ȃI<C883>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD>I<EFBFBD>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -R<>̂݁j',0Dh,0Ah,'$'
aGbgvgki db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>G<EFBFBD><47><EFBFBD>[<5B>ł<EFBFBD><C582>B : zuninit.com',0Dh,0Ah
db '$<24><><EFBFBD>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͂T<CD82>U<EFBFBD>O<EFBFBD>j<EFBFBD>ȏ<EFBFBD><C88F>󂯂Ƃ<F382AF82><C682>ĉ<EFBFBD><C489><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0Dh,0Ah,'$'
end start