Function at 0x10029e7c
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1020
call fcn.10013eed
mov eax, dword [0x100c87c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x1020], ebx
test ebx, ebx
je 0x10051d6f
push esi
push ebx
call sym.MSVCR110.dll__fileno
mov esi, eax
xor eax, eax
pop ecx
mov dword [ebp - 0x1018], esi
cmp dword [ebx + 4], eax
jl 0x10051d87
push 1
push eax
push esi
call sym.MSVCR110.dll__lseek
mov ecx, eax
add esp, 0xc
mov dword [ebp - 0x1008], ecx
test ecx, ecx
js 0x10051d8f
mov edx, esi
sar edx, 5
mov dword [ebp - 0x1010], edx
mov edx, dword [edx*4 + sym.MSVCR110.dll___pioinfo]
mov eax, esi
and eax, 0x1f
shl eax, 6
mov dword [ebp - 0x101c], eax
mov dl, byte [eax + edx + 0x24]
add dl, dl
sar dl, 1
test dword [ebx + 0xc], 0x108
mov byte [ebp - 0x1009], dl
je 0x1002b65e
mov esi, dword [ebx]
push edi
mov edi, esi
sub edi, dword [ebx + 8]
test byte [ebx + 0xc], 3
mov dword [ebp - 0x1014], edi
je 0x1002abb4
cmp dl, 1
je 0x10051d97
mov edi, dword [ebp - 0x1010]
mov ecx, dword [edi*4 + sym.MSVCR110.dll___pioinfo]
mov edi, dword [ebp - 0x1014]
test byte [eax + ecx + 4], 0x80
mov ecx, dword [ebp - 0x1008]
jne 0x1002bb0a
test ecx, ecx
je 0x1002abc3
test byte [ebx + 0xc], 1
jne 0x1002bb3f
cmp dl, 1
je 0x10051f22
lea eax, [ecx + edi]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.10011bae
leave
ret
test byte [ebx + 0xc], 0x80
jne 0x10029f5c
jmp 0x10051eab
mov eax, edi
jmp 0x10029f7a
sub ecx, dword [ebx + 4]
mov eax, ecx
jmp 0x10029f7b
test dword [ebx + 0xc], 0x2000
jne 0x10051f15
mov dl, byte [ebp - 0x1009]
cmp dl, 1
je 0x10051f1b
sub ecx, esi
jmp 0x10029f6e
xor edi, edi
jmp 0x10029f6e
mov ecx, dword [ebx + 8]
mov dword [ebp - 0x1014], ecx
cmp ecx, esi
mov ecx, dword [ebp - 0x1008]
jae 0x10029f5c
mov eax, dword [ebp - 0x1014]
cmp byte [eax], 0xa
je 0x1002bb3c
inc eax
cmp eax, esi
jb 0x1002bb27
mov eax, dword [ebp - 0x101c]
jmp 0x10029f5c
inc edi
jmp 0x1002bb2c
cmp dword [ebx + 4], 0
je 0x1002b963
sub esi, dword [ebx + 8]
add esi, dword [ebx + 4]
mov ebx, dword [ebp - 0x1010]
mov ecx, dword [ebx*4 + sym.MSVCR110.dll___pioinfo]
mov ebx, dword [ebp - 0x1020]
test byte [eax + ecx + 4], 0x80
mov ecx, dword [ebp - 0x1008]
je 0x1002b95c
push 2
push 0
push dword [ebp - 0x1018]
call sym.MSVCR110.dll__lseek
mov ecx, dword [ebp - 0x1008]
add esp, 0xc
cmp eax, ecx
jne 0x10051eb8
mov eax, dword [ebx + 8]
lea edx, [eax + esi]
cmp eax, edx
jae 0x1002b940
cmp byte [eax], 0xa
je 0x1002bba9
inc eax
jmp 0x1002bb99
inc esi
jmp 0x1002bba6
call sym.MSVCR110.dll__errno
mov dword [eax], 0x16
call sym.MSVCR110.dll__invalid_parameter_noinfo
or eax, 0xffffffff
jmp 0x10029f7c
mov dword [ebx + 4], eax
jmp 0x10029ec0
or eax, 0xffffffff
jmp 0x10029f7b
mov edi, dword [ebp - 0x1010]
mov ecx, dword [edi*4 + sym.MSVCR110.dll___pioinfo]
mov edi, dword [ebp - 0x1014]
cmp dword [eax + ecx + 0x30], 0
mov ecx, dword [ebp - 0x1008]
je 0x10029f38
shr edi, 1
cmp dword [ebx + 4], 0
jne 0x10051dca
mov eax, ecx
jmp 0x10029f7a
mov edx, dword [ebp - 0x1010]
mov ebx, dword [ebp - 0x1018]
mov ecx, dword [edx*4 + sym.MSVCR110.dll___pioinfo]
push 0
push dword [eax + ecx + 0x2c]
push dword [eax + ecx + 0x28]
push ebx
call sym.MSVCR110.dll__lseeki64
mov ecx, dword [ebp - 0x101c]
mov esi, eax
mov eax, dword [ebp - 0x1010]
add esp, 0x10
mov eax, dword [eax*4 + sym.MSVCR110.dll___pioinfo]
cmp esi, dword [ecx + eax + 0x28]
jne 0x10051ecd
cmp edx, dword [ecx + eax + 0x2c]
jne 0x10051ecd
push 0
lea edx, [ebp - 0x1014]
push edx
push 0x1000
lea edx, [ebp - 0x1004]
push edx
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10051ecd
push 0
push dword [ebp - 0x1008]
push ebx
call sym.MSVCR110.dll__lseek
add esp, 0xc
test eax, eax
js 0x10051ecd
mov eax, dword [ebp - 0x1014]
cmp edi, eax
ja 0x10051ecd
lea ecx, [ebp - 0x1004]
test edi, edi
je 0x10051e9b
mov edx, ecx
add edx, eax
dec edi
cmp ecx, edx
jae 0x10051e9b
mov al, byte [ecx]
cmp al, 0xd
jne 0x10051e8a
lea eax, [edx - 1]
cmp ecx, eax
jae 0x10051e96
lea eax, [ecx + 1]
cmp byte [eax], 0xa
jne 0x10051e96
mov ecx, eax
jmp 0x10051e96
movzx eax, al
movsx eax, byte [eax + 0x100ca728]
add ecx, eax
inc ecx
test edi, edi
jne 0x10051e6c
lea eax, [ebp - 0x1004]
sub esi, eax
lea eax, [esi + ecx]
jmp 0x10029f7a
call sym.MSVCR110.dll__errno
mov dword [eax], 0x16
jmp 0x10051ecd
push 0
push ecx
push dword [ebp - 0x1018]
call sym.MSVCR110.dll__lseek
add esp, 0xc
test eax, eax
jns 0x10051ed5
or eax, 0xffffffff
jmp 0x10029f7a
mov eax, 0x200
cmp esi, eax
ja 0x10051eef
test byte [ebx + 0xc], 8
je 0x10051eef
test dword [ebx + 0xc], 0x400
mov esi, eax
je 0x10051ef2
mov esi, dword [ebx + 0x18]
mov eax, dword [ebp - 0x1010]
mov ecx, dword [ebp - 0x101c]
mov eax, dword [eax*4 + sym.MSVCR110.dll___pioinfo]
test byte [ecx + eax + 4], 4
mov ecx, dword [ebp - 0x1008]
jmp 0x1002b947
inc esi
jmp 0x1002b94d
shr esi, 1
jmp 0x1002b95c
shr edi, 1
jmp 0x10029f77