Function at 0x140021980
Capabilities:
Get file size
Read file on windows

Disassembly:
mov rax, rsp
push rbp
push rdi
push r13
push r14
push r15
lea rbp, [rax - 0x78]
sub rsp, 0x150
mov qword [rbp + 0x10], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov qword [rax + 0x20], rsi
mov rax, qword [0x14004f018]
xor rax, rsp
mov qword [rbp + 0x40], rax
mov r15, rdx
mov r13, rcx
mov rcx, qword [rdx]
test rcx, rcx
je 0x140021e57
mov rcx, qword [rcx]
cmp rcx, 0xffffffffffffffff
je 0x140021e57
lea rdx, [rbp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp eax, 0xffffffff
jne 0x1400219f2
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x140021e57
mov ebx, dword [rbp + 0x20]
shl rbx, 0x20
add rbx, rdi
mov rcx, r15
call fcn.140014030
test al, al
je 0x140021e57
xorps xmm0, xmm0
movdqa xmmword [rsp + 0x70], xmm0
xorps xmm1, xmm1
movdqa xmmword [rbp - 0x80], xmm1
movdqa xmmword [rbp - 0x70], xmm0
movdqa xmmword [rbp - 0x60], xmm1
xor esi, esi
mov qword [rbp - 0x50], rsi
mov dword [rbp - 0x48], 0xffffffff
lea rcx, [rsp + 0x70]
call fcn.140020e60
mov qword [rbp + 0x20], rsi
mov qword [rbp + 0x28], rsi
mov qword [rbp + 0x30], rsi
lea rdx, [rbp + 0x20]
lea rcx, [rsp + 0x70]
call fcn.140009fe0
mov rdi, qword [rbp + 0x28]
sub rdi, qword [rbp + 0x20]
mov rcx, qword [rbp + 0x20]
test rcx, rcx
je 0x140021aa9
mov rdx, qword [rbp + 0x30]
sub rdx, rcx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140021a98
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140021a98
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140025dd4
xorps xmm0, xmm0
movdqu xmmword [rbp + 0x20], xmm0
mov qword [rbp + 0x30], rsi
lea rcx, [rsp + 0x70]
call fcn.140023600
cmp rbx, rdi
jb 0x140021e57
xorps xmm0, xmm0
movdqu xmmword [rsp + 0x58], xmm0
mov qword [rsp + 0x68], rsi
mov byte [rsp + 0x30], 0
lea rax, [rsp + 0x58]
mov qword [rbp + 0x20], rax
lea rax, [rsp + 0x30]
mov qword [rbp + 0x28], rax
movaps xmm0, xmmword [rbp + 0x20]
movdqa xmmword [rbp + 0x20], xmm0
lea r8, [rbp + 0x20]
mov rdx, rdi
lea rcx, [rsp + 0x58]
call fcn.14000ce50
mov dword [rsp + 0x34], esi
mov rcx, qword [r15]
test rcx, rcx
je 0x140021e03
mov rdx, qword [rsp + 0x58]
test rdx, rdx
je 0x140021e03
cmp qword [rcx], 0xffffffffffffffff
je 0x140021e03
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x34]
mov r8d, edi
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140021e03
mov eax, dword [rsp + 0x34]
cmp rax, rdi
jne 0x140021e03
mov qword [rsp + 0x70], rsi
mov qword [rsp + 0x78], rsi
xorps xmm0, xmm0
movdqa xmmword [rbp - 0x80], xmm0
xorps xmm1, xmm1
movdqa xmmword [rbp - 0x70], xmm1
mov qword [rbp - 0x60], rsi
mov qword [rbp - 0x58], rsi
mov qword [rbp - 0x50], rsi
mov dword [rbp - 0x48], 0xffffffff
mov qword [rbp + 0x20], rsi
lea r8, [rsp + 0x70]
lea rdx, [rbp + 0x20]
lea rcx, [rsp + 0x58]
call fcn.1400215e0
test al, al
jne 0x140021b9d
xor bl, bl
jmp 0x140021c90
mov qword [rbp - 0x40], rsi
mov qword [rbp - 0x38], rsi
xorps xmm0, xmm0
movdqa xmmword [rbp - 0x30], xmm0
xorps xmm1, xmm1
movdqa xmmword [rbp - 0x20], xmm1
mov qword [rbp - 0x10], rsi
mov qword [rbp - 8], rsi
mov qword [rbp], rsi
mov dword [rbp + 8], 0xffffffff
lea rcx, [rbp - 0x40]
call fcn.140020e60
mov r8, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x70]
sub r8, rcx
mov rax, qword [rbp - 0x38]
mov rdx, qword [rbp - 0x40]
sub rax, rdx
cmp r8, rax
jne 0x140021c72
call sub.VCRUNTIME140.dll_memcmp
test eax, eax
jne 0x140021c72
mov r8, qword [rbp - 0x58]
mov r14, qword [rbp - 0x60]
sub r8, r14
mov rax, qword [rbp - 8]
mov rdx, qword [rbp - 0x10]
sub rax, rdx
cmp r8, rax
jne 0x140021c72
mov rcx, r14
call sub.VCRUNTIME140.dll_memcmp
test eax, eax
jne 0x140021c72
mov eax, dword [rbp + 8]
cmp dword [rbp - 0x48], eax
jne 0x140021c72
cmp rbx, rdi
jne 0x140021c33
mov bl, 1
jmp 0x140021c86
mov dword [rsp + 0x38], esi
mov rcx, qword [r15]
test rcx, rcx
je 0x140021c72
cmp qword [rcx], 0xffffffffffffffff
je 0x140021c72
mov dword [rsp + 0x34], esi
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x34]
mov r8d, 4
lea rdx, [rsp + 0x38]
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140021c72
cmp dword [rsp + 0x34], 4
je 0x140021c76
xor bl, bl
jmp 0x140021c86
mov esi, dword [rsp + 0x38]
sub rbx, rdi
cmp rsi, rbx
jbe 0x140021c9f
xor bl, bl
xor esi, esi
lea rcx, [rbp - 0x40]
call fcn.140023600
nop
lea rcx, [rsp + 0x70]
call fcn.140023600
jmp 0x140021e05
xor ebx, ebx
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x48], rbx
mov qword [rsp + 0x50], rbx
mov byte [rsp + 0x30], bl
lea rax, [rsp + 0x40]
mov qword [rbp + 0x20], rax
lea rax, [rsp + 0x30]
mov qword [rbp + 0x28], rax
movaps xmm0, xmmword [rbp + 0x20]
movdqa xmmword [rbp + 0x20], xmm0
lea r8, [rbp + 0x20]
mov rdx, rsi
lea rcx, [rsp + 0x40]
call fcn.14000ce50
mov rcx, qword [r15]
test rcx, rcx
je 0x140021da9
mov rdx, qword [rsp + 0x40]
test rdx, rdx
je 0x140021da9
cmp qword [rcx], 0xffffffffffffffff
je 0x140021da9
mov dword [rsp + 0x34], ebx
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x34]
mov r8d, esi
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140021da9
mov eax, dword [rsp + 0x34]
cmp rax, rsi
jne 0x140021da9
cmp r14, qword [rbp - 0x58]
je 0x140021da9
cmp byte [r14], bl
jne 0x140021da9
mov rcx, qword [rsp + 0x48]
movzx eax, cl
mov r9, qword [rsp + 0x40]
sub al, r9b
test al, 7
jne 0x140021da9
cmp r9, rcx
je 0x140021d97
mov rax, qword [rbp - 0x70]
mov rbx, qword [rbp - 0x78]
sub rax, rbx
cmp rax, 0x10
jne 0x140021da9
sub ecx, r9d
lea r8, [rbp + 0x20]
mov edx, ecx
mov rcx, r9
call fcn.140016d10
mov r8, rbx
lea rdx, [rbp + 0x20]
sub rdx, rbx
nop
movzx eax, byte [rdx + rbx]
cmp byte [rbx], al
jne 0x140021da9
inc rbx
mov rax, rbx
sub rax, r8
cmp rax, 0x10
jb 0x140021d80
lea rdx, [rsp + 0x40]
mov rcx, r13
call fcn.140021ff0
movzx ebx, al
jmp 0x140021dab
xor bl, bl
mov rcx, qword [rsp + 0x40]
test rcx, rcx
je 0x140021c84
mov rdx, qword [rsp + 0x50]
sub rdx, rcx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140021de9
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140021de9
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140025dd4
xorps xmm0, xmm0
movdqu xmmword [rsp + 0x40], xmm0
xor esi, esi
mov qword [rsp + 0x50], rsi
jmp 0x140021c86
xor bl, bl
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x140021e52
mov rdx, qword [rsp + 0x68]
sub rdx, rcx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140021e3f
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140021e3f
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140025dd4
xorps xmm0, xmm0
movdqu xmmword [rsp + 0x58], xmm0
mov qword [rsp + 0x68], rsi
movzx eax, bl
jmp 0x140021e59
xor al, al
mov rcx, qword [rbp + 0x40]
xor rcx, rsp
call fcn.140025ac0
lea r11, [rsp + 0x150]
mov rbx, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop rdi
pop rbp
ret