Function at 0x402b43
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 0x402c12
push 0x4150ec
push dword [esp + 0x20]
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
pop ecx
test ebp, ebp
pop ecx
je 0x402d35
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 0x402c03
mov eax, dword [esi + 0x18]
test eax, eax
je 0x402bbb
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 0x402c03
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 0x402d74
push 0x4150ec
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 0x402d35
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 0x402d35
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 0x402d6a
cmp byte [edi], 0x53
jne 0x402d6a
cmp byte [esi + 5], 0x4d
jne 0x402d6a
cmp byte [esi + 6], 0x4f
jne 0x402d6a
cmp byte [esi + 7], 0x56
jne 0x402d6a
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 0x402d6a
mov eax, dword [esi + 0x14]
test eax, eax
je 0x402cc3
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 0x402d35
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 0x402d27
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 0x402d3f
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 0x402d37
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
jmp 0x402d35
mov edi, dword [esp + 0x20]
mov ecx, dword [esi + 0x18]
mov eax, dword [edi]
add eax, ecx
cmp byte [eax], 0x53
jne 0x402d35
cmp byte [eax + 1], 0x4d
jne 0x402d35
cmp byte [eax + 2], 0x4f
jne 0x402d35
cmp byte [eax + 3], 0x56
jne 0x402d35
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 0x402d37