Function at 0x402210
Capabilities:
Accept command line arguments
Get file size
Get process heap flags
Read file on windows
Set console window title
Set current directory
Terminate process

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff8
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x530
mov eax, dword [ecx + 4]
mov edi, eax
mov dword [ebp - 0x4fc], eax
call dbg.__main
mov eax, dword [edi + 4]
test eax, eax
je 0x40288f
mov edi, str.__app_name
mov ecx, 0xb
mov esi, eax
repe cmpsb byte [esi], byte es:[edi]
seta dl
sbb dl, 0
test dl, dl
jne 0x4026ca
mov eax, dword [ebp - 0x4fc]
mov edi, dword [eax + 8]
mov dword [ebp - 0x500], edi
test edi, edi
je 0x40288f
lea edi, [eax + 0xc]
mov eax, dword [edi]
test eax, eax
je 0x402663
mov ebx, dword [edi + 4]
lea eax, [edi + 4]
mov dword [ebp - 0x4f0], eax
test ebx, ebx
je 0x40265d
mov esi, eax
xor eax, eax
mov dword [ebp - 0x4f8], edi
mov edi, eax
movzx edx, byte [ebx]
xor eax, eax
test dl, dl
sete al
mov dword [ebp - 0x4ec], eax
je 0x402591
mov eax, ebx
xor ecx, ecx
jmp 0x4022e7
cmp dl, 0x20
je 0x402580
cmp dl, 9
je 0x402580
cmp dl, 0x22
je 0x402570
xor ecx, ecx
add eax, 1
movzx edx, byte [eax]
test dl, dl
je 0x4022f9
cmp dl, 0x5c
jne 0x4022c0
add eax, 1
movzx edx, byte [eax]
add ecx, 1
test dl, dl
jne 0x4022e7
sub eax, ebx
add eax, 1
add esi, 4
add edi, eax
mov ebx, dword [esi]
mov eax, dword [ebp - 0x4ec]
lea edi, [edi + eax*2]
test ebx, ebx
jne 0x4022a2
mov dword [ebp - 0x4f4], edi
mov esi, dword [ebp - 0x4f4]
mov edi, dword [ebp - 0x4f8]
test esi, esi
je 0x402669
lea edx, [esi + 1]
mov dword [esp + 4], 0
mov dword [esp + 8], edx
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
mov dword [ebp - 0x4f8], eax
test eax, eax
je 0x4027b8
mov esi, dword [ebp - 0x4f4]
mov eax, 0xffffffff
mov ecx, dword [ebp - 0x4f8]
mov ebx, dword [edi + 4]
cmp esi, 0x100
lea edx, [ecx + 1]
cmovl eax, esi
mov byte [ecx], al
test ebx, ebx
je 0x40244b
lea esi, [esi]
nop
movzx ecx, byte [ebx]
xor eax, eax
test cl, cl
sete al
mov dword [ebp - 0x4ec], eax
je 0x40287a
mov edi, ebx
mov eax, ecx
xor esi, esi
jmp 0x4023c2
cmp al, 0x22
je 0x402645
add edi, 1
movzx eax, byte [edi]
test al, al
je 0x4023e6
cmp al, 0x20
je 0x4023ca
cmp al, 9
jne 0x4023b0
test esi, esi
jne 0x4025b0
add edi, 1
movzx eax, byte [edi]
mov dword [ebp - 0x4ec], 1
test al, al
jne 0x4023c2
mov edi, dword [ebp - 0x4ec]
test edi, edi
jne 0x402630
mov edi, edx
test esi, esi
jne 0x4025c7
mov dword [esp + 4], ebx
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_strcpy]
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strlen]
add eax, edi
mov ecx, dword [ebp - 0x4ec]
lea edx, [eax + 1]
test ecx, ecx
jne 0x4025a0
mov byte [eax], 0x20
add dword [ebp - 0x4f0], 4
mov eax, dword [ebp - 0x4f0]
mov ebx, dword [eax]
test ebx, ebx
jne 0x402390
mov eax, dword [ebp - 0x4f4]
test eax, eax
je 0x40244e
sub edx, 1
mov byte [edx], 0
test byte [0x404000], 8
jne 0x40273d
lea eax, [ebp - 0x3d0]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetStartupInfoA]
mov eax, 2
sub esp, 4
mov word [ebp - 0x4e4], ax
mov eax, 1
test byte [ebp - 0x3a4], 1
cmovne ax, word [ebp - 0x3a0]
mov word [ebp - 0x4e2], ax
xor eax, eax
mov word [ebp - 0x4d5], ax
mov eax, dword [ebp - 0x4f8]
mov dword [esp], eax
call sym._MapLS_4
sub esp, 4
mov dword [ebp - 0x4d3], eax
lea eax, [ebp - 0x4e4]
mov dword [esp], eax
call sym._MapLS_4
mov dword [ebp - 0x4cb], 0
sub esp, 4
mov dword [ebp - 0x4cf], eax
mov dword [esp], 1
call sym._RestoreThunkLock_4
sub esp, 4
mov dword [esp], str.gdi.exe
call sym._LoadLibrary16_4
sub esp, 4
mov dword [esp], str.user.exe
call sym._LoadLibrary16_4
sub esp, 4
mov dword [esp], str.mmsystem.dll
call sym._LoadLibrary16_4
lea eax, [ebp - 0x4d5]
sub esp, 4
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x500]
mov dword [esp], eax
call sym._LoadModule16_8
movzx ebx, ax
sub esp, 8
cmp bx, 0x1f
jbe 0x4028a8
lea eax, [ebp - 0x184]
mov dword [esp], eax
call sym._ReleaseThunkLock_4
sub esp, 4
mov dword [esp], 0xffffffff
call dword [sym.imp.kernel32.dll_Sleep]
xor eax, eax
sub esp, 4
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
lea edi, [edi + ecx*2 + 1]
xor ecx, ecx
jmp 0x4022dd
mov dword [ebp - 0x4ec], 1
xor ecx, ecx
jmp 0x4022dd
mov eax, 1
jmp 0x4022fe
mov eax, edx
add edx, 1
mov byte [eax], 0x22
mov eax, edx
add edx, 1
jmp 0x402427
mov byte [edx], 0x22
add edx, 1
movzx ecx, byte [ebx]
test cl, cl
je 0x40259b
mov dword [ebp - 0x4ec], 1
xor esi, esi
jmp 0x4025e9
cmp cl, 0x22
je 0x402600
mov byte [edx], cl
xor esi, esi
add ebx, 1
movzx ecx, byte [ebx]
test cl, cl
je 0x402416
mov edx, eax
lea eax, [edx + 1]
cmp cl, 0x5c
jne 0x4025d0
mov byte [edx], 0x5c
add esi, 1
jmp 0x4025d9
lea ecx, [edx + esi + 1]
mov eax, edx
lea esi, [esi]
lea esi, [esi]
add eax, 1
mov byte [eax - 1], 0x5c
cmp ecx, eax
jne 0x402610
lea eax, [edx + esi + 2]
mov byte [ecx], 0x22
xor esi, esi
jmp 0x4025d9
lea edi, [edx + 1]
mov byte [edx], 0x22
test esi, esi
je 0x4023fe
mov edx, edi
jmp 0x4025b6
mov eax, dword [ebp - 0x4ec]
test eax, eax
jne 0x4025b0
mov esi, 1
jmp 0x4023b8
mov edi, dword [ebp - 0x4f0]
mov dword [ebp - 0x4f0], edi
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
mov dword [ebp - 0x4f8], eax
test eax, eax
je 0x4027b8
mov dword [ebp - 0x4f4], 0
mov eax, dword [ebp - 0x4f8]
mov byte [eax], 0
lea edx, [eax + 1]
mov eax, dword [ebp - 0x4f0]
mov ebx, dword [eax]
test ebx, ebx
jne 0x402390
jmp 0x40244e
lea ebx, [ebp - 0x38c]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0x104
mov dword [esp + 8], str..exe
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_SearchPathA]
mov edi, dword [ebp - 0x4fc]
mov dword [ebp - 0x500], ebx
sub esp, 0x18
add edi, 4
test eax, eax
jne 0x402278
mov eax, dword [ebp - 0x4fc]
mov eax, dword [eax + 4]
mov dword [esp], str.winevdm:_unable_to_exec__s:_file_not_found_n
mov dword [esp + 4], eax
call dbg.wine_dbg_printf
mov dword [esp], 1
call dword [sym.imp.kernel32.dll_ExitProcess]
mov dword [esp], global___dbch
call dbg.__wine_dbg_get_channel_flags
test al, 8
je 0x40245e
test byte [0x404000], 8
jne 0x4027c7
mov eax, dword [ebp - 0x4fc]
xor ebx, ebx
mov esi, dword [ebp - 0x4fc]
mov eax, dword [eax]
test eax, eax
jne 0x402781
jmp 0x40245e
add ebx, 1
mov eax, dword [esi + ebx*4]
test eax, eax
je 0x40245e
test byte [0x404000], 8
je 0x402773
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.argv__d_:__s_n
mov dword [esp + 8], str.main
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.1
jmp 0x402773
mov dword [ebp - 0x4f8], 0
jmp 0x402451
call dword [sym.imp.kernel32.dll_GetCommandLineA]
mov dword [esp + 0xc], str.GetCommandLine___s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.main
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.1
test byte [0x404000], 8
je 0x40275a
mov eax, dword [ebp - 0x500]
mov dword [esp + 0xc], str.appname___s_n
mov dword [esp + 8], str.main
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.1
test byte [0x404000], 8
je 0x40275a
mov edi, dword [ebp - 0x4f8]
lea eax, [edi + 1]
mov dword [esp + 0x14], eax
movsx eax, byte [edi]
mov dword [esp + 0xc], str.cmdline___.s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.main
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.1
jmp 0x40275a
lea edi, [edx + 1]
mov byte [edx], 0x22
mov dword [ebp - 0x4ec], 1
jmp 0x4023fe
mov dword [esp], str.Usage:_winevdm.exe____app_name_app.exe__command_line_n_n
call dbg.wine_dbg_printf
mov dword [esp], 1
call dword [sym.imp.kernel32.dll_ExitProcess]
cmp bx, 0xb
je 0x402900
mov eax, dword [ebp - 0x500]
mov dword [esp], str.winevdm:_cant_exec__s:
mov dword [esp + 4], eax
call dbg.wine_dbg_printf
cmp bx, 2
jne 0x4028e4
mov dword [esp], str.file_not_found_n
mov ebx, 2
call dbg.wine_dbg_printf
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_ExitProcess]
cmp bx, 0xb
je 0x402976
mov dword [esp + 4], ebx
mov dword [esp], str.error_d_n
call dbg.wine_dbg_printf
jmp 0x4028db
mov eax, dword [ebp - 0x500]
mov dword [esp + 4], 0x2e
mov dword [esp], eax
mov eax, dword [sym.imp.ucrtbase.dll_strrchr]
mov dword [ebp - 0x510], eax
call eax
mov edi, dword [ebp - 0x4f8]
add edi, 1
mov dword [ebp - 0x4f0], edi
test eax, eax
je 0x40294f
mov dword [esp], eax
mov eax, dword [sym.imp.ucrtbase.dll__stricmp]
mov dword [esp + 4], str..pif
mov dword [ebp - 0x50c], eax
call eax
mov ebx, eax
test eax, eax
je 0x40298c
mov edx, dword [ebp - 0x4f0]
mov eax, dword [ebp - 0x500]
call dbg.start_dosbox
mov eax, dword [ebp - 0x500]
mov dword [esp], str.winevdm:_cant_exec__s:
mov dword [esp + 4], eax
call dbg.wine_dbg_printf
mov dword [esp], str.invalid_program_file_n
mov ebx, 0xb
call dbg.wine_dbg_printf
jmp 0x4028db
mov eax, dword [ebp - 0x500]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0x80000000
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CreateFileA]
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x402e5d
lea eax, [ebp - 0x4e0]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetFileSizeEx]
push edi
push edi
test eax, eax
je 0x402e4c
mov eax, 0x186
cmp eax, dword [ebp - 0x4e0]
sbb ebx, dword [ebp - 0x4dc]
jge 0x402e4c
mov eax, dword [sym.imp.kernel32.dll_SetFilePointer]
mov dword [esp + 0xc], 0
lea edi, [ebp - 0x184]
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], esi
mov dword [ebp - 0x504], eax
call eax
lea eax, [ebp - 0x4e8]
sub esp, 0x10
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.kernel32.dll_ReadFile]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x171
mov dword [esp + 4], edi
mov dword [esp], esi
mov dword [ebp - 0x4f4], eax
call eax
sub esp, 0x14
test eax, eax
je 0x402db3
test byte [0x404000], 8
jne 0x402c50
lea eax, [ebp - 0x4e8]
lea ebx, [ebp - 0x4c7]
mov dword [esp], esi
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x4f4]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x16
mov dword [esp + 4], ebx
call eax
mov eax, dword [sym.imp.ucrtbase.dll_strncmp]
sub esp, 0x14
mov dword [esp + 8], 0xf
mov dword [esp + 4], str.MICROSOFT_PIFEX
mov dword [esp], ebx
mov dword [ebp - 0x508], eax
call eax
mov dword [ebp - 0x4ec], eax
test eax, eax
jne 0x402d86
mov dword [ebp - 0x4fc], edi
movzx eax, word [ebp - 0x4b7]
test ax, ax
js 0x402ede
lea edx, [eax + 0x16]
cmp dword [ebp - 0x4e0], edx
mov edx, dword [ebp - 0x4dc]
sbb edx, 0
jl 0x402ede
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x504]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp], esi
call eax
sub esp, 0x10
test eax, eax
je 0x40309e
lea eax, [ebp - 0x4e8]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x4f4]
mov dword [esp + 8], 0x16
mov dword [esp + 4], ebx
mov dword [esp], esi
call eax
sub esp, 0x14
test eax, eax
je 0x40309e
cmp byte [ebp - 0x4c7], 0
je 0x402aea
test byte [0x404000], 8
jne 0x402bf7
mov dword [esp + 8], 0xb
mov eax, dword [ebp - 0x508]
mov dword [esp + 4], str.WINDOWS_386
mov dword [esp], ebx
call eax
test eax, eax
jne 0x402aea
lea eax, [ebp - 0x4e8]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x288]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x4f4]
mov dword [esp + 8], 0x68
mov dword [esp], esi
call eax
sub esp, 0x14
test byte [0x404000], 8
jne 0x4030a9
mov dword [ebp - 0x4ec], 1
jmp 0x402aea
movzx ecx, word [ebp - 0x4b7]
or edx, 0xffffffff
mov eax, ebx
movzx edi, word [ebp - 0x4b3]
mov dword [ebp - 0x514], ecx
call sym._wine_dbgstr_an
mov ecx, dword [ebp - 0x514]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0xc], str.reading_record__s_size__d_next_0x_x_n
mov dword [esp + 8], 0x406514
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.1
jmp 0x402b86
or edx, 0xffffffff
lea eax, [ebp - 0xdf]
call sym._wine_dbgstr_an
or edx, 0xffffffff
mov ebx, eax
lea eax, [ebp - 0x11f]
call sym._wine_dbgstr_an
mov edx, 0x1e
mov dword [ebp - 0x4ec], eax
lea eax, [ebp - 0x182]
call sym._wine_dbgstr_an
or edx, 0xffffffff
mov dword [ebp - 0x4fc], eax
lea eax, [ebp - 0x160]
call sym._wine_dbgstr_an
mov ecx, dword [ebp - 0x4ec]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], ecx
mov ecx, dword [ebp - 0x4fc]
mov dword [esp + 0xc], str.header:_program__s_title__s_startdir__s_params__s_n
mov dword [esp + 0x14], ecx
mov dword [esp + 8], 0x406514
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.1
test byte [0x404000], 8
je 0x402a84
movzx eax, byte [ebp - 0x9f]
mov dword [esp + 0xc], str.header:_memory_reqd__d_desrd__d_drive__d_videomode__d_n
mov dword [esp + 8], 0x406514
mov dword [esp + 0x1c], eax
movzx eax, byte [ebp - 0x120]
mov dword [esp + 4], global___dbch
mov dword [esp + 0x18], eax
movzx eax, word [ebp - 0x164]
mov dword [esp], 3
mov dword [esp + 0x14], eax
movzx eax, word [ebp - 0x162]
mov dword [esp + 0x10], eax
call sym._wine_dbg_log.constprop.1
test byte [0x404000], 8
je 0x402a84
movzx eax, byte [ebp - 0x14]
mov dword [esp + 0xc], str.header:_flags_0x_x_0x_x_0x_x_n
mov dword [esp + 8], 0x406514
mov dword [esp + 0x18], eax
movzx eax, byte [ebp - 0x15]
mov dword [esp + 4], global___dbch
mov dword [esp + 0x14], eax
movzx eax, byte [ebp - 0x121]
mov dword [esp], 3
mov dword [esp + 0x10], eax
call sym._wine_dbg_log.constprop.1
jmp 0x402a84
test byte [0x404000], 2
je 0x402df2
mov dword [esp + 0xc], str.Invalid_pif_file:_magic_string_not_found_n
mov dword [esp + 8], 0x406514
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.1
test byte [0x404000], 2
je 0x402df2
mov eax, dword [ebp - 0x500]
or edx, 0xffffffff
call sym._wine_dbgstr_an
mov dword [esp + 0xc], str.failed_to_read__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.pif_cmd
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.1
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, dword [ebp - 0x500]
push ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str._s_nInvalid_file_format._Check_your_pif_file.
mov dword [esp], edi
call sym._sprintf
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.16_bit_DOS_subsystem
mov dword [esp + 4], edi
mov dword [esp], 0
call dword [sym.imp.user32.dll_MessageBoxA]
sub esp, 0x10
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], 0xb
jmp 0x402960
test byte [0x404000], 2
jne 0x402ea5
lea edi, [ebp - 0x184]
jmp 0x402df2
test byte [0x404000], 2
je 0x402960
mov eax, dword [ebp - 0x500]
or edx, 0xffffffff
call sym._wine_dbgstr_an
mov dword [esp + 0xc], str.open_file__s_failed_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.pif_cmd
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.1
jmp 0x402960
mov eax, dword [ebp - 0x4e0]
mov dword [esp + 0xc], str.Invalid_pif_file:_size_error__d_n
lea edi, [ebp - 0x184]
mov dword [esp + 8], 0x406514
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.1
jmp 0x402db3
mov edi, dword [ebp - 0x4fc]
lea eax, [ebp - 0x492]
lea ebx, [ebp - 0x453]
mov dword [ebp - 0x4f4], edi
mov edx, edi
movzx ecx, byte [edx + 0x24]
test cl, cl
je 0x402f0d
add eax, 1
mov byte [eax - 1], cl
add edx, 1
cmp eax, ebx
jne 0x402ef8
mov byte [eax], 0
mov ecx, edi
lea eax, [ebp - 0x4b1]
lea ebx, [ebp - 0x493]
movzx edx, byte [ecx + 2]
test dl, dl
je 0x402f33
add eax, 1
mov byte [eax - 1], dl
add ecx, 1
cmp eax, ebx
jne 0x402f1e
cmp dword [ebp - 0x4ec], 0
mov byte [eax], 0
je 0x4031b3
lea eax, [ebp - 0x452]
lea ebx, [ebp - 0x288]
mov dword [ebp - 0x4fc], eax
mov edx, ebx
movzx ecx, byte [edx + 0x28]
test cl, cl
je 0x402f72
add eax, 1
mov byte [eax - 1], cl
lea ecx, [ebp - 0x412]
add edx, 1
cmp eax, ecx
jne 0x402f57
mov byte [eax], 0
lea eax, [ebp - 0x411]
lea ecx, [ebp - 0x3d1]
mov edx, dword [ebp - 0x4f4]
movzx edx, byte [edx + 0x65]
test dl, dl
je 0x402fa0
add eax, 1
mov byte [eax - 1], dl
add dword [ebp - 0x4f4], 1
cmp eax, ecx
jne 0x402f81
cmp dword [ebp - 0x4ec], 0
mov byte [eax], 0
je 0x4032c8
movzx eax, word [ebp - 0x274]
and eax, 0x10
movzx eax, ax
mov dword [ebp - 0x4ec], eax
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
lea eax, [ebp - 0x492]
push ecx
mov dword [esp], eax
mov eax, dword [ebp - 0x510]
mov dword [esp + 4], 0x2e
call eax
test eax, eax
je 0x40300e
mov dword [esp], eax
mov eax, dword [ebp - 0x50c]
mov dword [esp + 4], str..bat
call eax
test eax, eax
jne 0x40300e
test byte [0x404000], 1
jne 0x4032e0
cmp byte [ebp - 0x411], 0
jne 0x403260
lea eax, [ebp - 0x492]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 0x104
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_SearchPathA]
sub esp, 0x18
test eax, eax
je 0x403210
cmp dword [ebp - 0x4ec], 0
jne 0x4031ed
mov eax, dword [ebp - 0x4f8]
cmp byte [eax + 1], 0
jne 0x40308c
cmp byte [ebp - 0x452], 0
mov eax, dword [ebp - 0x4fc]
cmove eax, dword [ebp - 0x4f0]
mov dword [ebp - 0x4f0], eax
mov edx, dword [ebp - 0x4f0]
mov eax, ebx
call dbg.start_dosbox
jmp 0x402960
mov edi, dword [ebp - 0x4fc]
jmp 0x402db3
movzx eax, word [ebp - 0x27c]
mov dword [esp + 0xc], str.386rec:_memory_reqd__d_desd__d_EMS_reqd__d_desd__d_XMS_reqd__d_desd__d_n
mov dword [esp + 8], 0x406514
mov dword [esp + 0x24], eax
movzx eax, word [ebp - 0x27a]
mov dword [esp + 4], global___dbch
mov dword [esp + 0x20], eax
movzx eax, word [ebp - 0x280]
mov dword [esp], 3
mov dword [esp + 0x1c], eax
movzx eax, word [ebp - 0x27e]
mov dword [esp + 0x18], eax
movzx eax, word [ebp - 0x288]
mov dword [esp + 0x14], eax
movzx eax, word [ebp - 0x286]
mov dword [esp + 0x10], eax
call sym._wine_dbg_log.constprop.1
test byte [0x404000], 8
je 0x402be8
movzx eax, word [ebp - 0x274]
mov dword [esp + 0xc], str.386rec:_option_0x_x_memory_0x_x_video_0x_x_n
mov dword [esp + 8], 0x406514
mov dword [esp + 0x18], eax
movzx eax, word [ebp - 0x276]
mov dword [esp + 4], global___dbch
mov dword [esp + 0x14], eax
movzx eax, word [ebp - 0x278]
mov dword [esp], 3
mov dword [esp + 0x10], eax
call sym._wine_dbg_log.constprop.1
test byte [0x404000], 8
je 0x402be8
or edx, 0xffffffff
lea eax, [ebp - 0x260]
call sym._wine_dbgstr_an
mov dword [esp + 0xc], str.386rec:_optional_parameters__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0x406514
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.1
mov dword [ebp - 0x4ec], 1
jmp 0x402aea
lea eax, [ebp - 0x452]
mov edx, edi
lea ebx, [ebp - 0x412]
mov dword [ebp - 0x4fc], eax
movzx ecx, byte [edx + 0xa5]
test cl, cl
je 0x4031df
add eax, 1
mov byte [eax - 1], cl
add edx, 1
cmp eax, ebx
jne 0x4031c7
mov byte [eax], 0
lea ebx, [ebp - 0x288]
jmp 0x402f75
call dword [sym.imp.kernel32.dll_AllocConsole]
test eax, eax
je 0x403066
lea eax, [ebp - 0x4b1]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetConsoleTitleA]
push eax
jmp 0x403066
mov eax, dword [ebp - 0x500]
mov dword [esp + 4], str._s_nInvalid_program_file_name._Check_your_pif_file.
mov dword [esp], edi
mov dword [esp + 8], eax
call sym._sprintf
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.16_bit_DOS_subsystem
mov dword [esp + 4], edi
mov dword [esp], 0
call dword [sym.imp.user32.dll_MessageBoxA]
sub esp, 0x10
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], 2
jmp 0x402960
lea eax, [ebp - 0x411]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetCurrentDirectoryA]
push edx
test eax, eax
jne 0x40301b
test byte [0x404000], 2
jne 0x403309
mov eax, dword [ebp - 0x500]
mov dword [esp + 4], str._s_nInvalid_startup_directory._Check_your_pif_file.
mov dword [esp], edi
mov dword [esp + 8], eax
call sym._sprintf
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.16_bit_DOS_subsystem
mov dword [esp + 4], edi
mov dword [esp], 0
call dword [sym.imp.user32.dll_MessageBoxA]
sub esp, 0x10
jmp 0x40301b
movzx eax, byte [ebp - 0x121]
and eax, 2
movzx eax, al
mov dword [ebp - 0x4ec], eax
jmp 0x402fc3
mov dword [esp + 0xc], str..bat_programs_in_pif_files_are_not_supported._n
mov dword [esp + 8], str.pif_cmd
mov dword [esp + 4], global___dbch
mov dword [esp], 0
call sym._wine_dbg_log.constprop.1
jmp 0x40300e
or edx, 0xffffffff
lea eax, [ebp - 0x411]
call sym._wine_dbgstr_an
mov dword [esp + 0xc], str.Cannot_change_directory__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.pif_cmd
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.1
jmp 0x403285