Function at 0x404740
Capabilities:
Hide graphical window
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x84c
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
push 0x800
push edi
push 0x41b700
mov byte [esp + 0x23], 0
call dword [sym.imp.Platform.dll_void___stdcall_safe_strncpy_char___char_const___int_]
mov al, byte [0x41bf38]
test al, al
mov esi, dword [sym.imp.Platform.dll_char____stdcall_strstrx_char_const___char_const__]
jne 0x4047d4
mov ax, word [0x415380]
mov cl, byte [0x415382]
lea edx, [esp + 0xc]
push edx
mov word [esp + 0x10], ax
mov byte [esp + 0x12], cl
call fcn.004044a0
add esp, 4
push str._layout
push edi
call esi
mov ebx, eax
test ebx, ebx
je 0x4047c7
push str._layout
call dword [sym.imp.Platform.dll_int___stdcall_strlenx_char_const__]
add ebx, eax
lea eax, [esp + 0xc]
push eax
push 0x415bd8
push ebx
call fcn.0040605e
add esp, 0xc
lea ecx, [esp + 0xc]
push ecx
call fcn.00401110
add esp, 4
push str._debug
push edi
call esi
test eax, eax
je 0x4047eb
push 0x3a98
call dword [sym.imp.KERNEL32.dll_Sleep]
push str._heap
push edi
call esi
mov ebx, eax
test ebx, ebx
je 0x404816
push str._heap
call dword [sym.imp.Platform.dll_int___stdcall_strlenx_char_const__]
add ebx, eax
push ebx
call dword [sym.imp.Platform.dll_int___stdcall_atoix_char_const__]
test eax, eax
jle 0x404816
mov dword [0x419054], eax
push str._hunk
push edi
call esi
mov ebx, eax
test ebx, ebx
je 0x404841
push str._hunk
call dword [sym.imp.Platform.dll_int___stdcall_strlenx_char_const__]
add ebx, eax
push ebx
call dword [sym.imp.Platform.dll_int___stdcall_atoix_char_const__]
test eax, eax
jle 0x404841
mov dword [0x419058], eax
push str._dedicated
push edi
call esi
test eax, eax
je 0x404854
mov byte [0x41bf38], 1
push str._fullscreen
push edi
call esi
test eax, eax
je 0x404867
mov byte [0x419050], 1
push str._windowed
push edi
call esi
test eax, eax
je 0x40487a
mov byte [0x419050], 0
push str._toconsole
push edi
call esi
test eax, eax
je 0x404892
mov byte [0x41bf2d], 1
mov byte [esp + 0x17], 1
mov edx, dword [0x419054]
xor ebx, ebx
push ebx
shl edx, 0x14
push edx
lea eax, [esp + 0x50]
push eax
call dword [sym.imp.Platform.dll_class_GbxResult___stdcall_MembankInitialize_int__char_const__]
lea ecx, [esp + 0x48]
call dword [sym.imp.Platform.dll_public:_void___thiscall_GbxResult::destructor_void_]
push 1
lea ecx, [esp + 0x4c]
push ecx
call dword [sym.imp.Platform.dll_class_GbxResult___stdcall_MembankSetEnsureStatus_enum_Membank::MemEnsureStatusState_]
lea ecx, [esp + 0x48]
call dword [sym.imp.Platform.dll_public:_void___thiscall_GbxResult::destructor_void_]
mov al, byte [0x41bf38]
test al, al
jne 0x4048f7
push 4
call fcn.004013b0
add esp, 4
cmp eax, ebx
je 0x4048f0
push str.7B9C6EAB_E1DD_4FE5_AE85_57A7CCDD608A
mov ecx, eax
call fcn.00403a50
jmp 0x4048f2
xor eax, eax
mov dword [0x41bf3c], eax
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
push str.MSWHEEL_ROLLMSG
call dword [sym.imp.USER32.dll_RegisterWindowMessageA]
push ebx
push 0x41bf1c
push ebx
push 3
mov dword [0x41bf28], eax
call dword [sym.imp.USER32.dll_SystemParametersInfoA]
mov edx, dword [ebp + 8]
push ebx
mov dword [0x41bf18], eax
mov dword [0x41b698], edx
call fcn.00406025
push eax
call fcn.00405ff6
add esp, 8
push str._safe
push edi
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x48], 1
mov byte [esp + 0x14], 0
mov byte [esp + 0x18], 0
call esi
test eax, eax
jne 0x40499b
mov al, byte [0x41bf38]
test al, al
jne 0x40499b
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x40]
push ecx
lea edx, [esp + 0x4c]
push edx
lea eax, [esp + 0x38]
push eax
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x2c]
push edx
call fcn.00403fe0
add esp, 0x18
push str._nosound
push edi
call esi
test eax, eax
je 0x4049ac
mov byte [esp + 0xc], 1
push str._width
push edi
call esi
mov ebx, eax
test ebx, ebx
je 0x4049d2
push str._width
call dword [sym.imp.Platform.dll_int___stdcall_strlenx_char_const__]
add ebx, eax
push ebx
call dword [sym.imp.Platform.dll_int___stdcall_atoix_char_const__]
mov dword [esp + 0x18], eax
push str._height
push edi
call esi
mov ebx, eax
test ebx, ebx
je 0x4049f8
push str._height
call dword [sym.imp.Platform.dll_int___stdcall_strlenx_char_const__]
add ebx, eax
push ebx
call dword [sym.imp.Platform.dll_int___stdcall_atoix_char_const__]
mov dword [esp + 0x1c], eax
push str._depth
push edi
call esi
mov ebx, eax
test ebx, ebx
je 0x404a1e
push str._depth
call dword [sym.imp.Platform.dll_int___stdcall_strlenx_char_const__]
add ebx, eax
push ebx
call dword [sym.imp.Platform.dll_int___stdcall_atoix_char_const__]
mov dword [esp + 0x2c], eax
push 0x415b28
push edi
call esi
mov ebx, eax
test ebx, ebx
je 0x404a44
push 0x415b28
call dword [sym.imp.Platform.dll_int___stdcall_strlenx_char_const__]
add ebx, eax
push ebx
call dword [sym.imp.Platform.dll_int___stdcall_atoix_char_const__]
mov dword [esp + 0x3c], eax
push str._vsync
push edi
call esi
mov ebx, eax
test ebx, ebx
je 0x404a6a
push str._vsync
call dword [sym.imp.Platform.dll_int___stdcall_strlenx_char_const__]
add ebx, eax
push ebx
call dword [sym.imp.Platform.dll_int___stdcall_atoix_char_const__]
mov dword [esp + 0x40], eax
push str._hwinfo
push edi
call esi
test eax, eax
je 0x404a7b
mov byte [esp + 0x10], 1
push str._fullscreen
push edi
call esi
test eax, eax
je 0x404a8e
mov byte [0x419050], 1
push str._windowed
push edi
call esi
test eax, eax
je 0x404aa1
mov byte [0x419050], 0
push str.connect
push edi
call esi
test eax, eax
jne 0x404ab9
push str.map
push edi
call esi
test eax, eax
je 0x404abe
mov byte [esp + 0x17], 1
mov eax, dword [esp + 0x18]
test eax, eax
jne 0x404ace
mov dword [esp + 0x18], 0x320
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x404ade
mov dword [esp + 0x1c], 0x258
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x404aee
mov dword [esp + 0x2c], 0x20
call fcn.00404210
mov ecx, dword [esp + 0x18]
mov esi, eax
mov eax, dword [esp + 0x1c]
push eax
push ecx
call fcn.00403f60
call fcn.00403ca0
push str.engine.dll
call fcn.00403920
mov al, byte [0x41bf38]
add esp, 0xc
test al, al
jne 0x404b2c
push str.gui.dll
call fcn.004039d0
add esp, 4
mov ebx, 1
push ebx
call dword [0x41b5fc]
add esp, 4
call dword [0x41b61c]
mov al, byte [0x41bf38]
test al, al
jne 0x404c74
push str.RenderD3D.dll
call fcn.004015c0
add esp, 4
test al, al
jne 0x404b8f
push 0x800
push str.Failed_to_load_RenderD3D.dll
lea edx, [esp + 0x60]
push edx
call dword [sym.imp.Platform.dll_void___stdcall_safe_strncpy_char___char_const___int_]
push 0x30
push str.ERROR
lea eax, [esp + 0x60]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0xffffffffffffffff
call fcn.0040551c
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x3c]
push ecx
mov ecx, dword [esp + 0x44]
test ecx, ecx
mov ecx, dword [esp + 0x48]
setne dl
push edx
mov edx, dword [esp + 0x34]
push eax
mov eax, dword [0x41bf14]
push ecx
mov ecx, dword [0x41bf10]
push edx
sub eax, dword [0x41bf0c]
xor edx, edx
mov dl, byte [0x419050]
push eax
sub ecx, dword [0x41bf08]
push ecx
push edx
call fcn.004019a0
add esp, 0x20
test al, al
je 0x404c60
mov al, byte [0x419050]
test al, al
jne 0x404c4e
mov edx, dword [0x41bf0c]
mov eax, dword [0x41bf14]
mov ecx, dword [0x41bf10]
push ebx
sub eax, edx
mov edx, dword [0x41bf00]
push eax
sub ecx, dword [0x41bf08]
mov eax, dword [0x41bf04]
push ecx
mov ecx, dword [0x41bf34]
push edx
push eax
push ecx
call dword [sym.imp.USER32.dll_MoveWindow]
call dword [sym.imp.USER32.dll_ReleaseCapture]
mov edx, dword [0x41bf34]
push edx
call dword [sym.imp.USER32.dll_SetCapture]
mov ecx, dword [0x41bf34]
lea eax, [esp + 0x48]
push eax
push ecx
call dword [sym.imp.USER32.dll_GetWindowRect]
lea edx, [esp + 0x48]
push edx
call dword [sym.imp.USER32.dll_ClipCursor]
call fcn.004011b0
push 0
call dword [0x41b5f8]
add esp, 4
jmp 0x404c79
push str.d3df.txt
push str.Failed_to_initialize_Direct3D_n_nPlease_ensure_DirectX_8.1_or_newer_is_installed__and_video_drivers_are_up_to_date.
call fcn.00404160
add esp, 8
jmp 0x404c79
call fcn.00403500
push ebx
lea ecx, [esp + 0x14]
call dword [sym.imp.Platform.dll_public:_void___thiscall_MembankUsageType::constructor_enum_Membank::MemPlacementHint_]
mov eax, dword [0x419058]
shl eax, 0x14
push eax
mov dword [0x41bf44], eax
call dword [sym.imp.Platform.dll_void____stdcall_mallocx_int_]
lea ecx, [esp + 0x10]
mov dword [0x41bf40], eax
call dword [sym.imp.Platform.dll_public:_void___thiscall_MembankUsageType::destructor_void_]
call fcn.00403aa0
mov al, byte [0x41bf38]
test al, al
jne 0x404cba
call fcn.00403bc0
mov eax, dword [esp + 0xc]
mov ecx, dword [0x41bf44]
mov edx, dword [0x41bf40]
push esi
push eax
push 0
push 0x41bf34
push 0x41b6a0
push ecx
push edx
push 0x41b700
call dword [0x41b614]
mov eax, dword [0x41bf00]
mov ecx, dword [0x41bf04]
push eax
push ecx
call dword [0x41b618]
push ebx
call dword [0x41b648]
add esp, 0x2c
call dword [0x41b5f4]
mov al, byte [0x41bf38]
test al, al
jne 0x404d65
mov edx, dword [0x41bf34]
mov esi, dword [sym.imp.USER32.dll_ShowWindow]
push 5
push edx
call esi
call dword [0x41b61c]
mov eax, dword [0x41bf34]
push 5
push eax
call esi
push 0
call dword [sym.imp.USER32.dll_ShowCursor]
mov al, byte [esp + 0x17]
test al, al
jne 0x404d65
call dword [0x41b5b0]
mov edx, dword [eax]
push str.gui_Scripts_intro.txt
mov ecx, eax
call dword [edx + 0x10]
mov esi, eax
call dword [0x41b5b0]
mov edx, dword [eax]
push ebx
push esi
mov ecx, eax
call dword [edx + 0x24]
push edi
call fcn.00403e90
push 0
call dword [0x41b648]
add esp, 8
call fcn.00403d70
fstp qword [esp + 0x30]
mov al, byte [0x41bf38]
test al, al
je 0x404e76
push 0
mov dword [esp + 0x10], ebx
call dword [0x41b5f8]
call fcn.00403d70
fstp qword [esp + 0x24]
fld qword [esp + 0x24]
lea eax, [esp + 0x10]
fstp dword [esp + 0x14]
push eax
fld dword [esp + 0x18]
push ebx
fld qword [esp + 0x3c]
fstp dword [esp + 0x1c]
fsub dword [esp + 0x1c]
fstp dword [esp + 0x1c]
mov ecx, dword [esp + 0x1c]
push ecx
call dword [0x41b608]
add esp, 0x10
mov esi, eax
call fcn.00403780
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], eax
call dword [0x41b5e0]
mov eax, dword [esp + 0xc]
mov edi, 4
cmp eax, edi
je 0x404f68
nop
cmp esi, 3
je 0x404f68
push 0
mov dword [esp + 0x10], ebx
call dword [0x41b5f8]
call fcn.00403d70
fstp qword [esp + 0x24]
fld qword [esp + 0x24]
lea ecx, [esp + 0x10]
fstp dword [esp + 0x14]
push ecx
fld dword [esp + 0x18]
push ebx
fld qword [esp + 0x3c]
fstp dword [esp + 0x1c]
fsub dword [esp + 0x1c]
fstp dword [esp + 0x1c]
mov edx, dword [esp + 0x1c]
push edx
call dword [0x41b608]
add esp, 0x10
mov esi, eax
call fcn.00403780
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], ecx
call dword [0x41b5e0]
cmp dword [esp + 0xc], edi
jne 0x404e00
jmp 0x404f68
mov edi, dword [sym.imp.USER32.dll_GetCursorPos]
mov ebx, dword [sym.imp.USER32.dll_ScreenToClient]
mov dword [esp + 0x10], 1
call fcn.00403d70
fstp qword [esp + 0x20]
fld qword [esp + 0x20]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
fstp dword [esp + 0xc]
fld dword [esp + 0xc]
xor ecx, ecx
fld qword [esp + 0x30]
mov cl, byte [0x41bf2c]
fstp dword [esp + 0xc]
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], eax
fsub dword [esp + 0xc]
fstp dword [esp + 0xc]
push ecx
call dword [0x41b5f8]
mov al, byte [0x41bf2c]
add esp, 4
test al, al
jne 0x404f25
lea edx, [esp + 0x48]
push edx
call edi
mov ecx, dword [0x41bf34]
lea eax, [esp + 0x48]
push eax
push ecx
call ebx
call dword [0x41b5b0]
mov ecx, dword [esp + 0x4c]
mov edx, dword [eax]
push ecx
mov ecx, dword [esp + 0x4c]
push ecx
mov ecx, eax
call dword [edx + 0x40]
mov eax, dword [esp + 0xc]
lea edx, [esp + 0x10]
push edx
push 1
push eax
call dword [0x41b608]
add esp, 0xc
mov esi, eax
call dword [0x41b5e0]
jmp 0x404f58
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esp + 0xc]
lea ecx, [esp + 0x10]
push ecx
push 1
push edx
call dword [0x41b608]
mov esi, eax
mov eax, dword [0x419f24]
mov ecx, dword [eax + 4]
mov edx, dword [ecx + 4]
lea ecx, [edx + eax + 4]
mov eax, dword [ecx]
add esp, 0xc
call dword [eax + 0x10]
cmp dword [esp + 0x10], 4
je 0x404f68
cmp esi, 3
jne 0x404e82
push 2
call dword [0x41b5fc]
add esp, 4
call fcn.00401ea0
mov al, byte [0x41bf38]
test al, al
jne 0x404f87
call dword [0x41b624]
call fcn.004011b0
push 3
call dword [0x41b5fc]
mov al, byte [0x41bf38]
add esp, 4
test al, al
jne 0x404fa6
call dword [0x41b5ac]
call dword [0x41b610]
call fcn.00403550
mov ecx, dword [0x41bf40]
push ecx
call dword [sym.imp.Platform.dll_void___stdcall_freex_void__]
mov al, byte [0x41bf38]
xor edi, edi
test al, al
mov dword [0x41bf40], edi
mov dword [0x41bf44], edi
jne 0x404ff2
call fcn.004045e0
call fcn.00401d30
call fcn.00401db0
mov al, byte [0x41bf38]
test al, al
jne 0x404ff2
call fcn.004039b0
call fcn.00403990
mov eax, dword [0x41bf3c]
cmp eax, edi
mov esi, eax
je 0x405014
mov edx, dword [eax]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004013d0
add esp, 4
lea eax, [esp + 0x48]
push eax
mov dword [0x41bf3c], edi
call dword [sym.imp.Platform.dll_class_GbxResult___stdcall_MembankShutdown_void_]
lea ecx, [esp + 0x48]
call dword [sym.imp.Platform.dll_public:_void___thiscall_GbxResult::destructor_void_]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10