Function at 0x401280
Capabilities:
Check for time delay via gettickcount
Check if file exists
Get file attributes
Identify system language via api
Read .ini file
Set console window title
Set current directory

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4450
call fcn.004023f0
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 8], eax
push esi
mov dword [ebp - 0x102c], 0
mov dword [ebp - 0x1de4], 0
mov ax, word [0x40c1f0]
mov word [ebp - 0x1028], ax
push 0x3fe
push 0
lea ecx, [ebp - 0x1026]
push ecx
call fcn.00401ca0
add esp, 0xc
mov dx, word [0x40c1f0]
mov word [ebp - 0x2418], dx
push 0x3fe
push 0
lea eax, [ebp - 0x2416]
push eax
call fcn.00401ca0
add esp, 0xc
mov cx, word [0x40c1f0]
mov word [ebp - 0x17a8], cx
push 0x3fe
push 0
lea edx, [ebp - 0x17a6]
push edx
call fcn.00401ca0
add esp, 0xc
mov ax, word [0x40c1f0]
mov word [ebp - 0x1dc8], ax
push 0x3fe
push 0
lea ecx, [ebp - 0x1dc6]
push ecx
call fcn.00401ca0
add esp, 0xc
mov dx, word [0x40c1f0]
mov word [ebp - 0x19c8], dx
push 0x21a
push 0
lea eax, [ebp - 0x19c6]
push eax
call fcn.00401ca0
add esp, 0xc
mov cx, word [0x40c1f0]
mov word [ebp - 0x1258], cx
push 0x21a
push 0
lea edx, [ebp - 0x1256]
push edx
call fcn.00401ca0
add esp, 0xc
mov dword [ebp - 0x214], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x1030], 0
mov dword [ebp - 0x2014], 0
mov dword [ebp - 0x241c], 0
jmp 0x4013c2
mov eax, dword [ebp - 0x241c]
add eax, 1
mov dword [ebp - 0x241c], eax
mov ecx, dword [ebp - 0x241c]
cmp ecx, dword [0x410020]
jge 0x401454
push str.console
mov edx, dword [ebp - 0x241c]
mov eax, dword [0x410024]
mov ecx, dword [eax + edx*4]
push ecx
call fcn.00402030
add esp, 8
test eax, eax
jne 0x4013fb
mov dword [ebp - 4], 1
push str.test
mov edx, dword [ebp - 0x241c]
mov eax, dword [0x410024]
mov ecx, dword [eax + edx*4]
push ecx
call fcn.00402030
add esp, 8
test eax, eax
jne 0x401425
mov dword [ebp - 0x1030], 1
push str.btest
mov edx, dword [ebp - 0x241c]
mov eax, dword [0x410024]
mov ecx, dword [eax + edx*4]
push ecx
call fcn.00402030
add esp, 8
test eax, eax
jne 0x40144f
mov dword [ebp - 0x2014], 1
jmp 0x4013b3
push 0x104
lea edx, [ebp - 0xc28]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x5c
lea eax, [ebp - 0xc28]
push eax
call fcn.00401c30
add esp, 8
mov dword [ebp - 0x13a4], eax
cmp dword [ebp - 0x13a4], 0
jne 0x40148f
xor eax, eax
jmp 0x401c13
mov ecx, dword [ebp - 0x13a4]
add ecx, 2
push ecx
lea edx, [ebp - 0x210]
push edx
call fcn.00401d48
add esp, 8
xor eax, eax
mov ecx, dword [ebp - 0x13a4]
mov word [ecx], ax
lea edx, [ebp - 0xc28]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 0x104
lea eax, [ebp - 0x2010]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x2e
lea ecx, [ebp - 0x2010]
push ecx
call fcn.00401c30
add esp, 8
mov dword [ebp - 0x1038], eax
cmp dword [ebp - 0x1038], 0
jne 0x4014fb
xor eax, eax
jmp 0x401c13
xor edx, edx
mov eax, dword [ebp - 0x1038]
mov word [eax], dx
push str..ini
mov ecx, dword [ebp - 0x1038]
push ecx
call fcn.00401d1a
add esp, 8
lea edx, [ebp - 0x2010]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x401533
xor eax, eax
jmp 0x401c13
push 0x104
lea eax, [ebp - 0x19c8]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x2e
lea ecx, [ebp - 0x19c8]
push ecx
call fcn.00401c30
add esp, 8
mov dword [ebp - 0xa1c], eax
cmp dword [ebp - 0xa1c], 0
jne 0x40156e
xor eax, eax
jmp 0x401c13
xor edx, edx
mov eax, dword [ebp - 0xa1c]
mov word [eax], dx
push str..rgss3a
mov ecx, dword [ebp - 0xa1c]
push ecx
call fcn.00401d1a
add esp, 8
lea edx, [ebp - 0x19c8]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x4015b3
push 0x40c1f0
lea eax, [ebp - 0x19c8]
push eax
call fcn.00401d48
add esp, 8
lea ecx, [ebp - 0x2010]
push ecx
push 0x400
lea edx, [ebp - 0x1028]
push edx
push 0x40c1f0
push 0x40c3b4
push str.Game
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [ebp - 0x2010]
push eax
push 0x400
lea ecx, [ebp - 0x2418]
push ecx
push 0x40c1f0
push str.Library
push str.Game
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea edx, [ebp - 0x2010]
push edx
push 0x400
lea eax, [ebp - 0x17a8]
push eax
push str.Untitled
push str.Title
push str.Game
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea ecx, [ebp - 0x2010]
push ecx
push 0x400
lea edx, [ebp - 0x1dc8]
push edx
push 0x40c1f0
push str.Scripts
push str.Game
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
push 0x21c
lea eax, [ebp - 0x1258]
push eax
lea ecx, [ebp - 0x1028]
push ecx
call section..text
add esp, 0xc
mov dword [ebp - 0x139c], 8
mov edx, dword [sym.imp.USER32.dll_DefWindowProcW]
mov dword [ebp - 0x1398], edx
mov dword [ebp - 0x1394], 0
mov dword [ebp - 0x1390], 0
mov eax, dword [ebp + 8]
mov dword [ebp - 0x138c], eax
push 1
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.USER32.dll_LoadIconW]
mov dword [ebp - 0x1388], eax
push 0x7f00
push 0
call dword [sym.imp.USER32.dll_LoadCursorW]
mov dword [ebp - 0x1384], eax
mov dword [ebp - 0x1380], 0
mov dword [ebp - 0x137c], 0
mov dword [ebp - 0x1378], str.RGSS_Player
lea edx, [ebp - 0x139c]
push edx
call dword [sym.imp.USER32.dll_RegisterClassW]
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
push 0
push 0
push 0
push 0
push 0x80000000
push 0x80000000
push 0xca0000
lea eax, [ebp - 0x17a8]
push eax
mov ecx, dword [ebp - 0x1378]
push ecx
push 0x100
call dword [sym.imp.USER32.dll_CreateWindowExW]
mov dword [ebp - 0x102c], eax
cmp dword [ebp - 0x102c], 0
jne 0x401742
xor eax, eax
jmp 0x401c13
push 0x1a0
push 0x220
push 0
push 0
lea edx, [ebp - 0x1de0]
push edx
call dword [sym.imp.USER32.dll_SetRect]
push 0xfffffffffffffff0
mov eax, dword [ebp - 0x102c]
push eax
call dword [sym.imp.USER32.dll_GetWindowLongW]
mov dword [ebp - 0x1dd0], eax
push 0xffffffffffffffec
mov ecx, dword [ebp - 0x102c]
push ecx
call dword [sym.imp.USER32.dll_GetWindowLongW]
mov dword [ebp - 0x1df0], eax
mov edx, dword [ebp - 0x1df0]
push edx
push 0
mov eax, dword [ebp - 0x1dd0]
push eax
lea ecx, [ebp - 0x1de0]
push ecx
call dword [sym.imp.USER32.dll_AdjustWindowRectEx]
push 0x3d
call dword [sym.imp.USER32.dll_GetSystemMetrics]
mov esi, eax
push 0x20
call dword [sym.imp.USER32.dll_GetSystemMetrics]
shl eax, 1
sub esi, eax
mov dword [ebp - 0x1dec], esi
push 0x3e
call dword [sym.imp.USER32.dll_GetSystemMetrics]
mov esi, eax
push 0x21
call dword [sym.imp.USER32.dll_GetSystemMetrics]
shl eax, 1
sub esi, eax
mov dword [ebp - 0x1dfc], esi
mov edx, dword [ebp - 0x1dd8]
sub edx, dword [ebp - 0x1de0]
mov dword [ebp - 0x1dcc], edx
mov eax, dword [ebp - 0x1dd4]
sub eax, dword [ebp - 0x1ddc]
mov dword [ebp - 0x1df4], eax
mov eax, dword [ebp - 0x1dec]
sub eax, dword [ebp - 0x1dcc]
cdq
sub eax, edx
sar eax, 1
mov dword [ebp - 0x1034], eax
mov eax, dword [ebp - 0x1dfc]
sub eax, dword [ebp - 0x1df4]
cdq
sub eax, edx
sar eax, 1
mov dword [ebp - 0x1de8], eax
push 0x14
mov ecx, dword [ebp - 0x1df4]
push ecx
mov edx, dword [ebp - 0x1dcc]
push edx
mov eax, dword [ebp - 0x1de8]
push eax
mov ecx, dword [ebp - 0x1034]
push ecx
push 0
mov edx, dword [ebp - 0x102c]
push edx
call dword [sym.imp.USER32.dll_SetWindowPos]
cmp dword [ebp - 4], 0
je 0x401891
call dword [sym.imp.KERNEL32.dll_AllocConsole]
test eax, eax
je 0x401891
push 0x40c334
call dword [sym.imp.KERNEL32.dll_SetConsoleTitleW]
call fcn.00401e75
add eax, 0x20
push eax
push 0x40c330
push str.CONOUT_
call fcn.00401e4f
add esp, 0xc
push 5
mov eax, dword [ebp - 0x102c]
push eax
call dword [sym.imp.USER32.dll_ShowWindow]
mov ecx, dword [ebp - 0x102c]
push ecx
call dword [sym.imp.USER32.dll_GetDC]
mov dword [ebp - 0x1374], eax
push 4
call dword [sym.imp.GDI32.dll_GetStockObject]
push eax
lea edx, [ebp - 0x1de0]
push edx
mov eax, dword [ebp - 0x1374]
push eax
call dword [sym.imp.USER32.dll_FillRect]
mov ecx, dword [ebp - 0x1374]
push ecx
mov edx, dword [ebp - 0x102c]
push edx
call dword [sym.imp.USER32.dll_ReleaseDC]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x13a0], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x13a0]
cmp eax, 0xc8
jae 0x401949
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x2438]
push eax
call dword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
je 0x401947
push 0
push 0
push 0
lea ecx, [ebp - 0x2438]
push ecx
call dword [sym.imp.USER32.dll_GetMessageW]
test eax, eax
jne 0x40193a
xor eax, eax
jmp 0x401c13
lea edx, [ebp - 0x2438]
push edx
call dword [sym.imp.USER32.dll_DispatchMessageW]
jmp 0x4018f0
mov dword [ebp - 0x1370], 0x114
lea eax, [ebp - 0x1370]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp dword [ebp - 0x136c], 4
ja 0x40198b
push 0x10
lea ecx, [ebp - 0x17a8]
push ecx
push str.Cannot_run_on_this_version_of_Windows.
mov edx, dword [ebp - 0x102c]
push edx
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
jmp 0x401c13
lea eax, [ebp - 0x1258]
push eax
lea ecx, [ebp - 0x2418]
push ecx
call fcn.004010d0
add esp, 8
mov dword [ebp - 0x1de4], eax
cmp dword [ebp - 0x1de4], 0
jne 0x401a2b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x2c44], eax
cmp dword [ebp - 0x2c44], 0x7e
jne 0x4019cf
mov dword [ebp - 0x2c44], 0x80030002
lea edx, [ebp - 0x2418]
mov dword [ebp - 0x243c], edx
lea eax, [ebp - 0x243c]
push eax
push 0x800
lea ecx, [ebp - 0x2c40]
push ecx
push 0x400
mov edx, dword [ebp - 0x2c44]
push edx
push 0
push 0x3000
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
push 0x10
lea eax, [ebp - 0x17a8]
push eax
lea ecx, [ebp - 0x2c40]
push ecx
mov edx, dword [ebp - 0x102c]
push edx
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
jmp 0x401c13
xor eax, eax
mov word [ebp - 0x1df8], ax
call dword [sym.imp.KERNEL32.dll_GetUserDefaultUILanguage]
movzx ecx, ax
and ecx, 0x3ff
cmp ecx, 0x11
jne 0x401a56
mov edx, 0x64
mov word [ebp - 0x1df8], dx
jmp 0x401a5f
xor eax, eax
mov word [ebp - 0x1df8], ax
mov ecx, dword [ebp - 0x1de4]
push ecx
call fcn.004011b0
add esp, 4
test eax, eax
jne 0x401ac7
mov dword [ebp - 0x344c], 0x7f
push 0
push 0x800
lea edx, [ebp - 0x3448]
push edx
push 0x400
mov eax, dword [ebp - 0x344c]
push eax
push 0
push 0x3000
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
push 0x10
lea ecx, [ebp - 0x17a8]
push ecx
lea edx, [ebp - 0x3448]
push edx
mov eax, dword [ebp - 0x102c]
push eax
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
jmp 0x401c13
push 0x400
lea ecx, [ebp - 0xa18]
push ecx
lea edx, [ebp - 0x2010]
push edx
call dword [0x41000c]
add esp, 0xc
test eax, eax
jne 0x401b4d
push 0x800
lea eax, [ebp - 0x4450]
push eax
movzx ecx, word [ebp - 0x1df8]
add ecx, 0xc9
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.USER32.dll_LoadStringW]
lea eax, [ebp - 0xa18]
push eax
lea ecx, [ebp - 0x4450]
push ecx
lea edx, [ebp - 0x3c50]
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0x10
lea eax, [ebp - 0x17a8]
push eax
lea ecx, [ebp - 0x3c50]
push ecx
mov edx, dword [ebp - 0x102c]
push edx
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
jmp 0x401c13
call dword [0x410008]
mov eax, dword [ebp - 0x1de4]
push eax
call dword [0x410000]
add esp, 4
cmp dword [ebp - 0x2014], 0
je 0x401b9e
push 0x40c1f0
lea ecx, [ebp - 0x19c8]
push ecx
call fcn.00401d48
add esp, 8
push str._TEST__true
call dword [0x410004]
add esp, 4
push str._BTEST__true
call dword [0x410004]
add esp, 4
jmp 0x401bf5
cmp dword [ebp - 0x1030], 0
je 0x401bd9
push 0x40c1f0
lea edx, [ebp - 0x19c8]
push edx
call fcn.00401d48
add esp, 8
push str._TEST__true
call dword [0x410004]
add esp, 4
push str._BTEST__false
call dword [0x410004]
add esp, 4
jmp 0x401bf5
push str._TEST__false
call dword [0x410004]
add esp, 4
push str._BTEST__false
call dword [0x410004]
add esp, 4
lea eax, [ebp - 0x19c8]
push eax
lea ecx, [ebp - 0x1dc8]
push ecx
mov edx, dword [ebp - 0x102c]
push edx
call dword [0x410014]
add esp, 0xc
pop esi
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00401d67
mov esp, ebp
pop ebp
ret 0x10