Function at 0x406490
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
mov eax, dword [0x493a88]
push ebx
push esi
push edi
push 0
push 0x80
push 3
push 0
push 1
mov edi, edx
mov dword [esp + 0x2c], eax
push SysReAllocString
xor bl, bl
push edi
mov byte [esp + 0x2b], bl
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
jne 0x406500
cmp dword [0x493a80], 0
je 0x4066d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push str.Unable_to_open_file__s.__Error_code___d_.
push dword [0x493a80]
call fcn.00438440
add esp, 0x10
mov al, bl
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
test esi, esi
jne 0x40653e
mov eax, dword [0x493a80]
test eax, eax
je 0x4066c7
push edi
push str.The_file__s_appears_to_be_an_empty_file_
push eax
call fcn.00438440
add esp, 0xc
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, bl
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
call fcn.00438f0e
mov ebx, eax
add esp, 4
mov dword [esp + 0x10], ebx
test ebx, ebx
jne 0x406572
mov eax, dword [0x493a80]
test eax, eax
je 0x4066ba
push edi
push str.Unable_to_allocate_memory_to_load_file__s.
push eax
call fcn.00438440
add esp, 0xc
jmp 0x4066ba
push 0
lea eax, [esp + 0x20]
push eax
push esi
push ebx
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4065b5
cmp dword [0x493a80], eax
je 0x4066ba
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push str.Unable_to_read_file__s.__Error_code___d_.
push dword [0x493a80]
call fcn.00438440
add esp, 0x10
jmp 0x4066ba
mov eax, ebx
cmp dword [eax], 0x4e494145
jne 0x4065e7
lea ebx, [eax + 4]
add esi, 0xfffffffc
mov eax, dword [0x493a80]
test eax, eax
je 0x4065dd
push edi
push str.Processing_EAIN_file__s.
push eax
call fcn.00438440
add esp, 0xc
push esi
push ebx
call fcn.00454580
add esp, 8
cmp esi, 3
jbe 0x40661a
cmp byte [ebx], 0xef
jne 0x40661a
cmp byte [ebx + 1], 0xbb
jne 0x40661a
cmp byte [ebx + 2], 0xbf
jne 0x40661a
mov eax, dword [0x493a80]
add ebx, 3
sub esi, 3
test eax, eax
je 0x40661a
push str.Processing_..._n
push eax
call fcn.00438440
add esp, 8
mov dword [esp + 0x20], ebx
lea eax, [esp + 0x20]
mov ebx, dword [esp + 0x18]
mov edx, 0x414490
push str.InstData
push eax
mov ecx, ebx
mov dword [esp + 0x2c], esi
call fcn.00412b20
mov ecx, eax
add esp, 8
test ecx, ecx
jne 0x40669d
mov eax, dword [ebx + 8]
mov edx, 0x412b00
sub eax, 0x10
mov dword [esp + 0x24], 0xffffffff
mov dword [esp + 0x20], eax
sub eax, dword [ebx + 0x20]
push ecx
push eax
lea eax, [esp + 0x28]
mov ecx, ebx
push eax
call fcn.0041c3e0
mov edx, dword [ebx + 8]
mov ecx, eax
mov eax, dword [ebx + 0x14]
add esp, 0xc
cmp edx, dword [eax + 8]
jb 0x406680
mov dword [eax + 8], edx
test ecx, ecx
jne 0x40668b
mov byte [esp + 0xf], 1
jmp 0x4066b6
mov eax, dword [0x493a80]
test eax, eax
je 0x4066b6
push ecx
push edi
push str.Failed_to_process_data_file__s.____d_
jmp 0x4066ad
mov eax, dword [0x493a80]
test eax, eax
je 0x4066b6
push ecx
push edi
push str.Unable_to_initialize_from_data_file__s.____d_
push eax
call fcn.00438440
add esp, 0x10
mov ebx, dword [esp + 0x10]
push ebx
call fcn.0043acf3
mov bl, byte [esp + 0x13]
add esp, 4
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov al, bl
pop ebx
mov esp, ebp
pop ebp
ret