mirror of https://github.com/nmlgc/ReC98.git
409 lines
9.5 KiB
NASM
409 lines
9.5 KiB
NASM
;
|
||
; +-------------------------------------------------------------------------+
|
||
; | 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 ; "むやみにSTOPキー押したりしない$"
|
||
call sub_1CF
|
||
mov ax, 6F0h
|
||
mov dx, offset asc_23A ; "方がいいと思うの。(ゲーム中はね)$"
|
||
call sub_1CF
|
||
mov ax, 790h
|
||
mov dx, offset aBivrvsvnvoglbV ; "(STOPキーで戻れるよ、ねっ) $"
|
||
call sub_1CF
|
||
mov bl, 1
|
||
jmp short loc_177
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_15A:
|
||
mov ax, 650h
|
||
mov dx, offset aVV ; "なんでCOPYキー押したりしてるの$"
|
||
call sub_1CF
|
||
mov ax, 6F0h
|
||
mov dx, offset aVivBBbvVVmbBbb ; "かな~。ふしぎ~。 (もう一度、$"
|
||
call sub_1CF
|
||
mov ax, 790h
|
||
mov dx, offset aVbvnvovxglbIqv ; "COPYキー押せば戻れるよ、ねっ)$"
|
||
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@ ; " $"
|
||
call sub_1CF
|
||
mov ax, 6F0h
|
||
mov dx, offset aB@b@b@b@b@b@b@ ; " $"
|
||
call sub_1CF
|
||
mov ax, 790h
|
||
mov dx, offset aB@b@b@b@b@b@b@ ; " $"
|
||
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 'むやみにSTOPキー押したりしない$'
|
||
asc_23A db '方がいいと思うの。(ゲーム中はね)$'
|
||
aBivrvsvnvoglbV db '(STOPキーで戻れるよ、ねっ) $'
|
||
aB@b@b@b@b@b@b@ db ' $'
|
||
aVV db 'なんでCOPYキー押したりしてるの$'
|
||
aVivBBbvVVmbBbb db 'かな~。ふしぎ~。 (もう一度、$'
|
||
aVbvnvovxglbIqv db 'COPYキー押せば戻れるよ、ねっ)$'
|
||
|
||
; =============== 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 ; "ちょこっとメモリかりるね\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 ; "メモリから消えてなくなっちゃったけど、?"...
|
||
jnb short loc_3E7
|
||
mov dx, offset aGbgvgki ; "メモリ解放エラーです。 : 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 ; "すでに常駐してるの\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 ; "まだ、常駐してないわぁ\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 ; "意味不明なオプションよぉ(オプションは "...
|
||
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 'ちょこっとメモリかりるね',0Dh,0Ah
|
||
db 0Dh,0Ah,'$'
|
||
aVVVPatuvVVsv db 'すでに常駐してるの',0Dh,0Ah
|
||
db 0Dh,0Ah,'$'
|
||
aGbgvgkvivcpVjv db 'メモリから消えてなくなっちゃったけど、きっとまたあえるよ、ねっ',0Dh,0Ah
|
||
db 0Dh,0Ah,'$'
|
||
aVVBapatuvVVVvv db 'まだ、常駐してないわぁ',0Dh,0Ah
|
||
db 0Dh,0Ah,'$'
|
||
aICbxscVGigvgvg db '意味不明なオプションよぉ(オプションは -Rのみ)',0Dh,0Ah,'$'
|
||
|
||
aGbgvgki db 'メモリ解放エラーです。 : zuninit.com',0Dh,0Ah
|
||
db '$メインメモリは560K以上空けといて下さいね',0Dh,0Ah,'$'
|
||
|
||
end start
|