Function at 0x40b0b0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
mov esi, edx
lea esi, [esi + esi*8]
shl esi, 5
cmp word [esi + 0x413352], 0
push edi
mov edi, ecx
jne 0x40b135
push 0
push eax
mov eax, dword [esi + 0x413248]
push eax
call dword [sym.imp.MSVCR71.dll__lseek]
add esp, 0xc
test eax, eax
jl 0x40b2f8
test edi, edi
mov ebx, edi
jle 0x40b12b
mov ebp, dword [sym.imp.MSVCR71.dll__read]
cmp ebx, 0x4000
mov edi, ebx
jl 0x40b101
mov edi, 0x4000
mov ecx, dword [esp + 0x24]
mov edx, dword [esi + 0x413248]
push edi
push ecx
push edx
call ebp
add esp, 0xc
cmp eax, edi
jne 0x40b305
mov edx, dword [esp + 0x24]
add edx, edi
sub ebx, edi
test ebx, ebx
mov dword [esp + 0x24], edx
jg 0x40b0f2
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov ecx, eax
and ecx, 0x80003fff
jns 0x40b147
dec ecx
or ecx, 0xffffc000
inc ecx
mov ebp, dword [esi + 0x413360]
cdq
and edx, 0x3fff
add eax, edx
mov ebx, eax
sar ebx, 0xe
test edi, edi
mov dword [esp + 0x18], ecx
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], edi
jle 0x40b12b
jmp 0x40b171
mov ebx, dword [esp + 0x10]
mov ecx, dword [esi + 0x413360]
xor eax, eax
cmp word [esi + 0x413354], ax
jle 0x40b194
cmp word [ecx + eax*8], bx
je 0x40b197
movsx edx, word [esi + 0x413354]
inc eax
cmp eax, edx
jl 0x40b182
or eax, 0xffffffff
test ax, ax
mov ecx, eax
jge 0x40b284
xor eax, eax
mov ax, word [esi + 0x413356]
movsx edi, ax
mov dword [esp + 0x1c], eax
mov ax, word [ebp + edi*8]
test ax, ax
jl 0x40b21d
cmp word [ebp + edi*8 + 2], 0
je 0x40b21d
movsx ebx, ax
mov eax, dword [esi + 0x413248]
push 0
shl ebx, 0xe
push ebx
push eax
call dword [sym.imp.MSVCR71.dll__lseek]
add esp, 0xc
test eax, eax
jl 0x40b2f8
mov eax, dword [esi + 0x41335c]
sub eax, ebx
cmp eax, 0x4000
mov ebx, 0x4000
jge 0x40b1fb
mov ebx, eax
mov ecx, dword [ebp + edi*8 + 4]
mov edx, dword [esi + 0x413248]
push ebx
push ecx
push edx
call dword [sym.imp.MSVCR71.dll__write]
add esp, 0xc
cmp eax, ebx
jne 0x40b2eb
mov ebx, dword [esp + 0x10]
mov ecx, dword [esi + 0x413248]
movsx eax, bx
push 0
shl eax, 0xe
push eax
push ecx
call dword [sym.imp.MSVCR71.dll__lseek]
add esp, 0xc
test eax, eax
jl 0x40b2f8
mov edx, dword [ebp + edi*8 + 4]
mov eax, dword [esi + 0x413248]
push 0x4000
push edx
push eax
call dword [sym.imp.MSVCR71.dll__read]
add esp, 0xc
test eax, eax
jle 0x40b305
mov word [ebp + edi*8], bx
mov word [ebp + edi*8 + 2], 0
movsx ecx, word [esi + 0x413354]
lea eax, [edi + 1]
cdq
idiv ecx
mov ecx, dword [esp + 0x1c]
mov word [esi + 0x413356], dx
movsx eax, word [esp + 0x18]
mov edi, dword [esp + 0x14]
lea edx, [eax + edi]
cmp edx, 0x4000
jle 0x40b29f
mov edi, 0x4000
sub edi, eax
mov ebx, dword [esp + 0x24]
movsx ecx, cx
mov edx, dword [ebp + ecx*8 + 4]
push edi
add edx, eax
push edx
push ebx
call dword [sym.imp.MSVCR71.dll_memmove]
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
add esp, 0xc
sub eax, edi
inc ecx
add ebx, edi
test eax, eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], ecx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x14], eax
jg 0x40b16d
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
pop edi
pop esi
pop ebp
mov eax, 6
pop ebx
add esp, 0x10
ret
pop edi
pop esi
pop ebp
mov eax, 0xc
pop ebx
add esp, 0x10
ret
pop edi
pop esi
pop ebp
mov eax, 5
pop ebx
add esp, 0x10
ret