Function at 0x40c790
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x30
mov edi, dword [ebp + 8]
mov eax, dword [0x43e00c]
xor eax, ebp
mov dword [ebp - 0x10], eax
cmp dword [edi + 0x408], 0
je 0x40c894
mov ebx, dword [ebp + 0xc]
push ebx
call fcn.0041f720
add esp, 4
push eax
push ebx
call fcn.00401490
add esp, 8
movzx eax, al
lea esi, [edi + eax*4]
add esi, 4
mov esi, dword [esi]
lea eax, [esi + 0x10]
push ebx
push eax
call fcn.0041f590
add esp, 8
test eax, eax
jne 0x40c7d2
mov edi, dword [esi + 8]
test edi, edi
je 0x40cab3
mov ebx, dword [esi + 4]
push 0xc
call fcn.0041f4bf
add esp, 4
test eax, eax
je 0x40ca91
mov dword [eax], 0
mov dword [eax + 4], ebx
mov dword [eax + 8], edi
mov ecx, dword [ebp + 8]
mov edx, eax
mov eax, dword [ecx + 0x404]
test eax, eax
je 0x40caad
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x20], ebx
lea ecx, [edi + ebx]
dec ecx
mov dword [ebp - 0x2c], ecx
mov ecx, eax
mov edi, dword [eax + 4]
mov eax, dword [eax + 8]
lea edx, [edi + eax]
dec edx
cmp edi, dword [ebp - 0x20]
ja 0x40c84b
cmp edx, dword [ebp - 0x20]
jae 0x40ca86
mov ebx, dword [ebp - 0x20]
cmp edx, ebx
setae byte [ebp - 0x24]
mov dword [ebp - 0x30], ecx
mov ecx, dword [ebp - 0x2c]
cmp ecx, edi
setb al
cmp ecx, edx
seta ah
cmp edi, ebx
setb bl
cmp edx, ecx
setbe cl
test byte [ebp - 0x24], cl
mov ecx, dword [ebp - 0x30]
jne 0x40ca86
and bl, ah
or al, bl
je 0x40ca86
mov eax, dword [ecx]
test eax, eax
jne 0x40c831
mov eax, dword [ebp - 0x28]
mov dword [ecx], eax
jmp 0x40cab3
xor esi, esi
push esi
push esi
push dword [edi]
call fcn.0041a01c
add esp, 0xc
lea eax, [ebp - 0x14]
push dword [edi]
push 1
push 4
push eax
call fcn.0041ee3f
add esp, 0x10
cmp eax, 1
jne 0x40cab3
cmp dword [ebp - 0x14], 0x3152414d
jne 0x40cab3
lea eax, [ebp - 0x18]
push dword [edi]
push 1
push 4
push eax
call fcn.0041ee3f
add esp, 0x10
cmp eax, 1
jne 0x40cab3
push dword [ebp - 0x18]
call dword [sym.imp.WSOCK32.dll_ntohl]
mov dword [ebp - 0x18], eax
push 0
push eax
push dword [edi]
call fcn.0041a01c
add esp, 0xc
test eax, eax
jne 0x40cab3
lea eax, [ebp - 0x1c]
push dword [edi]
push 1
push 4
push eax
call fcn.0041ee3f
add esp, 0x10
cmp eax, 1
jne 0x40cab3
push dword [ebp - 0x1c]
call dword [sym.imp.WSOCK32.dll_ntohl]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], eax
push eax
call fcn.0041f4bf
add esp, 4
test eax, eax
je 0x40cab3
mov ebx, eax
push dword [edi]
push 1
push dword [ebp - 0x20]
push eax
call fcn.0041ee3f
add esp, 0x10
cmp eax, 1
jne 0x40cac7
mov ecx, ebx
mov eax, dword [ebp - 0x20]
add ecx, eax
mov dword [ebp - 0x28], ebx
test eax, eax
mov dword [ebp - 0x30], ecx
jle 0x40cad5
lea eax, [ecx - 1]
mov dword [ebp - 0x34], eax
mov ebx, dword [ebp - 0x28]
mov eax, ecx
sub eax, ebx
cmp eax, 0xe
jl 0x40cad5
mov eax, dword [ebx + 4]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebx + 8]
mov dword [ebp - 0x24], eax
lea eax, [ebx + 0xc]
mov dword [ebp - 0x20], eax
push dword [ebx]
mov eax, dword [sym.imp.WSOCK32.dll_ntohl]
call eax
mov dword [ebp - 0x3c], eax
push dword [ebp - 0x2c]
mov edi, dword [ebp + 8]
call dword [sym.imp.WSOCK32.dll_ntohl]
mov dword [ebp - 0x2c], eax
push dword [ebp - 0x24]
call dword [sym.imp.WSOCK32.dll_ntohl]
mov ecx, dword [ebp - 0x30]
cmp byte [ebx + 0xc], 0
mov edx, dword [ebp - 0x20]
je 0x40c9df
add ebx, 0xd
cmp ecx, ebx
je 0x40cad2
lea edx, [ebx + 1]
cmp byte [ebx], 0
mov ebx, edx
jne 0x40c9cc
dec edx
cmp edx, ecx
je 0x40caf4
mov dword [ebp - 0x24], eax
mov eax, edx
sub eax, dword [ebp - 0x20]
js 0x40caf4
mov ebx, edx
inc ebx
mov dword [ebp - 0x38], eax
add eax, 0x14
push eax
call fcn.0041f4bf
add esp, 4
test eax, eax
je 0x40cad5
mov ecx, eax
mov dword [eax], 0
mov eax, dword [ebp - 0x3c]
mov dword [ecx + 4], eax
mov eax, dword [ebp - 0x2c]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0x24]
mov dword [ecx + 0xc], eax
mov dword [ebp - 0x24], ecx
mov eax, ecx
add eax, 0x10
mov ecx, dword [ebp - 0x38]
inc ecx
push ecx
push dword [ebp - 0x20]
push eax
call fcn.00424430
add esp, 0xc
push dword [ebp - 0x20]
call fcn.0041f720
add esp, 4
push eax
push dword [ebp - 0x20]
call fcn.00401490
add esp, 8
movzx eax, al
mov ecx, dword [edi + eax*4 + 4]
test ecx, ecx
je 0x40ca6e
mov eax, ecx
mov ecx, dword [ecx]
test ecx, ecx
jne 0x40ca64
jmp 0x40ca74
lea eax, [edi + eax*4]
add eax, 4
mov ecx, dword [ebp - 0x24]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x30]
cmp ebx, ecx
jb 0x40c97a
jmp 0x40cad5
push dword [ebp - 0x28]
call fcn.0041f035
add esp, 4
push 2
call fcn.004121ed
add esp, 4
push str.ERROR:_file_content_collision_in_mar_find_item___n
push eax
call fcn.00401220
add esp, 8
xor esi, esi
jmp 0x40cab3
mov dword [ecx + 0x404], edx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00412b41
mov eax, esi
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret
push ebx
call fcn.0041f035
add esp, 4
jmp 0x40cab3
mov ebx, dword [ebp - 0x34]
push dword [ebp - 0x28]
call fcn.0041f035
add esp, 4
cmp ebx, dword [ebp - 0x30]
jne 0x40cab3
mov dword [edi + 0x408], 1
jmp 0x40c7b3
mov ebx, edx
jmp 0x40cad5