Function at 0x101d8f1
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x20
mov ecx, dword [ebp + 0xc]
push ebx
xor ebx, ebx
test cl, cl
push esi
mov dword [ebp - 0x20], 0xc
mov dword [ebp - 0x1c], ebx
jns 0x101d883
mov dword [ebp - 0x18], ebx
mov byte [ebp - 1], 0x10
jmp 0x101d88e
mov dword [ebp - 0x18], 1
mov byte [ebp - 1], 0
mov eax, 0x8000
test eax, ecx
jne 0x101d8a8
test ch, 0x40
jne 0x101d8a4
cmp dword [0x1022cf8], eax
je 0x101d8a8
or byte [ebp - 1], 0x80
push 3
mov eax, ecx
pop esi
and eax, esi
sub eax, ebx
je 0x101d8cb
dec eax
je 0x101d8c2
dec eax
jne 0x101d8e9
mov dword [ebp - 0x10], 0xc0000000
jmp 0x101d8d2
mov dword [ebp - 0x10], 0x40000000
jmp 0x101d8d2
mov dword [ebp - 0x10], 0x80000000
mov eax, dword [ebp + 0x10]
cmp eax, 0x10
je 0x101d918
cmp eax, 0x20
je 0x101d90f
cmp eax, 0x30
je 0x101d906
cmp eax, 0x40
je 0x101d901
mov dword [0x1022964], 0x16
mov dword [0x1022968], ebx
or eax, 0xffffffff
jmp 0x101dae0
mov dword [ebp - 8], esi
jmp 0x101d91b
mov dword [ebp - 8], 2
jmp 0x101d91b
mov dword [ebp - 8], 1
jmp 0x101d91b
mov dword [ebp - 8], ebx
mov eax, ecx
mov edx, 0x700
and eax, edx
mov ecx, 0x400
cmp eax, ecx
push edi
mov edi, 0x100
jg 0x101d962
je 0x101d95d
cmp eax, ebx
je 0x101d95d
cmp eax, edi
je 0x101d954
cmp eax, 0x200
je 0x101d98c
cmp eax, 0x300
jne 0x101d974
mov dword [ebp - 0xc], 2
jmp 0x101d99c
mov dword [ebp - 0xc], 4
jmp 0x101d99c
mov dword [ebp - 0xc], esi
jmp 0x101d99c
cmp eax, 0x500
je 0x101d995
cmp eax, 0x600
je 0x101d98c
cmp eax, edx
je 0x101d995
mov dword [0x1022964], 0x16
mov dword [0x1022968], ebx
or eax, 0xffffffff
jmp 0x101dadf
mov dword [ebp - 0xc], 5
jmp 0x101d99c
mov dword [ebp - 0xc], 1
mov eax, dword [ebp + 0xc]
test edi, eax
mov esi, 0x80
je 0x101d9ba
mov ecx, dword [0x102296c]
not ecx
and ecx, dword [ebp + 0x14]
test cl, cl
js 0x101d9ba
xor esi, esi
inc esi
test al, 0x40
je 0x101d9d5
or byte [ebp - 0xe], 1
or esi, 0x4000000
cmp dword [0x1022970], 2
jne 0x101d9d5
or dword [ebp - 8], 4
test ah, 0x10
je 0x101d9dc
or esi, edi
test al, 0x20
je 0x101d9e8
or esi, 0x8000000
jmp 0x101d9f2
test al, 0x10
je 0x101d9f2
or esi, 0x10000000
call fcn.0101dba0
mov ebx, eax
or edi, 0xffffffff
cmp ebx, edi
jne 0x101da18
and dword [0x1022968], 0
mov dword [0x1022964], 0x18
mov eax, edi
jmp 0x101dadf
push 0
push esi
push dword [ebp - 0xc]
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 8]
push dword [ebp - 0x10]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, edi
je 0x101da49
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
test eax, eax
jne 0x101da58
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0101db35
pop ecx
jmp 0x101da11
cmp eax, 2
jne 0x101da63
or byte [ebp - 1], 0x40
jmp 0x101da6c
cmp eax, 3
jne 0x101da6c
or byte [ebp - 1], 8
push esi
push ebx
call fcn.0101dc4b
mov al, byte [ebp - 1]
pop ecx
pop ecx
mov ecx, ebx
sar ecx, 5
or al, 1
mov esi, ebx
and esi, 0x1f
lea edi, [ecx*4 + 0x1023040]
mov ecx, dword [edi]
shl esi, 3
mov byte [ebp - 1], al
and byte [ebp - 1], 0x48
mov byte [ecx + esi + 4], al
jne 0x101dac8
test al, al
jns 0x101dac8
test byte [ebp + 0xc], 2
je 0x101dac8
push 2
push 0xffffffffffffffff
push ebx
call fcn.0101d0ce
add esp, 0xc
cmp eax, 0xffffffff
mov dword [ebp - 0x10], eax
jne 0x101dae4
cmp dword [0x1022968], 0x83
jne 0x101db24
cmp byte [ebp - 1], 0
jne 0x101dadd
test byte [ebp + 0xc], 8
je 0x101dadd
mov eax, dword [edi]
lea eax, [eax + esi + 4]
or byte [eax], 0x20
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret
and dword [ebp - 0x14], 0
push 1
lea eax, [ebp - 0x14]
push eax
push ebx
call fcn.0101e2d9
add esp, 0xc
test eax, eax
jne 0x101db12
cmp word [ebp - 0x14], 0x1a
jne 0x101db12
push dword [ebp - 0x10]
push ebx
call fcn.0101e88b
cmp eax, 0xffffffff
pop ecx
pop ecx
je 0x101db24
push 0
push 0
push ebx
call fcn.0101d0ce
add esp, 0xc
cmp eax, 0xffffffff
jne 0x101dac8
push ebx
call fcn.01019fc9
pop ecx
jmp 0x101d984