Function at 0x401090
Capabilities:
Check for time delay via gettickcount
Check if file exists
Get file attributes
Hide graphical window
Read .ini file
Set current directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x407258
push 0x401868
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
mov eax, 0x22c8
call fcn.00401730
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
xor esi, esi
mov dword [ebp - 0x20], esi
mov byte [ebp - 0x7dc], 0
mov ecx, 0x7f
xor eax, eax
lea edi, [ebp - 0x7db]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x4d8], 0
mov ecx, 0x7f
xor eax, eax
lea edi, [ebp - 0x4d7]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x9dc], 0
mov ecx, 0x7f
xor eax, eax
lea edi, [ebp - 0x9db]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dword [ebp - 0x1c], esi
mov dword [ebp - 4], esi
push 0x104
lea eax, [ebp - 0x5dc]
push eax
push esi
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
call ebx
push 0x5c
lea ecx, [ebp - 0x5dc]
push ecx
call fcn.00401700
add esp, 8
mov dword [ebp - 0x98], eax
cmp eax, esi
je 0x4016e0
lea edx, [eax + 1]
lea edi, [ebp - 0xae0]
mov cl, byte [edx]
mov byte [edi], cl
inc edx
inc edi
test cl, cl
jne 0x401153
mov byte [eax], cl
lea edx, [ebp - 0x5dc]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push 0x104
lea eax, [ebp - 0x2d8]
push eax
push esi
call ebx
push 0x2e
lea ecx, [ebp - 0x2d8]
push ecx
call fcn.00401700
add esp, 8
mov dword [ebp - 0x9c], eax
cmp eax, esi
je 0x4016e0
mov byte [eax], 0
dec eax
mov edi, edi
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x4011a0
mov edi, eax
mov edx, dword [str..ini]
mov dword [edi], edx
mov al, byte [0x407250]
mov byte [edi + 4], al
lea ecx, [ebp - 0x2d8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
or edi, 0xffffffff
cmp eax, edi
je 0x4011f5
push 0x104
lea edx, [ebp - 0x1d0]
push edx
push esi
call ebx
push 0x2e
lea eax, [ebp - 0x1d0]
push eax
call fcn.00401700
add esp, 8
mov dword [ebp - 0x7c], eax
cmp eax, esi
jne 0x4011fd
mov dword [ebp - 4], edi
jmp 0x4016e7
mov byte [eax], 0
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x401201
mov edi, eax
mov ecx, dword [str..rgssad]
mov dword [edi], ecx
mov edx, dword [0x407248]
mov dword [edi + 4], edx
lea eax, [ebp - 0x1d0]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x401235
mov byte [ebp - 0x1d0], 0
lea ecx, [ebp - 0x2d8]
push ecx
push 0x200
lea edx, [ebp - 0x7dc]
push edx
push 0x407240
push str.Library
push str.Game
mov edi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
call edi
lea eax, [ebp - 0x2d8]
push eax
push 0x200
lea ecx, [ebp - 0x4d8]
push ecx
push str.Untitled
push str.Title
push str.Game
call edi
lea edx, [ebp - 0x2d8]
push edx
push 0x200
lea eax, [ebp - 0x9dc]
push eax
push 0x407240
push str.Scripts
push str.Game
call edi
mov dword [ebp - 0x74], 8
mov ecx, dword [sym.imp.USER32.dll_DefWindowProcA]
mov dword [ebp - 0x70], ecx
mov dword [ebp - 0x6c], esi
mov dword [ebp - 0x68], esi
mov eax, dword [ebp + 8]
mov dword [ebp - 0x64], eax
push 1
push eax
call dword [sym.imp.USER32.dll_LoadIconA]
mov dword [ebp - 0x60], eax
push 0x7f00
push esi
call dword [sym.imp.USER32.dll_LoadCursorA]
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], esi
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x50], 0x407208
lea edx, [ebp - 0x74]
push edx
call dword [sym.imp.USER32.dll_RegisterClassA]
push esi
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
push esi
push esi
push esi
push esi
push 0x80000000
push 0x80000000
push 0xca0000
lea eax, [ebp - 0x4d8]
push eax
mov ecx, dword [ebp - 0x50]
push ecx
push 0x100
call dword [sym.imp.USER32.dll_CreateWindowExA]
mov ebx, eax
mov dword [ebp - 0x20], ebx
cmp ebx, esi
je 0x4016e0
push 0x1e0
push 0x280
push esi
push esi
lea edx, [ebp - 0x4c]
push edx
call dword [sym.imp.USER32.dll_SetRect]
push 0xfffffffffffffff0
push ebx
mov edi, dword [sym.imp.USER32.dll_GetWindowLongA]
call edi
mov esi, eax
mov dword [ebp - 0xa4], esi
push 0xffffffffffffffec
push ebx
call edi
mov dword [ebp - 0xa8], eax
push eax
push 0
push esi
lea eax, [ebp - 0x4c]
push eax
call dword [sym.imp.USER32.dll_AdjustWindowRectEx]
push 0x20
mov edi, dword [sym.imp.USER32.dll_GetSystemMetrics]
call edi
shl eax, 1
push 0x3d
mov dword [ebp - 0x3c], eax
call edi
mov esi, eax
mov eax, dword [ebp - 0x3c]
sub esi, eax
mov dword [ebp - 0x84], esi
push 0x21
call edi
shl eax, 1
push 0x3e
mov dword [ebp - 0x38], eax
call edi
mov ecx, dword [ebp - 0x38]
sub eax, ecx
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x44]
sub ecx, dword [ebp - 0x4c]
mov dword [ebp - 0x8c], ecx
mov edi, dword [ebp - 0x40]
sub edi, dword [ebp - 0x48]
mov dword [ebp - 0x90], edi
mov eax, esi
sub eax, ecx
cdq
sub eax, edx
mov esi, eax
sar esi, 1
mov dword [ebp - 0xa0], esi
mov eax, dword [ebp - 0x30]
sub eax, edi
cdq
sub eax, edx
sar eax, 1
mov dword [ebp - 0x78], eax
push 0x14
push edi
push ecx
push eax
push esi
push 0
push ebx
call dword [sym.imp.USER32.dll_SetWindowPos]
push 5
push ebx
call dword [sym.imp.USER32.dll_ShowWindow]
push ebx
call dword [sym.imp.USER32.dll_GetDC]
mov esi, eax
mov dword [ebp - 0x88], esi
push 4
call dword [sym.imp.GDI32.dll_GetStockObject]
push eax
lea ecx, [ebp - 0x4c]
push ecx
push esi
call dword [sym.imp.USER32.dll_FillRect]
push esi
push ebx
call dword [sym.imp.USER32.dll_ReleaseDC]
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
mov edi, eax
mov dword [ebp - 0x80], edi
call esi
sub eax, edi
cmp eax, 0x1f4
jae 0x40147f
push 0
push 0
push 0
push 0
lea edx, [ebp - 0xc4]
push edx
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x401431
push 0
push 0
push 0
lea eax, [ebp - 0xc4]
push eax
call dword [sym.imp.USER32.dll_GetMessageA]
test eax, eax
je 0x4016e0
lea ecx, [ebp - 0xc4]
push ecx
call dword [sym.imp.USER32.dll_DispatchMessageA]
jmp 0x401431
lea edx, [ebp - 0x7dc]
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
mov dword [ebp - 0x34], esi
test esi, esi
jne 0x4014ed
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x24], eax
cmp eax, 0x7e
jne 0x4014ab
mov eax, 0x80030002
mov dword [ebp - 0x24], eax
lea ecx, [ebp - 0x7dc]
mov dword [ebp - 0x28], ecx
lea edx, [ebp - 0x28]
push edx
push 0x400
lea ecx, [ebp - 0x16e0]
push ecx
push 0x400
push eax
push 0
push 0x3000
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push 0x10
lea edx, [ebp - 0x4d8]
push edx
lea eax, [ebp - 0x16e0]
push eax
push ebx
jmp 0x4016da
mov dword [ebp - 4], 1
push esi
call section..text
add esp, 4
test eax, eax
jne 0x401540
mov dword [ebp - 0x94], 0x7f
lea ecx, [ebp - 0x7dc]
mov dword [ebp - 0x2c], ecx
lea edx, [ebp - 0x2c]
push edx
push 0x400
lea eax, [ebp - 0xee0]
push eax
push 0x400
push 0x7f
push 0
push 0x3000
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
lea edx, [ebp - 0xee0]
jmp 0x401599
push 0x400
lea ecx, [ebp - 0x1ee0]
push ecx
lea edx, [ebp - 0x2d8]
push edx
call dword [0x409904]
add esp, 0xc
test eax, eax
jne 0x4015bd
push 0x400
lea eax, [ebp - 0x12e0]
push eax
push 1
push esi
call dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [ebp - 0x1ee0]
push ecx
lea edx, [ebp - 0x12e0]
push edx
lea eax, [ebp - 0x1ae0]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea edx, [ebp - 0x1ae0]
lea ecx, [ebp - 0x4d8]
push 0x10
push ecx
push edx
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
call fcn.004017b2
add esp, 8
jmp 0x4016e7
push esi
call dword [0x409910]
add esp, 4
mov edi, str.btest
mov eax, dword [ebp + 0x10]
mov esi, eax
mov ecx, 6
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4015fd
mov byte [ebp - 0x1d0], dl
push str._DEBUG__true
call dword [0x409900]
push str._BTEST__true
call dword [0x409900]
add esp, 8
jmp 0x401631
mov edi, str.debug
mov esi, eax
mov ecx, 6
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x401623
mov byte [ebp - 0x1d0], al
push str._DEBUG__true
call dword [0x409900]
add esp, 4
push str._BTEST__false
call dword [0x409900]
add esp, 4
lea ecx, [ebp - 0x1d0]
push ecx
lea edx, [ebp - 0x9dc]
push edx
push ebx
call dword [0x40990c]
mov esi, eax
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
call fcn.004017b2
add esp, 0x14
mov eax, esi
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
call dword [sym.imp.USER32.dll_MessageBoxA]
mov dword [ebp - 4], 0xffffffff
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10