Function at 0x406610
Capabilities:
Read file on windows

Disassembly:
push ecx
push ebp
push esi
mov esi, dword [esp + 0x10]
mov eax, dword [esi + 0x4c]
mov ebp, 1
push edi
mov edi, dword [esp + 0x18]
sub eax, ebp
cmp edi, eax
ja 0x4068eb
mov ecx, dword [esi + 0x44]
cmp dword [ecx + edi*4], 0
je 0x406646
mov edx, ecx
mov edi, dword [edx + edi*4]
add dword [edi + 8], ebp
pop edi
pop esi
xor eax, eax
pop ebp
pop ecx
ret
mov eax, dword [esi + 0x48]
mov ecx, dword [eax + edi*8]
mov edx, dword [esi + 0x3c]
shl ecx, 4
lea eax, [ecx + edx]
push ebx
mov ebx, dword [eax + 0xc]
test ebx, 0x1000000
jne 0x40667c
mov ecx, dword [esi + 4]
mov eax, dword [eax + 8]
lea eax, [eax + ecx - 1]
xor edx, edx
div ecx
lea ecx, [eax*4 + 4]
mov dword [esp + 0x1c], ecx
jmp 0x406684
mov dword [esp + 0x1c], 8
test ebx, 0x4000000
je 0x406691
add dword [esp + 0x1c], 4
mov ebx, dword [sym.imp.MSVCR90.dll_calloc]
push 0xc
push ebp
call ebx
mov edx, dword [esi + 0x44]
mov dword [edx + edi*4], eax
mov eax, dword [esi + 0x44]
add esp, 8
cmp dword [eax + edi*4], 0
jne 0x4066b8
mov ebx, 0xfffffffa
jmp 0x406821
mov ecx, dword [esp + 0x1c]
push ecx
push ebp
call ebx
mov edx, dword [esi + 0x44]
mov ecx, dword [edx + edi*4]
mov dword [ecx + 4], eax
mov edx, dword [esi + 0x44]
mov eax, dword [edx + edi*4]
add esp, 8
cmp dword [eax + 4], 0
je 0x4066ae
mov ecx, edx
mov edx, dword [ecx + edi*4]
mov dword [edx + 8], ebp
mov eax, dword [esi + 0x48]
mov ecx, dword [eax + edi*8]
mov ebp, dword [esi + 0x3c]
shl ecx, 4
lea eax, [ecx + ebp]
mov ecx, dword [eax + 0xc]
test ecx, 0xff00
je 0x406847
test ecx, 0x1000000
jne 0x4068b8
mov edx, dword [esi + 0x48]
mov ebx, dword [edx + edi*8]
mov eax, dword [esi + 0x40]
movzx eax, word [eax + ebx*2]
push 0
push 1
cdq
push 0
push edx
push eax
call fcn.0040e900
mov ecx, eax
shl ebx, 4
mov eax, edx
mov edx, dword [ebx + ebp]
xor ebx, ebx
add ecx, edx
adc eax, ebx
mov dword [esp + 0x14], eax
mov eax, dword [esi + 8]
cdq
add ecx, eax
mov eax, dword [esp + 0x14]
adc eax, edx
push eax
mov eax, dword [esi]
push ecx
push eax
call dword [sym.imp.MSVCR90.dll__fseeki64]
add esp, 0x10
test eax, eax
jge 0x406761
mov ebx, 0xfffffffd
jmp 0x406821
mov ecx, dword [esi]
mov edx, dword [esi + 0x44]
mov ebx, dword [esp + 0x1c]
mov eax, dword [edx + edi*4]
push ecx
mov ecx, dword [eax + 4]
push ebx
push 1
push ecx
call dword [sym.imp.MSVCR90.dll_fread]
add esp, 0x10
test eax, eax
jge 0x40678c
mov ebx, 0xfffffffc
jmp 0x406821
mov edx, dword [esi + 0x44]
mov ecx, dword [edx + edi*4]
mov edx, dword [ecx + 4]
mov ecx, dword [edx]
cmp ecx, eax
je 0x4067ba
add eax, 4
cmp ecx, eax
je 0x4067ba
mov eax, dword [esi + 0x48]
mov ecx, dword [eax + edi*8]
mov edx, dword [esi + 0x3c]
shl ecx, 4
or dword [ecx + edx + 0xc], 0x10000
lea eax, [ecx + edx + 0xc]
mov eax, dword [esi + 0x48]
mov ecx, dword [eax + edi*8]
mov edx, dword [esi + 0x3c]
shl ecx, 4
test dword [ecx + edx + 0xc], 0x10000
je 0x4068e3
mov eax, dword [esi + 0x44]
mov eax, dword [eax + edi*4]
mov ecx, dword [esi + 4]
mov edx, dword [eax + 4]
push eax
push ecx
push ebx
push edx
call fcn.00406f90
add esp, 0x10
test eax, eax
jl 0x40681c
mov eax, dword [esi + 0x44]
mov eax, dword [eax + edi*4]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
dec ecx
push ecx
push ebx
push edx
call fcn.00406f20
add esp, 0xc
test eax, eax
jl 0x40681c
mov eax, dword [esi + 0x44]
mov ecx, dword [eax + edi*4]
mov edx, dword [ecx + 4]
cmp dword [edx], ebx
je 0x4068e3
mov ebx, 0xfffffff5
mov eax, dword [esi + 0x44]
mov ecx, dword [eax + edi*4]
mov edx, dword [ecx + 4]
mov ebp, dword [sym.imp.MSVCR90.dll_free]
push edx
call ebp
mov eax, dword [esi + 0x44]
mov ecx, dword [eax + edi*4]
push ecx
call ebp
add esp, 8
mov eax, ebx
pop ebx
pop edi
pop esi
pop ebp
pop ecx
ret
test ecx, 0x1000000
jne 0x4068b8
mov ebx, dword [eax + 8]
mov ebp, dword [esi + 4]
xor edx, edx
lea eax, [ebx + ebp - 1]
div ebp
xor ecx, ecx
add eax, 1
je 0x4068e3
mov ebp, dword [esi + 4]
xor edx, edx
lea eax, [ebx + ebp - 1]
div ebp
mov edx, dword [esi + 0x44]
cmp ecx, eax
jne 0x406881
mov eax, dword [edx + edi*4]
mov edx, dword [eax + 4]
mov dword [edx + ecx*4], ebx
jmp 0x40688f
mov edx, dword [edx + edi*4]
mov edx, dword [edx + 4]
mov eax, ebp
imul eax, ecx
mov dword [edx + ecx*4], eax
mov eax, dword [esi + 0x48]
mov edx, dword [eax + edi*8]
mov eax, dword [esi + 0x3c]
mov ebp, dword [esi + 4]
shl edx, 4
mov ebx, dword [edx + eax + 8]
xor edx, edx
lea eax, [ebx + ebp - 1]
div ebp
inc ecx
inc eax
cmp ecx, eax
jb 0x406864
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
pop ecx
ret
mov ecx, dword [esi + 0x44]
mov edx, dword [ecx + edi*4]
mov eax, dword [edx + 4]
mov dword [eax], 0
mov ecx, dword [esi + 0x48]
mov edx, dword [ecx + edi*8]
mov ecx, dword [esi + 0x44]
mov eax, dword [esi + 0x3c]
mov ecx, dword [ecx + edi*4]
mov ecx, dword [ecx + 4]
shl edx, 4
mov edx, dword [edx + eax + 4]
mov dword [ecx + 4], edx
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
pop ecx
ret
pop edi
pop esi
mov eax, 0xfffffff6
pop ebp
pop ecx
ret