Function at 0x100021730
Capabilities:
Read file on windows

Disassembly:
mov dword [rsp + 0x20], r9d
mov dword [rsp + 0x18], r8d
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
sub rsp, 0x68
mov qword [rsp + 0x48], 0xfffffffffffffffe
mov edx, dword [rsp + 0x80]
mov rcx, qword [rsp + 0x70]
call fcn.100020eb0
nop
mov rax, qword [rsp + 0x70]
lea rcx, [0x100003170]
mov qword [rax], rcx
mov rax, qword [rsp + 0x70]
mov ecx, dword [rsp + 0x88]
mov dword [rax + 0x28], ecx
mov rax, qword [rsp + 0x70]
mov ecx, dword [rsp + 0x90]
mov dword [rax + 0x20], ecx
mov rcx, qword [rsp + 0x70]
call fcn.100020650
mov dword [rsp + 0x50], eax
cmp dword [rsp + 0x50], 0
je 0x1000217b5
cmp dword [rsp + 0x50], 1
je 0x1000217c3
cmp dword [rsp + 0x50], 2
je 0x1000217d1
jmp 0x1000217dd
lea rax, [0x100002cdc]
mov qword [rsp + 0x38], rax
jmp 0x1000217dd
lea rax, [0x100002cdc]
mov qword [rsp + 0x38], rax
jmp 0x1000217dd
lea rax, [0x100002f60]
mov qword [rsp + 0x38], rax
mov rdx, qword [rsp + 0x38]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.msvcrt.dll_fopen]
mov rcx, qword [rsp + 0x70]
mov qword [rcx + 0x70], rax
mov rax, qword [rsp + 0x70]
cmp qword [rax + 0x70], 0
jne 0x100021831
call sub.msvcrt.dll__errno
mov rcx, qword [rsp + 0x70]
add rcx, 8
mov eax, dword [rax]
mov dword [rsp + 0x20], eax
mov r9, qword [rsp + 0x78]
lea r8, [0x100002f68]
mov edx, 1
call fcn.10001c360
jmp 0x100021a34
mov r8d, 2
xor edx, edx
mov rax, qword [rsp + 0x70]
mov rcx, qword [rax + 0x70]
call qword [sym.imp.msvcrt.dll_fseek]
test eax, eax
je 0x100021876
mov rax, qword [rsp + 0x70]
add rax, 8
mov dword [rsp + 0x20], 0
mov r9, qword [rsp + 0x78]
lea r8, [0x100002f90]
mov edx, 2
mov rcx, rax
call fcn.10001c360
mov rax, qword [rsp + 0x70]
mov rcx, qword [rax + 0x70]
call qword [sym.imp.msvcrt.dll_ftell]
mov dword [rsp + 0x30], eax
mov rax, qword [rsp + 0x70]
mov ecx, dword [rsp + 0x30]
mov dword [rax + 0x78], ecx
xor r8d, r8d
xor edx, edx
mov rax, qword [rsp + 0x70]
mov rcx, qword [rax + 0x70]
call qword [sym.imp.msvcrt.dll_fseek]
test eax, eax
je 0x1000218d7
mov rax, qword [rsp + 0x70]
add rax, 8
mov dword [rsp + 0x20], 0
mov r9, qword [rsp + 0x78]
lea r8, [0x100002f90]
mov edx, 2
mov rcx, rax
call fcn.10001c360
mov rax, qword [rsp + 0x70]
cmp dword [rax + 0x28], 0xffffffff
jne 0x1000218f0
mov rax, qword [rsp + 0x70]
mov ecx, dword [rsp + 0x30]
mov dword [rax + 0x28], ecx
jmp 0x10002190a
mov rax, qword [rsp + 0x70]
mov ecx, dword [rsp + 0x30]
cmp dword [rax + 0x28], ecx
jbe 0x10002190a
mov rax, qword [rsp + 0x70]
mov ecx, dword [rsp + 0x30]
mov dword [rax + 0x28], ecx
mov rax, qword [rsp + 0x70]
cmp dword [rax + 0x28], 0
jne 0x100021953
mov rax, qword [rsp + 0x70]
mov rcx, qword [rax + 0x70]
call qword [sym.imp.msvcrt.dll_fclose]
mov rax, qword [rsp + 0x70]
add rax, 8
mov dword [rsp + 0x20], 0
mov r9, qword [rsp + 0x78]
lea r8, [0x100002f90]
mov edx, 2
mov rcx, rax
call fcn.10001c360
jmp 0x100021a34
mov rax, qword [rsp + 0x70]
cmp dword [rax + 0x28], 0xffffffff
jbe 0x100021988
mov rax, qword [rsp + 0x70]
cmp dword [rax + 0x20], 0
jne 0x10002197c
mov rax, qword [rsp + 0x70]
mov eax, dword [rax + 0x28]
sub eax, 0xffffffff
mov rcx, qword [rsp + 0x70]
mov dword [rcx + 0x20], eax
mov rax, qword [rsp + 0x70]
mov dword [rax + 0x28], 0xffffffff
mov rax, qword [rsp + 0x70]
cmp dword [rax + 0x20], 0xffffffff
jbe 0x10002199f
mov rax, qword [rsp + 0x70]
mov dword [rax + 0x20], 0xffffffff
mov rax, qword [rsp + 0x70]
mov eax, dword [rax + 0x28]
mov ecx, eax
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new_unsigned_long_long_unsigned___int64__]
mov qword [rsp + 0x40], rax
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x40]
mov qword [rax + 0x38], rcx
mov rax, qword [rsp + 0x70]
mov eax, dword [rax + 0x28]
mov rcx, qword [rsp + 0x70]
mov r9, qword [rcx + 0x70]
mov r8d, eax
mov edx, 1
mov rax, qword [rsp + 0x70]
mov rcx, qword [rax + 0x38]
call qword [sym.imp.msvcrt.dll_fread]
mov rcx, qword [rsp + 0x70]
mov dword [rcx + 0x48], eax
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x70]
mov ecx, dword [rcx + 0x48]
mov eax, dword [rax + 0x78]
sub eax, ecx
mov rcx, qword [rsp + 0x70]
mov dword [rcx + 0x78], eax
mov rax, qword [rsp + 0x70]
cmp dword [rax + 0x78], 0
je 0x100021a29
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x70]
mov ecx, dword [rcx + 0x28]
cmp dword [rax + 0x48], ecx
jae 0x100021a34
mov rcx, qword [rsp + 0x70]
call fcn.100020860
nop
mov rax, qword [rsp + 0x70]
add rsp, 0x68
ret