Function at 0x405f80
Capabilities:
Read file on windows

Disassembly:
sub esp, 8
push ebx
mov ebx, dword [esp + 0x18]
push ebp
push esi
push edi
mov edi, dword [esp + 0x28]
mov eax, ebx
xor ebp, ebp
and eax, edi
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], ebp
cmp eax, 0xffffffff
jne 0x405fb2
xor ebx, ebx
xor edi, edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x10], 1
push 0x50
push 1
call dword [sym.imp.MSVCR90.dll_calloc]
mov esi, dword [esp + 0x24]
add esp, 8
mov dword [esi], eax
cmp eax, ebp
jne 0x405fd6
pop edi
pop esi
pop ebp
mov eax, 0xfffffffa
pop ebx
add esp, 8
ret
mov ecx, dword [esp + 0x20]
push 0x410c2c
push ecx
call dword [sym.imp.MSVCR90.dll_fopen]
mov edx, dword [esi]
mov dword [edx], eax
mov eax, dword [esi]
add esp, 8
cmp dword [eax], ebp
jne 0x405ffb
or ebx, 0xffffffff
jmp 0x406351
mov dword [eax + 0xc], ebp
mov eax, dword [esi]
mov dword [eax + 0x4c], ebp
mov ecx, dword [esi]
push ebp
mov dword [ecx + 0xc], ebp
mov edx, dword [esi]
mov eax, dword [edx]
mov ebp, dword [sym.imp.MSVCR90.dll__fseeki64]
push edi
push ebx
push eax
call ebp
add esp, 0x10
test eax, eax
jl 0x40607d
nop
mov eax, dword [esi]
mov ecx, dword [eax]
push ecx
push 0x20
add eax, 0xc
push 1
push eax
call dword [sym.imp.MSVCR90.dll_fread]
add esp, 0x10
cmp eax, 0x20
jne 0x406348
mov edx, dword [esi]
cmp dword [edx + 0xc], 0x1a51504d
je 0x406087
cmp dword [esp + 0x10], 0
je 0x406348
add ebx, 0x200
mov eax, edx
push 0
adc edi, 0
mov dword [eax + 0xc], 0
mov ecx, dword [esi]
mov edx, dword [ecx]
push edi
push ebx
push edx
call ebp
add esp, 0x10
test eax, eax
jge 0x406020
mov dword [esp + 0x28], edi
mov ebx, 0xfffffffd
jmp 0x406351
mov eax, edx
cmp word [eax + 0x18], 0
mov dword [esp + 0x28], edi
jne 0x4060a1
cmp dword [eax + 0x10], 0x20
je 0x4060a1
mov dword [eax + 0x10], 0x20
mov eax, dword [esi]
cmp word [eax + 0x18], 1
jne 0x4060b7
mov ecx, 0x2c
cmp dword [eax + 0x10], ecx
je 0x4060b7
mov dword [eax + 0x10], ecx
mov eax, dword [esi]
mov cl, byte [eax + 0x1a]
mov edx, 0x200
shl edx, cl
mov dword [eax + 4], edx
mov eax, dword [esi]
mov dword [eax + 8], ebx
mov eax, dword [esi]
cmp word [eax + 0x18], 1
jne 0x406115
mov edx, dword [eax]
mov ecx, ebx
add ecx, 0x20
push 0
adc edi, 0
push edi
push ecx
push edx
call ebp
add esp, 0x10
test eax, eax
jge 0x4060f6
mov ebx, 0xfffffffd
jmp 0x406351
mov eax, dword [esi]
mov ecx, dword [eax]
push ecx
push 0xc
add eax, 0x2c
push 1
push eax
call dword [sym.imp.MSVCR90.dll_fread]
add esp, 0x10
cmp eax, 0xc
jne 0x40634c
mov edx, dword [esi]
mov eax, dword [edx + 0x28]
mov edi, dword [sym.imp.MSVCR90.dll_calloc]
push 0x10
push eax
call edi
mov ecx, dword [esi]
mov dword [ecx + 0x3c], eax
mov eax, dword [esi]
add esp, 8
cmp dword [eax + 0x3c], 0
je 0x406341
mov edx, dword [eax + 0x28]
push 2
push edx
call edi
mov ecx, dword [esi]
mov dword [ecx + 0x40], eax
mov eax, dword [esi]
add esp, 8
cmp dword [eax + 0x40], 0
je 0x406341
mov edx, dword [eax + 0x24]
push 0x10
push edx
call edi
mov ecx, dword [esi]
mov dword [ecx + 0x38], eax
mov eax, dword [esi]
add esp, 8
cmp dword [eax + 0x38], 0
je 0x406341
mov edx, dword [eax + 0x28]
push 0xc
push edx
call edi
mov ecx, dword [esi]
mov dword [ecx + 0x44], eax
mov eax, dword [esi]
add esp, 8
cmp dword [eax + 0x44], 0
je 0x406341
mov edx, dword [eax + 0x28]
push 8
push edx
call edi
mov ecx, dword [esi]
mov dword [ecx + 0x48], eax
mov edi, dword [esi]
add esp, 8
cmp dword [edi + 0x48], 0
je 0x406341
movzx eax, word [edi + 0x34]
push 0
push 1
cdq
push 0
push edx
push eax
call fcn.0040e900
mov ecx, eax
mov ebp, edx
mov edx, dword [edi + 0x1c]
xor eax, eax
add ecx, edx
adc ebp, eax
mov eax, dword [edi + 8]
cdq
add ecx, eax
adc ebp, edx
push ebp
push ecx
mov ecx, dword [edi]
push ecx
call dword [sym.imp.MSVCR90.dll__fseeki64]
add esp, 0x10
test eax, eax
jge 0x4061ec
mov ebx, 0xfffffffd
jmp 0x406351
mov eax, dword [esi]
mov edx, dword [eax]
mov ecx, dword [eax + 0x24]
push edx
mov edx, dword [eax + 0x38]
shl ecx, 4
push ecx
push 1
push edx
call dword [sym.imp.MSVCR90.dll_fread]
mov edi, dword [esi]
push 0x300
push str._hash_table_
call fcn.00406ec0
mov ecx, dword [edi + 0x38]
push eax
mov eax, dword [edi + 0x24]
shl eax, 4
push eax
push ecx
call fcn.00406f20
mov edi, dword [esi]
movzx eax, word [edi + 0x36]
add esp, 0x24
push 0
push 1
cdq
push 0
push edx
push eax
call fcn.0040e900
mov ecx, eax
mov ebp, edx
mov edx, dword [edi + 0x20]
xor eax, eax
add ecx, edx
adc ebp, eax
mov eax, dword [edi + 8]
cdq
add ecx, eax
adc ebp, edx
push ebp
push ecx
mov ecx, dword [edi]
push ecx
call dword [sym.imp.MSVCR90.dll__fseeki64]
add esp, 0x10
test eax, eax
jge 0x40626e
mov ebx, 0xfffffffd
jmp 0x406351
mov eax, dword [esi]
mov edx, dword [eax]
mov ecx, dword [eax + 0x28]
mov ebp, dword [sym.imp.MSVCR90.dll_fread]
push edx
mov edx, dword [eax + 0x3c]
shl ecx, 4
push ecx
push 1
push edx
call ebp
mov edi, dword [esi]
push 0x300
push str._block_table_
call fcn.00406ec0
mov ecx, dword [edi + 0x3c]
push eax
mov eax, dword [edi + 0x28]
shl eax, 4
push eax
push ecx
call fcn.00406f20
mov ecx, dword [esi]
mov eax, dword [ecx + 0x30]
mov edx, dword [ecx + 0x2c]
add esp, 0x24
test eax, eax
ja 0x4062bd
test edx, edx
jbe 0x4062f4
add edx, ebx
adc eax, dword [esp + 0x28]
push 0
push eax
push edx
mov edx, dword [ecx]
push edx
call dword [sym.imp.MSVCR90.dll__fseeki64]
add esp, 0x10
test eax, eax
jge 0x4062de
mov ebx, 0xfffffffd
jmp 0x406351
mov eax, dword [esi]
mov ecx, dword [eax]
mov edx, dword [eax + 0x28]
mov eax, dword [eax + 0x40]
push ecx
add edx, edx
push edx
push 1
push eax
call ebp
add esp, 0x10
mov ecx, dword [esi]
mov edi, dword [esp + 0x14]
xor eax, eax
cmp dword [ecx + 0x28], eax
jbe 0x406332
xor edx, edx
mov ebx, 0x80000000
mov ebp, dword [esi]
mov ebp, dword [ebp + 0x48]
mov ecx, eax
sub ecx, edi
mov dword [ebp + eax*8 + 4], ecx
mov ecx, dword [esi]
mov ebp, dword [ecx + 0x3c]
test dword [edx + ebp + 0xc], ebx
je 0x406327
mov ecx, dword [ecx + 0x48]
mov dword [ecx + edi*8], eax
inc edi
mov ecx, dword [esi]
inc eax
add edx, 0x10
cmp eax, dword [ecx + 0x28]
jb 0x406308
mov edx, dword [esi]
mov dword [edx + 0x4c], edi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret
mov ebx, 0xfffffffa
jmp 0x406351
mov dword [esp + 0x28], edi
mov ebx, 0xfffffff9
mov eax, dword [esi]
cmp dword [eax], 0
je 0x406364
mov eax, dword [eax]
push eax
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
mov ecx, dword [esi]
mov edx, dword [ecx + 0x48]
mov edi, dword [sym.imp.MSVCR90.dll_free]
push edx
call edi
mov eax, dword [esi]
mov ecx, dword [eax + 0x44]
push ecx
call edi
mov edx, dword [esi]
mov eax, dword [edx + 0x38]
push eax
call edi
mov ecx, dword [esi]
mov edx, dword [ecx + 0x3c]
push edx
call edi
mov eax, dword [esi]
mov ecx, dword [eax + 0x40]
push ecx
call edi
mov edx, dword [esi]
push edx
call edi
add esp, 0x18
pop edi
mov dword [esi], 0
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 8
ret