Function at 0x402c1c
Capabilities:
Read file on windows

Disassembly:
push ecx
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov ebx, 0xfa00
cmp dword [esi + 0x118], 0
je 0x402ceb
push 0x415114
push dword [esp + 0x20]
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
pop ecx
test ebp, ebp
pop ecx
je 0x402e0e
push 2
push 0
push ebp
call dword [sym.imp.MSVCRT.dll_fseek]
push ebp
call dword [sym.imp.MSVCRT.dll_ftell]
push 0
mov edi, eax
push 0
push ebp
mov dword [esp + 0x2c], edi
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0x1c
cmp edi, 0xfa000
mov dword [esi + 0x1c], 1
jge 0x402cdc
mov eax, dword [esi + 0x18]
test eax, eax
je 0x402c94
push eax
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
push edi
call dword [sym.imp.MSVCRT.dll_malloc]
pop ecx
mov ecx, eax
test ecx, ecx
mov dword [esi + 0x18], ecx
je 0x402cdc
mov eax, edi
mov edi, ebx
cdq
idiv edi
push ebp
mov edi, eax
push edi
push ebx
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
imul edi, edi, 0xfa00
mov eax, dword [esp + 0x20]
mov ecx, ebx
cdq
idiv ecx
add edi, dword [esi + 0x18]
push ebp
push 1
push edx
push edi
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x20
and dword [esi + 0x1c], 0
and dword [esi + 0x118], 0
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
cmp dword [esi + 0x1c], 0
je 0x402e4d
push 0x415114
push dword [esp + 0x20]
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
pop ecx
test ebp, ebp
pop ecx
mov dword [esp + 0x1c], ebp
je 0x402e0e
mov eax, dword [esp + 0x20]
push 0
push dword [eax]
push ebp
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test eax, eax
jne 0x402e0e
push ebp
lea edi, [esi + 4]
push 1
push 4
push edi
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
test eax, eax
je 0x402e43
cmp byte [edi], 0x53
jne 0x402e43
cmp byte [esi + 5], 0x4d
jne 0x402e43
cmp byte [esi + 6], 0x4f
jne 0x402e43
cmp byte [esi + 7], 0x56
jne 0x402e43
push ebp
lea edi, [esi + 8]
push 1
push 0xc
push edi
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
test eax, eax
je 0x402e43
mov eax, dword [esi + 0x14]
test eax, eax
je 0x402d9c
push eax
call dword [sym.imp.MSVCRT.dll_free]
and dword [esi + 0x14], 0
pop ecx
push dword [edi]
call dword [sym.imp.MSVCRT.dll_malloc]
pop ecx
mov ecx, eax
test ecx, ecx
mov dword [esi + 0x14], ecx
je 0x402e0e
mov eax, dword [edi]
mov edi, ebx
mov dword [esp + 0x10], eax
push ebp
cdq
idiv edi
mov edi, eax
push edi
push ebx
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
mov ecx, eax
mov eax, dword [esp + 0x20]
xor edx, edx
mov ebp, ebx
div ebp
add esp, 0x10
cmp ecx, eax
jne 0x402e00
mov eax, dword [esp + 0x10]
imul edi, edi, 0xfa00
cdq
idiv ebx
mov ebp, dword [esp + 0x1c]
add edi, dword [esi + 0x14]
push ebp
mov ebx, edx
push ebx
push 1
push edi
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, ebx
je 0x402e18
push dword [esi + 0x14]
call dword [sym.imp.MSVCRT.dll_free]
and dword [esi + 0x14], 0
pop ecx
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 0xc
push ebp
call dword [sym.imp.MSVCRT.dll_ftell]
mov ecx, dword [esp + 0x24]
push ebp
mov dword [ecx], eax
call dword [sym.imp.MSVCRT.dll_fclose]
lea eax, [esi + 4]
push 0x10
push eax
push dword [esp + 0x28]
call sub.MSVCRT.dll_memcpy
mov eax, dword [esi + 0x14]
add esp, 0x14
jmp 0x402e10
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
jmp 0x402e0e
mov edi, dword [esp + 0x20]
mov ecx, dword [esi + 0x18]
mov eax, dword [edi]
add eax, ecx
cmp byte [eax], 0x53
jne 0x402e0e
cmp byte [eax + 1], 0x4d
jne 0x402e0e
cmp byte [eax + 2], 0x4f
jne 0x402e0e
cmp byte [eax + 3], 0x56
jne 0x402e0e
mov ebx, dword [esp + 0x18]
push 0x10
push eax
push ebx
call sub.MSVCRT.dll_memcpy
mov eax, dword [edi]
mov ecx, dword [ebx + 4]
add eax, 0x10
add esp, 0xc
add ecx, eax
mov dword [edi], ecx
add eax, dword [esi + 0x18]
jmp 0x402e10