Function at 0x1001721
Capabilities:
Check if file exists
Get file attributes
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x944
mov eax, dword [0x1004078]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x920], eax
xor eax, eax
cmp dword [ebp + 8], eax
mov dword [ebp - 0x91c], eax
jle 0x1001b64
push ebx
push esi
push edi
mov ecx, dword [ebp - 0x920]
mov ebx, dword [ecx + eax*4]
push ebx
mov dword [ebp - 0x914], ebx
call fcn.01001366
cmp dword [0x10040bc], 0
je 0x100177f
push ebx
push 0x271c
push 1
call fcn.01002de4
add esp, 0xc
push 0x5c
push ebx
call dword [sym.imp.msvcrt.dll_strrchr]
mov esi, eax
test esi, esi
pop ecx
pop ecx
jne 0x10017a5
mov esi, 0x1001168
lea edi, [ebp - 0x10c]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov esi, ebx
jmp 0x1001834
lea eax, [esi + 1]
cmp byte [eax], 0
jne 0x10017ec
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10017b2
sub eax, edx
cmp eax, 0x104
jbe 0x10017d4
push ebx
push 0x272f
call fcn.010012a9
pop ecx
pop ecx
jmp 0x1001956
lea edx, [ebp - 0x10c]
mov eax, ebx
sub edx, ebx
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x10017de
mov byte [esi], cl
jmp 0x1001834
mov esi, eax
mov eax, dword [ebp - 0x914]
mov bl, byte [esi]
mov byte [esi], 0
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x10017fc
sub eax, ecx
cmp eax, 0x104
jbe 0x1001814
push dword [ebp - 0x914]
jmp 0x10017c3
mov eax, dword [ebp - 0x914]
lea edx, [ebp - 0x10c]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x1001822
mov byte [esi], bl
mov ebx, dword [ebp - 0x914]
mov edi, dword [sym.imp.msvcrt.dll_strchr]
push 0x2a
push esi
call edi
test eax, eax
pop ecx
pop ecx
jne 0x1001b3e
push 0x3f
push esi
call edi
test eax, eax
pop ecx
pop ecx
jne 0x1001b3e
lea eax, [ebp - 0x944]
push eax
push ebx
call dword [sym.imp.msvcrt.dll__stat]
test eax, eax
pop ecx
pop ecx
jne 0x100188e
mov eax, dword [ebp - 0x93e]
and eax, 0xf000
cmp ax, 0x8000
je 0x100188e
cmp ax, 0x4000
je 0x100188e
push ebx
push 0x2730
jmp 0x10017c8
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x10018a5
push ebx
push 0x2731
jmp 0x10017c8
cmp dword [0x10040a4], 0
jne 0x10018bd
test al, 2
je 0x10018bd
push ebx
push 0x273c
jmp 0x10017c8
test al, 0x10
je 0x10018ec
cmp dword [0x10040b8], 0
je 0x10018e1
push 0xfff
push esi
lea eax, [ebp - 0x10c]
push eax
call fcn.01001578
jmp 0x1001b4b
push ebx
push 0x2732
jmp 0x10017c8
and al, 1
neg al
sbb eax, eax
and eax, 0xffffff6e
add eax, 0x1b6
mov edi, eax
mov eax, dword [0x10040b0]
neg eax
sbb eax, eax
and eax, 0xffffc000
add eax, 0x8000
push eax
push ebx
call dword [sym.imp.msvcrt.dll__open]
test eax, eax
pop ecx
pop ecx
mov dword [ebp - 0x910], eax
jge 0x1001960
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov ecx, dword [sym.imp.msvcrt.dll__sys_errlist]
push dword [ecx + eax*4]
push ebx
push 0x1001158
push 0x200
push 0x1004380
call dword [sym.imp.msvcrt.dll__snprintf]
add esp, 0x14
mov byte [0x100457f], 0
call fcn.0100138b
jmp 0x1001b4b
cmp dword [0x10040bc], 0
je 0x1001979
push ebx
push 0x271d
push 1
call fcn.01002de4
add esp, 0xc
lea eax, [ebp - 0x944]
push eax
push dword [ebp - 0x910]
call dword [sym.imp.msvcrt.dll__fstat]
test eax, eax
pop ecx
pop ecx
jge 0x10019cd
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
mov ecx, dword [sym.imp.msvcrt.dll__sys_errlist]
push dword [ecx + eax*4]
push ebx
push 0x1001158
push 0x200
push 0x1004380
call dword [sym.imp.msvcrt.dll__snprintf]
add esp, 0x14
mov byte [0x100457f], 0
call fcn.0100138b
jmp 0x1001a64
xor ebx, ebx
cmp dword [0x10040b0], ebx
je 0x10019e4
push dword [ebp - 0x910]
call fcn.01001307
jmp 0x10019ea
mov eax, dword [ebp - 0x930]
push esi
push eax
mov dword [ebp - 0x918], eax
movzx eax, di
push eax
push 0x1001148
lea eax, [ebp - 0x90c]
push 0x800
push eax
call dword [sym.imp.msvcrt.dll__snprintf]
add esp, 0x18
cmp dword [0x10040bc], ebx
mov byte [ebp - 0x10d], 0
je 0x1001a35
lea eax, [ebp - 0x90c]
push eax
push 0x271e
push 1
call fcn.01002de4
add esp, 0xc
lea eax, [ebp - 0x90c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001a3e
push ebx
sub eax, edx
push eax
lea eax, [ebp - 0x90c]
push eax
push dword [0x1004370]
call fcn.01002d95
call fcn.010014a6
test eax, eax
jge 0x1001a76
push dword [ebp - 0x910]
call dword [sym.imp.msvcrt.dll__close]
pop ecx
jmp 0x1001b4b
cmp dword [ebp - 0x918], 0
jle 0x1001ae2
mov eax, dword [ebp - 0x918]
lea ecx, [ebx + 0x800]
cmp ecx, eax
jle 0x1001a93
sub eax, ebx
jmp 0x1001a98
mov eax, 0x800
push eax
lea eax, [ebp - 0x90c]
push eax
push dword [ebp - 0x910]
call dword [sym.imp.msvcrt.dll__read]
mov esi, eax
add esp, 0xc
test esi, esi
je 0x1001b13
mov edi, esi
push 0
push edi
lea eax, [ebp - 0x90c]
push eax
push dword [0x1004370]
call fcn.01002d95
test eax, eax
jl 0x1001b70
sub edi, eax
jne 0x1001ab7
add ebx, esi
cmp ebx, dword [ebp - 0x918]
jl 0x1001a7f
push 1
lea eax, [ebp - 0x90c]
push eax
push dword [ebp - 0x910]
call dword [sym.imp.msvcrt.dll__read]
add esp, 0xc
test eax, eax
jne 0x1001b13
push eax
push 1
push 0x1001145
push dword [0x1004370]
call fcn.01002d95
jmp 0x1001b2a
push dword [ebp - 0x914]
push 0x2733
call fcn.010012a9
pop ecx
pop ecx
call fcn.0100138b
push dword [ebp - 0x910]
call dword [sym.imp.msvcrt.dll__close]
pop ecx
call fcn.010014a6
jmp 0x1001b4b
push esi
lea eax, [ebp - 0x10c]
push eax
call fcn.01001c05
mov eax, dword [ebp - 0x91c]
inc eax
cmp eax, dword [ebp + 8]
mov dword [ebp - 0x91c], eax
jl 0x1001751
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
call fcn.01002a47
leave
ret 8
call fcn.010013fd
int3