Function at 0x40c040
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x20
mov edi, dword [ebp + 8]
cmp dword [edi + 0x40c], 0
je 0x40c139
mov ebx, dword [ebp + 0xc]
push ebx
call fcn.00420710
add esp, 4
push eax
push ebx
call fcn.0040ee20
add esp, 8
movzx eax, al
lea esi, [edi + eax*4]
add esi, 8
mov esi, dword [esi]
test esi, esi
je 0x40c08f
lea eax, [esi + 0x10]
push ebx
push eax
call fcn.00420340
add esp, 8
test eax, eax
jne 0x40c078
mov edi, dword [esi + 8]
test edi, edi
je 0x40c34d
mov ebx, dword [esi + 4]
push 0xc
call fcn.00420172
add esp, 4
test eax, eax
je 0x40c327
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 + 0x408]
test eax, eax
je 0x40c347
mov dword [ebp - 0x14], edx
lea ecx, [edi + ebx]
dec ecx
mov dword [ebp - 0x1c], ecx
mov edx, eax
mov eax, dword [eax + 4]
mov ecx, dword [edx + 8]
lea edi, [eax + ecx]
dec edi
cmp eax, ebx
ja 0x40c0f0
cmp edi, ebx
jae 0x40c31c
cmp edi, ebx
setb cl
mov dword [ebp - 0x18], edx
mov edx, dword [ebp - 0x1c]
cmp edx, eax
setb byte [ebp - 0x10]
cmp edx, edi
seta ch
cmp eax, ebx
setb ah
and ah, ch
or ah, byte [ebp - 0x10]
cmp edi, edx
mov edx, dword [ebp - 0x18]
seta al
cmp ah, 1
jne 0x40c31c
or cl, al
je 0x40c31c
mov eax, dword [edx]
test eax, eax
jne 0x40c0d8
mov eax, dword [ebp - 0x14]
mov dword [edx], eax
jmp 0x40c34d
mov ecx, dword [edi + 4]
xor esi, esi
cmp ecx, 4
jb 0x40c34d
mov eax, dword [edi]
cmp dword [eax], 0x3152414d
jne 0x40c34d
and ecx, 0xfffffffc
cmp ecx, 4
je 0x40c34d
push dword [eax + 4]
call dword [sym.imp.WS2_32.dll_ntohl]
mov ebx, eax
mov eax, dword [edi + 4]
xor esi, esi
cmp eax, ebx
cmovb ebx, esi
jb 0x40c34d
cmp eax, 4
jb 0x40c34d
add eax, 0xfffffffc
cmp ebx, eax
ja 0x40c34d
mov eax, dword [edi]
push dword [eax + ebx]
call dword [sym.imp.WS2_32.dll_ntohl]
mov dword [ebp - 0x10], eax
push eax
call fcn.00420172
add esp, 4
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40c34d
mov eax, dword [edi + 4]
mov ecx, dword [ebp - 0x10]
sub eax, ecx
jb 0x40c357
add ebx, 4
cmp ebx, eax
ja 0x40c357
add ebx, dword [edi]
push ecx
push ebx
mov ebx, dword [ebp - 0x18]
push ebx
call fcn.00424140
add esp, 0xc
mov edx, ebx
mov eax, dword [ebp - 0x10]
add edx, eax
test eax, eax
mov dword [ebp - 0x1c], edx
jle 0x40c2fd
lea ecx, [edx - 1]
mov dword [ebp - 0x28], ecx
mov ebx, dword [ebp - 0x18]
mov eax, edx
sub eax, ebx
cmp eax, 0xe
jl 0x40c2fd
mov eax, dword [ebx + 4]
mov dword [ebp - 0x14], eax
mov eax, dword [ebx + 8]
mov dword [ebp - 0x10], eax
lea edi, [ebx + 0xc]
push dword [ebx]
call dword [sym.imp.WS2_32.dll_ntohl]
mov dword [ebp - 0x2c], eax
push dword [ebp - 0x14]
call dword [sym.imp.WS2_32.dll_ntohl]
mov ecx, dword [sym.imp.WS2_32.dll_ntohl]
mov dword [ebp - 0x14], eax
push dword [ebp - 0x10]
call ecx
cmp byte [ebx + 0xc], 0
mov dword [ebp - 0x10], edi
mov ebx, edi
mov ecx, dword [ebp - 0x28]
je 0x40c258
mov edx, dword [ebp - 0x10]
cmp edx, ecx
je 0x40c357
lea ebx, [edx + 1]
cmp byte [edx + 1], 0
mov edx, ebx
jne 0x40c245
mov edx, dword [ebp - 0x1c]
cmp ebx, edx
mov edi, dword [ebp + 8]
je 0x40c2fd
mov ecx, ebx
sub ecx, dword [ebp - 0x10]
js 0x40c2fd
mov dword [ebp - 0x24], eax
inc ebx
mov dword [ebp - 0x20], ecx
lea eax, [ecx + 0x14]
push eax
call fcn.00420172
add esp, 4
test eax, eax
je 0x40c2fd
mov ecx, eax
mov dword [eax], 0
mov eax, dword [ebp - 0x2c]
mov dword [ecx + 4], eax
mov eax, dword [ebp - 0x14]
mov dword [ecx + 8], eax
mov eax, dword [ebp - 0x24]
mov dword [ecx + 0xc], eax
mov dword [ebp - 0x14], ecx
mov eax, ecx
add eax, 0x10
mov ecx, dword [ebp - 0x20]
inc ecx
push ecx
push dword [ebp - 0x10]
push eax
call fcn.00424140
add esp, 0xc
push dword [ebp - 0x10]
call fcn.00420710
add esp, 4
push eax
push dword [ebp - 0x10]
call fcn.0040ee20
add esp, 8
movzx ecx, al
mov eax, dword [edi + ecx*4 + 8]
test eax, eax
je 0x40c2e7
mov ecx, eax
mov eax, dword [eax]
test eax, eax
jne 0x40c2dd
jmp 0x40c2ed
lea ecx, [edi + ecx*4]
add ecx, 8
mov eax, dword [ebp - 0x14]
mov dword [ecx], eax
mov edx, dword [ebp - 0x1c]
cmp ebx, edx
jb 0x40c1f6
push dword [ebp - 0x18]
call fcn.0041fc39
add esp, 4
cmp ebx, dword [ebp - 0x1c]
jne 0x40c34d
mov dword [edi + 0x40c], 1
jmp 0x40c059
push dword [ebp - 0x14]
call fcn.0041fc39
add esp, 4
push 2
call fcn.0041552f
add esp, 4
push eax
push 1
push 0x31
push str.ERROR:_file_content_collision_in_mar_find_item___n
call fcn.0041fc54
add esp, 0x10
xor esi, esi
jmp 0x40c34d
mov dword [ecx + 0x408], edx
mov eax, esi
add esp, 0x20
pop esi
pop edi
pop ebx
pop ebp
ret
push dword [ebp - 0x18]
call fcn.0041fc39
add esp, 4
jmp 0x40c34d