Function at 0x406ae0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x1c
push ebp
mov ebp, dword [esp + 0x28]
push esi
mov esi, dword [esp + 0x28]
mov eax, dword [esi + 0x4c]
push edi
xor edi, edi
dec eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0xc], edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], edi
cmp ebp, eax
ja 0x406d80
mov ecx, dword [esi + 0x48]
mov edx, dword [ecx + ebp*8]
mov eax, dword [esi + 0x3c]
shl edx, 4
add eax, edx
test dword [eax + 0xc], 0x1000000
je 0x406b34
lea eax, [edi + 1]
jmp 0x406b42
mov ecx, dword [esi + 4]
mov eax, dword [eax + 8]
lea eax, [eax + ecx - 1]
xor edx, edx
div ecx
push ebx
mov ebx, dword [esp + 0x38]
cmp ebx, eax
jae 0x406d73
mov ecx, dword [esi + 0x44]
cmp dword [ecx + ebp*4], edi
lea eax, [ecx + ebp*4]
je 0x406d68
mov edx, dword [eax]
cmp dword [edx + 4], edi
je 0x406d68
lea eax, [esp + 0x24]
push eax
push ebx
push ebp
push esi
call fcn.00406970
mov ecx, dword [esp + 0x38]
add esp, 0x10
cmp ecx, dword [esp + 0x44]
jl 0x406b9c
jg 0x406b8f
mov edx, dword [esp + 0x24]
cmp edx, dword [esp + 0x40]
jbe 0x406b9c
pop ebx
pop edi
pop esi
mov eax, 0xfffffff7
pop ebp
add esp, 0x1c
ret
mov ecx, dword [esi + 0x44]
mov edx, dword [ecx + ebp*4]
mov eax, dword [esi + 0x48]
mov edi, dword [eax + ebp*8]
mov eax, dword [edx + 4]
mov edx, dword [esi + 0x40]
lea ecx, [eax + ebx*4]
movzx eax, word [edx + edi*2]
push 1
cdq
push 0
push edx
push eax
mov dword [esp + 0x44], ecx
call fcn.0040e900
mov ecx, eax
mov eax, dword [esi + 0x3c]
shl edi, 4
mov eax, dword [edi + eax]
mov ebx, edx
xor edx, edx
add ecx, eax
mov eax, dword [esp + 0x34]
mov eax, dword [eax]
adc ebx, edx
add ecx, eax
adc ebx, edx
mov edx, dword [esp + 0x34]
mov edi, dword [edx + 4]
sub edi, eax
mov eax, dword [esi + 8]
cdq
add eax, ecx
push 0
adc edx, ebx
push edx
push eax
mov eax, dword [esi]
push eax
call dword [sym.imp.MSVCR90.dll__fseeki64]
add esp, 0x10
test eax, eax
jge 0x406c14
pop ebx
pop edi
pop esi
mov eax, 0xfffffffd
pop ebp
add esp, 0x1c
ret
push edi
push 1
call dword [sym.imp.MSVCR90.dll_calloc]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x406c31
lea eax, [ebx - 6]
pop ebx
pop edi
pop esi
pop ebp
add esp, 0x1c
ret
mov ecx, dword [esi]
push ecx
push edi
push 1
push ebx
call dword [sym.imp.MSVCR90.dll_fread]
lea edx, [esp + 0x28]
push edx
push ebp
push esi
call fcn.004064a0
add esp, 0x1c
cmp dword [esp + 0x18], 1
jne 0x406c8f
mov ecx, dword [esp + 0x38]
lea eax, [esp + 0x1c]
push eax
push ecx
push ebp
push esi
call fcn.00406a60
mov edx, dword [esp + 0x2c]
push edx
push edi
push ebx
call fcn.00406f20
add esp, 0x1c
test eax, eax
jge 0x406c8f
push ebx
call dword [sym.imp.MSVCR90.dll_free]
add esp, 4
pop ebx
pop edi
pop esi
mov eax, 0xfffffff5
pop ebp
add esp, 0x1c
ret
lea eax, [esp + 0x14]
push eax
push ebp
push esi
call fcn.004064e0
add esp, 0xc
cmp dword [esp + 0x14], 1
jne 0x406cc6
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
push 0x200
push ecx
push edx
push edi
push ebx
call fcn.00407050
add esp, 0x14
mov dword [esp + 0x10], eax
test eax, eax
jl 0x406d2b
lea eax, [esp + 0x20]
push eax
push ebp
push esi
call fcn.00406520
mov esi, dword [esp + 0x2c]
add esp, 0xc
cmp esi, 1
jne 0x406cff
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
push 0x100
push ecx
push edx
push edi
push ebx
call fcn.00407050
add esp, 0x14
mov dword [esp + 0x10], eax
test eax, eax
jl 0x406d2b
cmp dword [esp + 0x14], 0
jne 0x406d42
test esi, esi
jne 0x406d42
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
push 0x300
push eax
push ecx
push edi
push ebx
call fcn.00407050
add esp, 0x14
mov dword [esp + 0x10], eax
test eax, eax
jge 0x406d42
push ebx
call dword [sym.imp.MSVCR90.dll_free]
add esp, 4
pop ebx
pop edi
pop esi
mov eax, 0xfffffff4
pop ebp
add esp, 0x1c
ret
push ebx
call dword [sym.imp.MSVCR90.dll_free]
mov ecx, dword [esp + 0x4c]
add esp, 4
test ecx, ecx
je 0x406d5e
mov eax, dword [esp + 0x10]
cdq
mov dword [ecx], eax
mov dword [ecx + 4], edx
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x1c
ret
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0x1c
ret
pop ebx
pop edi
pop esi
mov eax, 0xfffffff6
pop ebp
add esp, 0x1c
ret
pop edi
pop esi
mov eax, 0xfffffff6
pop ebp
add esp, 0x1c
ret