Function at 0x401000
Capabilities:
Read file on windows
Terminate process
Write file on windows

Disassembly:
sub esp, 0x458
push ebx
mov ebx, dword [esp + 0x460]
push ebp
push esi
push edi
xor edi, edi
xor eax, eax
mov byte [esp + 0x17], 0x41
test ebx, ebx
mov byte [esp + 0x1c0], 0x46
mov word [esp + 0x1c2], 0xa801
mov dword [esp + 0x10], eax
jbe 0x40108b
mov esi, dword [esp + 0x470]
mov eax, dword [esi + eax*4]
mov cl, byte [eax]
cmp cl, 0x2d
je 0x40104a
cmp cl, 0x2f
jne 0x40107e
mov al, byte [eax + 1]
cmp al, 0x53
je 0x40106d
cmp al, 0x73
je 0x40106d
mov eax, dword [str.Usage:_console___S_Server__n]
push eax
call fcn.00401c41
add esp, 4
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push esi
lea ecx, [esp + 0x14]
push ebx
push ecx
call fcn.00401620
add esp, 0xc
mov edi, eax
mov eax, dword [esp + 0x10]
inc eax
cmp eax, ebx
mov dword [esp + 0x10], eax
jb 0x40103b
push 0
push 0x4087a0
call fcn.00401abc
add esp, 8
test edi, edi
je 0x4010e4
push 0x5c
push edi
call fcn.00401a00
add esp, 8
test eax, eax
jne 0x4010c5
push edi
lea edx, [esp + 0x36c]
push str._spipe_sqlconsole
push edx
call fcn.0040199c
add esp, 0xc
jmp 0x4010f9
lea ecx, [eax + 1]
sub eax, edi
push ecx
push edi
push eax
lea edx, [esp + 0x374]
push str._.spipeMSSQL__sconsole
push edx
call fcn.0040199c
add esp, 0x14
jmp 0x4010f9
lea eax, [esp + 0x368]
push str..pipe_sqlconsole
push eax
call fcn.0040199c
add esp, 8
push 0
push 0x80
push 3
push 0
push 0
lea ecx, [esp + 0x37c]
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40113d
mov edx, dword [str.Can_not_connect_to__s._n]
push 0
push edx
push 0x4087c0
call fcn.00401960
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_ExitProcess]
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x1f]
push 1
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40115d
cmp dword [esp + 0x10], 1
je 0x40117e
mov edx, dword [str.Write_to_pipe_failed.OS_Error___d__n]
push eax
push edx
push 0x4087c0
call fcn.00401960
mov esi, dword [sym.imp.KERNEL32.dll_ExitProcess]
add esp, 0xc
push 0xffffffffffffffff
call esi
jmp 0x401184
mov esi, dword [sym.imp.KERNEL32.dll_ExitProcess]
mov ecx, dword [str.Connected_to_SQLServer_on__s_n]
lea eax, [esp + 0x368]
push eax
push ecx
call fcn.00401c41
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
add esp, 8
lea edx, [esp + 0x10]
push 0
push edx
lea eax, [esp + 0x20]
push 0x1a8
push eax
push ebx
call ebp
test eax, eax
jne 0x4011d2
mov ecx, dword [str.Pipe_read_failed.OS_Error__d_n]
push eax
push ecx
push 0x4087c0
call fcn.00401960
add esp, 0xc
push 0xffffffffffffffff
call esi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4015b2
cmp byte [esp + 0x30], 1
je 0x4011f9
mov eax, dword [esp + 0x2c]
lea edx, [esp + 0x30]
push edx
push eax
push str._.s
jmp 0x40153d
mov ecx, dword [esp + 0x32]
mov eax, dword [esp + 0x31]
and ecx, 0xff
and eax, 0xff
cmp ecx, 5
ja case.default.0x401215
jmp dword [ecx*4 + 0x4015fc]
mov ecx, eax
dec ecx
je 0x401261
sub ecx, 0xa
je 0x40124e
sub ecx, 5
je 0x40123a
mov ecx, dword [str.CONSOLE_ERROR_:_Invalid_msg_no__d__param_no__d__pair__n]
push 0
push eax
push ecx
jmp 0x40153d
mov edx, dword [str.Physical_End_of_media_has_been_reached._Countinuing_dump_on_next_tape_n_Hit_any_key_to_continue_n]
push edx
call fcn.00401c41
add esp, 4
jmp 0x401545
mov eax, dword [str.Remove_the_tape._nPress_ENTER_when_removed._n]
push eax
call fcn.00401c41
add esp, 4
jmp 0x401545
mov ecx, dword [str.Remove_the_diskette._nPress_ENTER_when_removed._n]
push ecx
call fcn.00401c41
add esp, 4
jmp 0x401545
mov ecx, eax
sub ecx, 3
je 0x4012bc
sub ecx, 9
je 0x4012a4
dec ecx
je 0x40128b
push 1
jmp 0x401535
mov ecx, dword [str.Mount_first_tape__s._n_Press_enter_when_mounted__or_press_0_to_abort_n]
lea eax, [esp + 0x33]
push eax
push ecx
call fcn.00401c41
add esp, 8
jmp 0x401545
mov eax, dword [str.Change_tapes_and_mount__s._n_Press_ENTER_when_mounted___n_or_press_0_to_abort]
lea edx, [esp + 0x33]
push edx
push eax
call fcn.00401c41
add esp, 8
jmp 0x401545
mov edx, dword [str.Mount_first_diskette_on_drive__s_n_Press_enter_when_mounted__or_press_0_to_abort_n]
lea ecx, [esp + 0x33]
push ecx
push edx
call fcn.00401c41
add esp, 8
jmp 0x401545
mov ecx, eax
sub ecx, 2
je 0x401312
sub ecx, 0xf
je 0x4012ef
push 2
push eax
mov eax, dword [str.CONSOLE_ERROR_:_Invalid_msg_no__d__param_no__d__pair__n]
push eax
jmp 0x40153d
lea edi, [esp + 0x33]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x33]
repne scasb al, byte es:[edi]
mov eax, dword [str.Tape_has_restricted_access._It_expires_day__s_of_19_s_n._Press_enter_to_use_this_diskette__or_type_0_to_change_tapes]
not ecx
dec ecx
lea ecx, [esp + ecx + 0x34]
push ecx
push edx
push eax
jmp 0x40153d
lea edi, [esp + 0x33]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x33]
repne scasb al, byte es:[edi]
mov eax, dword [str.Change_diskettes_and_mount__s_on_drive__s._n_Press_ENTER_when_mounted___n_or_press_0_to_abort]
not ecx
dec ecx
lea ecx, [esp + ecx + 0x34]
push ecx
push edx
push eax
jmp 0x40153d
cmp eax, 7
je 0x401349
mov ecx, dword [str.CONSOLE_ERROR_:_Invalid_msg_no__d__param_no__d__pair__n]
push 3
push eax
push ecx
jmp 0x40153d
lea edi, [esp + 0x33]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x33]
repne scasb al, byte es:[edi]
mov eax, dword [str.Diskette_on__s_has_restricted_access._It_expires_day__s_of]
not ecx
dec ecx
lea esi, [esp + ecx + 0x34]
push esi
push edx
push eax
call fcn.00401c41
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [str._19_s_n._Press_enter_to_use_this_diskette__or_type_0_to_change_tapes]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea ecx, [ecx + esi + 1]
push ecx
push edx
call fcn.00401c41
add esp, 0x14
jmp 0x401545
mov ecx, eax
sub ecx, 4
je 0x401461
sub ecx, 0xa
je 0x40140a
dec ecx
je 0x4013b2
push 4
push eax
mov eax, dword [str.CONSOLE_ERROR_:_Invalid_msg_no__d__param_no__d__pair__n]
push eax
jmp 0x40153d
lea edi, [esp + 0x33]
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [str.Creation_dates_on_tape_differ._nDate_on_this_diskette_is_day__s_of_19_s._n]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea esi, [esp + ecx + 0x34]
lea ecx, [esp + 0x33]
push esi
push ecx
push edx
call fcn.00401c41
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [ecx + esi + 1]
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [ecx + edx + 1]
mov ecx, dword [str.Date_on_previous_diskette_is_day__s_of_19_s._n._Press_enter_to_use_this_diskette_n_or_type_0_to_change_diskettes_n]
push eax
push edx
push ecx
call fcn.00401c41
add esp, 0x18
jmp 0x401545
lea edi, [esp + 0x33]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x33]
repne scasb al, byte es:[edi]
mov eax, dword [str.Tape__s__s_mounted_instead_of]
not ecx
dec ecx
lea esi, [esp + ecx + 0x34]
push esi
push edx
push eax
call fcn.00401c41
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [ecx + esi + 1]
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea ecx, [ecx + edx + 1]
push ecx
push edx
mov edx, dword [str._s__s._n._Press_enter_to_use_this_tape_or_type_0_and_enter_to_change_tapes]
push edx
call fcn.00401c41
add esp, 0x18
jmp 0x401545
lea edi, [esp + 0x33]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x33]
lea esi, [esp + ecx + 0x34]
mov ecx, dword [str.Diskette__s__s_mounted_instead_of]
push esi
push eax
push ecx
call fcn.00401c41
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [ecx + esi + 1]
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [ecx + edx + 1]
mov ecx, dword [str._s__s._n._Press_enter_to_use_this_diskette_or_type_0_and_enter_to_change_diskettes]
push eax
push edx
push ecx
call fcn.00401c41
add esp, 0x18
jmp 0x401545
cmp eax, 5
je 0x4014c2
push 5
jmp 0x401535
lea edi, [esp + 0x33]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x33]
lea esi, [esp + ecx + 0x34]
mov ecx, dword [str.Creation_dates_on__s_differ._nDate_on_this_diskette_is_day__s_of]
push esi
push eax
push ecx
call fcn.00401c41
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edx, [ecx + esi + 1]
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea esi, [ecx + edx + 1]
push esi
push edx
mov edx, dword [str._19_s._nDate_on_previous_diskette_is_day__s_of]
push edx
call fcn.00401c41
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [ecx + esi + 1]
mov ecx, dword [str._19_s._n._Press_enter_to_use_this_diskette_n_or_type_0_to_change_diskettes_n]
push eax
push ecx
call fcn.00401c41
add esp, 0x20
jmp 0x401545
push ecx
mov edx, dword [str.CONSOLE_ERROR_:_Invalid_msg_no__d__param_no__d__pair__n]
push eax
push edx
call fcn.00401c41
add esp, 0xc
push 0x4087a0
call fcn.004017fa
mov ax, word [esp + 0x28]
mov cx, word [esp + 0x2a]
mov edx, dword [esp + 0x2c]
mov word [esp + 0x1d0], ax
lea eax, [esp + 0x1dc]
mov word [esp + 0x1d2], cx
push eax
mov dword [esp + 0x1d8], edx
call fcn.00401799
lea edi, [esp + 0x1e0]
or ecx, 0xffffffff
xor eax, eax
add esp, 8
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x1d0]
mov esi, dword [sym.imp.KERNEL32.dll_ExitProcess]
not ecx
dec ecx
and al, 0xfd
mov dword [esp + 0x1d4], ecx
mov dword [esp + 0x1d0], eax
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x1c8]
push 0x1a8
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4015df
cmp dword [esp + 0x10], 0x1a8
je 0x4011a1
push eax
mov eax, dword [str.Write_to_pipe_failed.OS_Error__d__n_Console_Is_Exiting__n]
push eax
push 0x4087c0
call fcn.00401960
add esp, 0xc
push 0xffffffffffffffff
call esi
jmp 0x4011a1