Function at 0x417010
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xc
mov ebx, dword [ebp + 8]
test ebx, ebx
jne 0x417030
or eax, 0xffffffff
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [ebx + 0xc], 0x1c4f
jne 0x417020
mov eax, dword [ebx + 0x4c]
test eax, eax
je 0x417045
cmp eax, 0xfffffffb
jne 0x417020
cmp dword [ebp + 0x10], 0
jl 0x4172d9
je 0x41726f
mov eax, dword [ebx + 0x48]
test eax, eax
je 0x41709b
mov dword [ebx + 0x48], 0
mov esi, dword [ebx + 0x44]
test esi, esi
je 0x41709b
mov eax, dword [ebx]
cmp eax, 0
je 0x4171c5
jl 0x41707d
xor edx, edx
cmp eax, esi
jle 0x417083
mov edx, eax
mov eax, esi
sub edx, esi
mov edi, dword [ebx + 4]
mov ecx, dword [ebx + 8]
add edi, eax
add ecx, eax
sub esi, eax
mov dword [ebx], edx
mov dword [ebx + 4], edi
mov dword [ebx + 8], ecx
test esi, esi
jne 0x41706a
mov eax, dword [ebx]
mov dword [ebp - 0x14], 0
test eax, eax
jne 0x417211
mov edi, dword [ebx + 0x34]
test edi, edi
je 0x4170be
mov esi, dword [ebx + 0x58]
test esi, esi
je 0x417260
mov edx, dword [ebx + 0x2c]
test edx, edx
je 0x417130
mov eax, dword [ebx + 0x18]
add eax, eax
cmp dword [ebp + 0x10], eax
jb 0x417130
dec edx
jne 0x417284
xor esi, esi
mov eax, dword [ebp + 0x10]
mov edi, dword [ebp + 0xc]
sub eax, esi
add edi, esi
mov dword [ebp - 0x10], eax
push edx
push eax
push edi
mov eax, dword [ebx + 0x10]
push eax
call sub.msvcrt.dll__read
add esp, 0x10
cmp eax, 0
jle 0x417276
add esi, eax
cmp dword [ebp + 0x10], esi
ja 0x4170d8
mov eax, dword [ebp + 0x10]
sub eax, esi
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0xc]
lea edi, [eax + esi]
mov eax, dword [ebp - 0x14]
mov dword [ebp + 0xc], edi
add eax, esi
mov dword [ebp - 0x14], eax
mov eax, dword [ebx + 8]
add eax, esi
mov dword [ebx + 8], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp + 0x10], eax
jmp 0x4171b3
cmp edx, 1
je 0x417173
cmp edx, 2
je 0x4171f0
test edx, edx
jne 0x417157
mov eax, ebx
call fcn.00416800
inc eax
je 0x417020
mov ecx, dword [ebx + 0x2c]
test ecx, ecx
je 0x4171b3
mov edi, dword [ebx]
test edi, edi
jne 0x4171b3
mov esi, dword [ebx + 0x34]
test esi, esi
je 0x41716b
mov ecx, dword [ebx + 0x58]
test ecx, ecx
je 0x4171b3
mov edx, dword [ebx + 0x2c]
cmp edx, 1
jne 0x417135
mov eax, dword [ebx + 0x18]
mov edi, dword [ebx + 0x24]
mov dword [ebx], 0
lea esi, [eax + eax]
mov eax, dword [ebx]
push edx
mov edx, esi
sub edx, eax
lea eax, [edi + eax]
push edx
push eax
mov ecx, dword [ebx + 0x10]
push ecx
call sub.msvcrt.dll__read
add esp, 0x10
cmp eax, 0
jle 0x41724e
mov edx, dword [ebx]
add eax, edx
mov dword [ebx], eax
cmp esi, eax
ja 0x417182
mov eax, dword [ebx + 0x24]
mov dword [ebx + 4], eax
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x417267
mov eax, dword [ebx]
jmp 0x4170a4
mov edx, dword [ebx + 0x34]
test edx, edx
je 0x4171d7
mov eax, dword [ebx + 0x58]
test eax, eax
je 0x4172ab
mov eax, ebx
call fcn.00416ac0
inc eax
jne 0x417066
jmp 0x417020
mov eax, dword [ebx + 0x18]
add eax, eax
mov dword [ebx + 0x64], eax
mov eax, dword [ebx + 0x24]
mov dword [ebx + 0x60], eax
mov eax, ebx
call fcn.00416640
inc eax
jne 0x417157
jmp 0x417020
mov esi, eax
cmp eax, dword [ebp + 0x10]
jbe 0x41721b
mov esi, dword [ebp + 0x10]
push eax
push esi
mov eax, dword [ebx + 4]
push eax
mov eax, dword [ebp + 0xc]
push eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebx + 4]
add esp, 0x10
add eax, esi
mov dword [ebx + 4], eax
mov eax, dword [ebx]
sub eax, esi
mov dword [ebx], eax
mov eax, dword [ebp + 0x10]
sub eax, esi
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0xc]
lea edi, [eax + esi]
jmp 0x417112
jne 0x4172b2
mov dword [ebx + 0x34], 1
jmp 0x4171ad
mov dword [ebx + 0x38], 1
mov eax, dword [ebp - 0x14]
jmp 0x417023
xor eax, eax
jmp 0x417023
jne 0x4172b2
mov dword [ebx + 0x34], 1
jmp 0x417112
mov eax, dword [ebp + 0x10]
mov dword [ebx + 0x64], eax
mov eax, dword [ebp + 0xc]
mov dword [ebx + 0x60], eax
mov eax, ebx
call fcn.00416640
inc eax
je 0x417020
mov esi, dword [ebx]
mov dword [ebx], 0
jmp 0x417104
xor eax, eax
jmp 0x41709d
call sub.msvcrt.dll__errno
sub esp, 0xc
mov eax, dword [eax]
push eax
call sub.msvcrt.dll_strerror
add esp, 0xc
push eax
push 0xffffffffffffffff
push ebx
call fcn.00411a10
or eax, 0xffffffff
add esp, 0x10
jmp 0x417023
push eax
push str.requested_length_does_not_fit_in_int
push 0xfffffffffffffffd
push ebx
call fcn.00411a10
or eax, 0xffffffff
add esp, 0x10
jmp 0x417023