Function at 0x528470
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x214
mov eax, dword [0x5b107c]
xor eax, esp
mov dword [esp + 0x210], eax
push ebx
push esi
push edi
mov edi, edx
xor ebx, ebx
mov esi, ecx
mov dword [esp + 0x10], edi
cmp edi, ebx
je 0x52857b
push 0x587394
push edi
call dword [sym.imp.MSVCR100.dll_fopen]
lea edx, [esi + 0x30]
add esp, 8
mov dword [esi + 4], eax
mov eax, edi
sub edx, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x5284b8
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x52857b
mov edi, dword [sym.imp.MSVCR100.dll_fseek]
push 2
push ebx
push eax
call edi
mov eax, dword [esi + 4]
add esp, 0xc
push eax
call dword [sym.imp.MSVCR100.dll_ftell]
mov ecx, dword [esi + 4]
add esp, 4
push ebx
push ebx
push ecx
mov dword [esp + 0x20], eax
call edi
mov eax, dword [esi + 0x28]
add esp, 0xc
cmp eax, ebx
je 0x52850c
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov dword [esi + 0x28], ebx
mov edx, dword [esi + 4]
mov edi, dword [sym.imp.MSVCR100.dll_fread]
push edx
push 1
mov dword [esi + 0x14], ebx
mov dword [esi + 0x2c], ebx
lea ebx, [esi + 0x18]
push 0xc
push ebx
call edi
mov ecx, dword [ebx]
sub ecx, dword [esi + 0x1c]
add esp, 0x10
sub ecx, dword [esi + 0x20]
lea eax, [esi + 0x134]
call fcn.00406240
test eax, eax
jne 0x528592
push str.MHFile.cpp
xor ecx, ecx
lea edx, [eax + 0x36]
call fcn.0052cb10
mov eax, dword [esp + 0x14]
add esp, 4
push eax
lea ecx, [esp + 0x1c]
push str.Bin_File_Version_Error_____s
push ecx
call dword [sym.imp.MSVCR100.dll_sprintf]
add esp, 0xc
push 0
push 0
lea edx, [esp + 0x20]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x210]
xor ecx, esp
call fcn.005762ee
mov esp, ebp
pop ebp
ret
lea ecx, [esi + 0x134]
call fcn.00406220
test eax, eax
je 0x528663
mov edi, dword [esp + 0x14]
add edi, 0xfffffff2
push edi
call fcn.00576240
add esp, 4
mov dword [esi + 0x28], eax
test eax, eax
jne 0x5285e5
push str.MHFile.cpp
xor ecx, ecx
lea edx, [eax + 0x47]
call fcn.0052cb10
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x210]
xor ecx, esp
call fcn.005762ee
mov esp, ebp
pop ebp
ret
push edi
push 0
push eax
call sub.MSVCR100.dll_memset
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 4]
add esp, 0xc
push eax
push edi
push ecx
mov ecx, dword [esi + 0x28]
lea edx, [esi + 0x134]
call fcn.00406290
test eax, eax
jne 0x528632
mov edx, dword [esp + 0x10]
push edx
lea eax, [esp + 0x1c]
push str.File_Open_Error_:__s
push eax
call dword [sym.imp.MSVCR100.dll_sprintf]
add esp, 0xc
push 0
push 0
lea ecx, [esp + 0x20]
push ecx
jmp 0x528573
mov edx, dword [esi + 4]
push edx
call dword [sym.imp.MSVCR100.dll_fclose]
mov eax, 1
add esp, 4
mov dword [esi + 4], 0
mov dword [esi + 0x2c], eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x210]
xor ecx, esp
call fcn.005762ee
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 4]
push eax
push 1
lea ecx, [esi + 0x24]
push 1
push ecx
call edi
mov eax, dword [esi + 0x20]
add esp, 0x10
test eax, eax
je 0x528697
push eax
call fcn.00576240
mov edx, dword [esi + 4]
mov ecx, dword [esi + 0x20]
add esp, 4
push edx
push ecx
push 1
push eax
mov dword [esi + 0x28], eax
call edi
add esp, 0x10
mov edx, dword [esi + 4]
push edx
push 1
lea eax, [esi + 0x25]
push 1
push eax
call edi
mov ecx, dword [esi + 4]
push ecx
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 0x14
mov dword [esi + 4], 0
call fcn.005286f0
test eax, eax
je 0x52857b
mov ecx, dword [esp + 0x21c]
mov eax, 1
pop edi
mov dword [esi + 0x2c], eax
pop esi
pop ebx
xor ecx, esp
call fcn.005762ee
mov esp, ebp
pop ebp
ret