Function at 0x40beb0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x34
mov eax, dword [0x43d00c]
mov ebx, dword [ebp + 8]
xor eax, ebp
mov dword [ebp - 0x10], eax
cmp dword [ebx + 0x408], 0
je 0x40bfb1
mov edi, dword [ebp + 0xc]
push edi
call fcn.0041fc30
add esp, 4
push eax
push edi
call fcn.0040f010
add esp, 8
movzx eax, al
lea esi, [ebx + eax*4 + 4]
mov esi, dword [esi]
lea eax, [esi + 0x10]
push edi
push eax
call fcn.0041fba0
add esp, 8
test eax, eax
jne 0x40bef0
mov ebx, dword [esi + 8]
test ebx, ebx
je 0x40c1c1
mov edi, dword [esi + 4]
push 0xc
call fcn.0041facb
add esp, 4
test eax, eax
je 0x40c1a3
mov ecx, dword [ebp + 8]
mov dword [eax], 0
mov dword [eax + 4], edi
mov dword [eax + 8], ebx
mov edx, dword [ecx + 0x404]
test edx, edx
je 0x40c1d5
lea ecx, [ebx + edi - 1]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x20], ecx
nop dword [eax]
mov edi, edx
mov ebx, dword [edx + 4]
mov eax, dword [edx + 8]
mov edx, dword [ebp - 0x30]
lea ecx, [ebx + eax - 1]
cmp ebx, edx
ja 0x40bf6b
cmp ecx, edx
jae 0x40c198
mov dword [ebp - 0x24], edi
mov edi, dword [ebp - 0x20]
cmp ecx, edx
setae byte [ebp - 0x2c]
cmp edi, ebx
setb al
cmp edi, ecx
seta ah
cmp ebx, edx
setb bl
cmp ecx, edi
mov edi, dword [ebp - 0x24]
setbe cl
test byte [ebp - 0x2c], cl
jne 0x40c198
and bl, ah
or al, bl
je 0x40c198
mov edx, dword [edi]
test edx, edx
jne 0x40bf50
mov eax, dword [ebp - 0x28]
mov dword [edi], eax
jmp 0x40c1c1
push 0
push 0
push dword [ebx]
call fcn.0041a69f
add esp, 0xc
lea eax, [ebp - 0x14]
push dword [ebx]
push 1
push 4
push eax
call fcn.0041f44b
add esp, 0x10
cmp eax, 1
jne 0x40c1bf
cmp dword [ebp - 0x14], 0x3152414d
jne 0x40c1bf
lea eax, [ebp - 0x18]
push dword [ebx]
push 1
push 4
push eax
call fcn.0041f44b
add esp, 0x10
cmp eax, 1
jne 0x40c1bf
push dword [ebp - 0x18]
call dword [sym.imp.WSOCK32.dll_ntohl]
mov dword [ebp - 0x18], eax
push 0
push eax
push dword [ebx]
call fcn.0041a69f
add esp, 0xc
test eax, eax
jne 0x40c1bf
lea eax, [ebp - 0x1c]
push dword [ebx]
push 1
push 4
push eax
call fcn.0041f44b
add esp, 0x10
cmp eax, 1
jne 0x40c1bf
push dword [ebp - 0x1c]
call dword [sym.imp.WSOCK32.dll_ntohl]
mov edi, eax
mov dword [ebp - 0x1c], eax
push eax
call fcn.0041facb
add esp, 4
test eax, eax
je 0x40c1bf
mov esi, eax
push dword [ebx]
push 1
push edi
push eax
call fcn.0041f44b
add esp, 0x10
cmp eax, 1
jne 0x40c1dd
lea ecx, [esi + edi]
test edi, edi
mov edx, esi
mov dword [ebp - 0x2c], ecx
jle 0x40c1eb
lea edx, [edi + esi - 0xd]
lea eax, [ecx - 1]
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x38], edx
mov edx, esi
mov dword [ebp - 0x34], eax
mov eax, ecx
sub eax, edx
cmp eax, 0xe
jl 0x40c1eb
mov eax, dword [edx + 8]
mov esi, dword [edx + 4]
mov dword [ebp - 0x28], eax
lea eax, [edx + 0xc]
mov dword [ebp - 0x30], eax
push dword [edx]
mov edi, dword [sym.imp.WSOCK32.dll_ntohl]
mov dword [ebp - 0x24], edx
call edi
mov dword [ebp - 0x40], eax
push esi
mov esi, dword [ebp - 0x20]
call edi
mov dword [ebp - 0x3c], eax
push dword [ebp - 0x28]
call edi
mov edx, dword [ebp - 0x24]
mov edi, dword [ebp - 0x30]
mov dword [ebp - 0x28], eax
cmp byte [edx + 0xc], 0
mov eax, edi
je 0x40c0fc
mov ecx, dword [ebp - 0x38]
mov eax, edi
sub ecx, edx
test ecx, ecx
je 0x40c1e8
dec ecx
cmp byte [eax + 1], 0
lea eax, [eax + 1]
jne 0x40c0ea
mov ecx, dword [ebp - 0x2c]
cmp eax, ecx
je 0x40c20c
mov esi, eax
sub esi, edi
js 0x40c20c
inc eax
mov dword [ebp - 0x24], eax
lea eax, [esi + 0x14]
push eax
call fcn.0041facb
add esp, 4
test eax, eax
je 0x40c213
mov edi, eax
mov dword [eax], 0
mov eax, dword [ebp - 0x40]
inc esi
mov dword [edi + 4], eax
mov eax, dword [ebp - 0x3c]
mov dword [edi + 8], eax
mov eax, dword [ebp - 0x28]
mov dword [edi + 0xc], eax
mov eax, edi
add eax, 0x10
push esi
mov esi, dword [ebp - 0x30]
push esi
push eax
call fcn.00424d40
add esp, 0xc
push esi
call fcn.0041fc30
add esp, 4
push eax
push esi
call fcn.0040f010
add esp, 8
movzx eax, al
mov ecx, dword [ebx + eax*4 + 4]
test ecx, ecx
je 0x40c17f
mov eax, ecx
mov ecx, dword [ecx]
test ecx, ecx
jne 0x40c175
jmp 0x40c183
lea eax, [ebx + eax*4 + 4]
mov edx, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x20]
mov dword [eax], edi
cmp edx, ecx
jb 0x40c098
jmp 0x40c1eb
push dword [ebp - 0x28]
call fcn.0041f641
add esp, 4
push 2
call fcn.00415c8f
add esp, 4
push eax
push 1
push 0x31
push str.ERROR:_file_content_collision_in_mar_find_item___n
call fcn.0041f65e
add esp, 0x10
xor esi, esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00412fa1
mov eax, esi
add esp, 0x34
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ecx + 0x404], eax
jmp 0x40c1c1
push esi
call fcn.0041f641
add esp, 4
jmp 0x40c1bf
mov edx, dword [ebp - 0x34]
push esi
mov edi, edx
call fcn.0041f641
add esp, 4
xor esi, esi
cmp edi, dword [ebp - 0x2c]
jne 0x40c1c1
mov dword [ebx + 0x408], 1
jmp 0x40bed3
mov esi, dword [ebp - 0x20]
mov edx, eax
jmp 0x40c1eb
mov esi, dword [ebp - 0x20]
mov edx, dword [ebp - 0x24]
jmp 0x40c1eb