Function at 0x4012f0
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
lea ebp, [esp - 0x3370]
mov eax, 0x3370
call fcn.00401c40
push 0xfffffffffffffffe
push 0x4094e0
push 0x401aa0
mov eax, dword fs:[0]
push eax
sub esp, 0x64
mov eax, dword [section..data]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp + 0x336c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x3378]
mov dword [ebp - 0x20], eax
xor edi, edi
mov word [ebp + 0x1b1c], di
push 0x3fe
push edi
lea ecx, [ebp + 0x1b1e]
push ecx
call fcn.00401a10
mov word [ebp + 0x231c], di
push 0x3fe
push edi
lea edx, [ebp + 0x231e]
push edx
call fcn.00401a10
mov word [ebp + 0x2b40], di
push 0x3fe
push edi
lea eax, [ebp + 0x2b42]
push eax
call fcn.00401a10
mov word [ebp + 0x1f1c], di
push 0x3fe
push edi
lea ecx, [ebp + 0x1f1e]
push ecx
call fcn.00401a10
mov word [ebp + 0x3150], di
push 0x21a
push edi
lea edx, [ebp + 0x3152]
push edx
call fcn.00401a10
mov word [ebp + 0x2924], di
push 0x21a
push edi
lea eax, [ebp + 0x2926]
push eax
call fcn.00401a10
add esp, 0x48
push 0x104
lea ecx, [ebp + 0x271c]
push ecx
push edi
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
call ebx
push 0x5c
lea edx, [ebp + 0x271c]
push edx
call fcn.004019dd
add esp, 8
cmp eax, edi
je 0x40179f
lea ecx, [eax + 2]
lea ebx, [ebx]
movzx edx, word [ecx]
add ecx, 2
cmp dx, di
jne 0x401410
mov word [eax], di
lea eax, [ebp + 0x271c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 0x104
lea ecx, [ebp + 0x2f40]
push ecx
push edi
call ebx
push 0x2e
lea edx, [ebp + 0x2f40]
push edx
call fcn.004019dd
add esp, 8
cmp eax, edi
je 0x40179f
mov word [eax], di
add eax, 0xfffffffe
lea esp, [esp]
mov cx, word [eax + 2]
add eax, 2
cmp cx, di
jne 0x401460
mov ecx, dword [str..ini]
mov dword [eax], ecx
mov edx, dword [0x408380]
mov dword [eax + 4], edx
mov cx, word [0x408384]
mov word [eax + 8], cx
lea edx, [ebp + 0x2f40]
push edx
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
call esi
cmp eax, 0xffffffff
je 0x40179f
push 0x104
lea eax, [ebp + 0x3150]
push eax
push edi
call ebx
push 0x2e
lea ecx, [ebp + 0x3150]
push ecx
call fcn.004019dd
add esp, 8
cmp eax, edi
je 0x40179f
mov word [eax], di
add eax, 0xfffffffe
mov edi, edi
mov cx, word [eax + 2]
add eax, 2
cmp cx, di
jne 0x4014d0
mov edx, dword [str..rgss2a]
mov dword [eax], edx
mov ecx, dword [0x408370]
mov dword [eax + 4], ecx
mov edx, dword [0x408374]
mov dword [eax + 8], edx
mov ecx, dword [0x408378]
mov dword [eax + 0xc], ecx
lea edx, [ebp + 0x3150]
push edx
call esi
cmp eax, 0xffffffff
jne 0x401527
xor eax, eax
nop
movzx ecx, word [eax + 0x4081b8]
mov word [ebp + eax + 0x3150], cx
add eax, 2
cmp cx, di
jne 0x401510
lea eax, [ebp + 0x2f40]
push eax
push 0x400
lea ecx, [ebp + 0x1b1c]
push ecx
push 0x4081b8
push 0x408364
push str.Game
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
call esi
lea edx, [ebp + 0x2f40]
push edx
push 0x400
lea eax, [ebp + 0x231c]
push eax
push 0x4081b8
push str.Library
push str.Game
call esi
lea ecx, [ebp + 0x2f40]
push ecx
push 0x400
lea edx, [ebp + 0x2b40]
push edx
push str.Untitled
push str.Title
push str.Game
call esi
lea eax, [ebp + 0x2f40]
push eax
push 0x400
lea ecx, [ebp + 0x1f1c]
push ecx
push 0x4081b8
push str.Scripts
push str.Game
call esi
push 0x21c
lea edx, [ebp + 0x2924]
push edx
lea eax, [ebp + 0x1b1c]
push eax
call section..text
add esp, 0xc
mov dword [ebp - 0x58], 8
mov ecx, dword [sym.imp.USER32.dll_DefWindowProcW]
mov dword [ebp - 0x54], ecx
mov dword [ebp - 0x50], edi
mov dword [ebp - 0x4c], edi
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x48], eax
push 1
push eax
call dword [sym.imp.USER32.dll_LoadIconW]
mov dword [ebp - 0x44], eax
push 0x7f00
push edi
call dword [sym.imp.USER32.dll_LoadCursorW]
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x34], str.RGSS_Player
lea edx, [ebp - 0x58]
push edx
call dword [sym.imp.USER32.dll_RegisterClassW]
push edi
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
push edi
push edi
push edi
push edi
push 0x80000000
push 0x80000000
push 0xca0000
lea eax, [ebp + 0x2b40]
push eax
mov ecx, dword [ebp - 0x34]
push ecx
push 0x100
call dword [sym.imp.USER32.dll_CreateWindowExW]
mov ebx, eax
cmp ebx, edi
je 0x40179f
push 0x1a0
push 0x220
push edi
push edi
lea edx, [ebp - 0x30]
push edx
call dword [sym.imp.USER32.dll_SetRect]
push 0xfffffffffffffff0
push ebx
mov esi, dword [sym.imp.USER32.dll_GetWindowLongW]
call esi
mov edi, eax
push 0xffffffffffffffec
push ebx
call esi
push eax
push 0
push edi
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.USER32.dll_AdjustWindowRectEx]
push 0x20
mov esi, dword [sym.imp.USER32.dll_GetSystemMetrics]
call esi
mov edi, eax
add edi, edi
push 0x3d
call esi
sub eax, edi
mov dword [ebp - 0x20], eax
push 0x21
call esi
mov edi, eax
add edi, edi
push 0x3e
call esi
sub eax, edi
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x28]
sub ecx, dword [ebp - 0x30]
mov esi, dword [ebp - 0x24]
sub esi, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x20]
sub eax, ecx
cdq
sub eax, edx
mov edi, eax
sar edi, 1
mov eax, dword [ebp - 0x1c]
sub eax, esi
cdq
sub eax, edx
sar eax, 1
push 0x14
push esi
push ecx
push eax
push edi
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
push 4
call dword [sym.imp.GDI32.dll_GetStockObject]
push eax
lea ecx, [ebp - 0x30]
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
call esi
sub eax, edi
cmp eax, 0x1f4
jae 0x401773
push 0
push 0
push 0
push 0
lea edx, [ebp - 0x74]
push edx
call dword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
je 0x401768
push 0
push 0
push 0
lea eax, [ebp - 0x74]
push eax
call dword [sym.imp.USER32.dll_GetMessageW]
test eax, eax
je 0x40179f
lea ecx, [ebp - 0x74]
push ecx
call dword [sym.imp.USER32.dll_DispatchMessageW]
call esi
sub eax, edi
cmp eax, 0x1f4
jb 0x401734
mov dword [ebp], 0x114
lea edx, [ebp]
push edx
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp dword [ebp + 4], 4
ja 0x4017c8
push 0x10
lea eax, [ebp + 0x2b40]
push eax
push str.Cannot_run_on_this_version_of_Windows.
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x336c]
xor ecx, ebp
call fcn.00401a8a
add ebp, 0x3370
mov esp, ebp
pop ebp
ret 0x10
lea ecx, [ebp + 0x2924]
push ecx
lea edx, [ebp + 0x231c]
push edx
call fcn.00401110
add esp, 8
mov esi, eax
mov dword [ebp - 0x1c], esi
test esi, esi
jne 0x401838
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7e
jne 0x4017f7
mov eax, 0x80030002
lea ecx, [ebp + 0x231c]
mov dword [ebp - 0x1c], ecx
lea edx, [ebp - 0x1c]
push edx
push 0x800
lea ecx, [ebp + 0x131c]
push ecx
push 0x400
push eax
push 0
push 0x3000
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
push 0x10
lea edx, [ebp + 0x2b40]
push edx
lea eax, [ebp + 0x131c]
push eax
jmp 0x401798
mov dword [ebp - 4], 0
push esi
call fcn.00401250
add esp, 4
test eax, eax
jne 0x40189b
push eax
push 0x800
lea ecx, [ebp + 0x131c]
push ecx
push 0x400
push 0x7f
push eax
push 0x3000
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [ebp + 0x131c]
push 0x10
lea edx, [ebp + 0x2b40]
push edx
push eax
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push 0xfffffffffffffffe
lea ecx, [ebp - 0x10]
push ecx
push section..data
call fcn.00401c6c
add esp, 0xc
jmp 0x40179f
push 0x400
lea edx, [ebp + 0x114]
push edx
lea eax, [ebp + 0x2f40]
push eax
call dword [0x40bccc]
add esp, 0xc
test eax, eax
jne 0x4018f9
push 0x800
lea ecx, [ebp + 0x131c]
push ecx
push 1
push esi
call dword [sym.imp.USER32.dll_LoadStringW]
lea edx, [ebp + 0x114]
push edx
lea eax, [ebp + 0x131c]
push eax
lea ecx, [ebp + 0x914]
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea eax, [ebp + 0x914]
jmp 0x401872
call dword [0x40bcc4]
push esi
call dword [0x40bcc8]
add esp, 4
mov edi, str.btest
mov eax, dword [ebp + 0x3380]
mov esi, eax
mov ecx, 6
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x401953
mov ecx, 0x4081b8
lea edx, [ebp + 0x3150]
lea esp, [esp]
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
test ax, ax
jne 0x401930
push str._TEST__true
call dword [0x40bcc0]
push str._BTEST__true
jmp 0x401998
mov edi, str.test
mov esi, eax
mov ecx, 5
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x401988
mov ecx, 0x4081b8
lea edx, [ebp + 0x3150]
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
test ax, ax
jne 0x401970
push str._TEST__true
jmp 0x40198d
push str._TEST__false
call dword [0x40bcc0]
push str._BTEST__false
call dword [0x40bcc0]
add esp, 8
lea ecx, [ebp + 0x3150]
push ecx
lea edx, [ebp + 0x1f1c]
push edx
push ebx
call dword [0x40bcd4]
mov esi, eax
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push section..data
call fcn.00401c6c
add esp, 0x18
mov eax, esi
jmp 0x4017a1