Function at 0x140022160
Capabilities:
Check if file exists
Get file size

Disassembly:
mov byte [rsp + 0x18], r8b
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rsi
push rdi
sub rsp, 0x1e8
mov dword [rsp + 0x40], 0
movzx eax, byte [rsp + 0x210]
test eax, eax
jne 0x140022513
mov eax, 0x10
mov eax, eax
mov ecx, dword [0x1402d9d60]
mov rdx, qword gs:[0x58]
add rax, qword [rdx + rcx*8]
mov rdx, rax
lea rcx, [rsp + 0xa0]
call fcn.140226e40
nop
mov qword [rsp + 0xb8], 0
lea rcx, [rsp + 0x178]
call fcn.1400186a0
lea rcx, [rsp + 0xf8]
mov rdi, rcx
mov rsi, rax
mov ecx, 0x10
rep movsb byte [rdi], byte [rsi]
lea rax, [rsp + 0x110]
lea rcx, [rsp + 0xf8]
mov rdi, rax
mov rsi, rcx
mov ecx, 0x10
rep movsb byte [rdi], byte [rsi]
lea r8, [rsp + 0xb8]
mov rdx, qword [rsp + 0x200]
lea rcx, [rsp + 0x110]
call fcn.140012ce0
mov qword [rsp + 0x90], rax
cmp qword [rsp + 0x90], 0
jne 0x140022254
mov dword [rsp + 0x60], 3
lea rcx, [rsp + 0xa0]
call fcn.140226f70
mov eax, dword [rsp + 0x60]
jmp 0x1400226d4
mov qword [rsp + 0x58], 0
lea rax, [rsp + 0x80]
mov rdi, rax
xor eax, eax
mov ecx, 8
rep stosb byte [rdi], al
mov qword [rsp + 0x48], 0
mov qword [rsp + 0x88], 0
mov qword [rsp + 0x98], 0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x8000000
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov r8d, 1
mov edx, 0x80000000
mov rcx, qword [rsp + 0x90]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0x48], rax
cmp qword [rsp + 0x48], 0xffffffffffffffff
jne 0x1400222e2
mov qword [rsp + 0x48], 0
jmp 0x14002248b
lea rax, [rsp + 0xc0]
mov rdi, rax
xor eax, eax
mov ecx, 8
rep stosb byte [rdi], al
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0x80], rax
lea rdx, [rsp + 0x80]
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x140022322
jmp 0x14002248b
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0x7fffffff
jle 0x140022363
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [rsp + 0x64], 2
lea rcx, [rsp + 0xa0]
call fcn.140226f70
mov eax, dword [rsp + 0x64]
jmp 0x1400226d4
cmp qword [rsp + 0x58], 0
jne 0x1400223ca
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [rsp + 0x40], 1
mov rax, qword [rsp + 0x208]
mov qword [rax], 0
mov rax, qword [rsp + 0x208]
mov qword [rax + 8], 0
mov rax, qword [rsp + 0x208]
mov dword [rax + 0x10], 0
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x68], eax
lea rcx, [rsp + 0xa0]
call fcn.140226f70
mov eax, dword [rsp + 0x68]
jmp 0x1400226d4
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
xor r9d, r9d
mov r8d, 2
xor edx, edx
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov qword [rsp + 0x88], rax
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
xor r9d, r9d
xor r8d, r8d
mov edx, 4
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.KERNEL32.dll_MapViewOfFileEx]
mov qword [rsp + 0x98], rax
mov rax, qword [rsp + 0x208]
mov rcx, qword [rsp + 0x88]
mov qword [rax], rcx
mov rax, qword [rsp + 0x208]
mov rcx, qword [rsp + 0x98]
mov qword [rax + 8], rcx
mov rax, qword [rsp + 0x208]
mov ecx, dword [rsp + 0x58]
mov dword [rax + 0x10], ecx
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x6c], eax
lea rcx, [rsp + 0xa0]
call fcn.140226f70
mov eax, dword [rsp + 0x6c]
jmp 0x1400226d4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x70], eax
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [rsp + 0x40], 3
mov eax, dword [rsp + 0x70]
mov dword [rsp + 0x44], eax
cmp dword [rsp + 0x44], 2
je 0x1400224d5
cmp dword [rsp + 0x44], 3
je 0x1400224d5
cmp dword [rsp + 0x44], 5
je 0x1400224df
cmp dword [rsp + 0x44], 0xc
je 0x1400224df
cmp dword [rsp + 0x44], 0xf
je 0x1400224d5
jmp 0x1400224e7
mov dword [rsp + 0x40], 4
jmp 0x1400224e7
mov dword [rsp + 0x40], 5
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x74], eax
lea rcx, [rsp + 0xa0]
call fcn.140226f70
mov eax, dword [rsp + 0x74]
jmp 0x1400226d4
lea rcx, [rsp + 0x188]
call fcn.140018630
lea rcx, [rsp + 0x120]
mov rdi, rcx
mov rsi, rax
mov ecx, 0x10
rep movsb byte [rdi], byte [rsi]
lea rax, [rsp + 0x130]
lea rcx, [rsp + 0x120]
mov rdi, rax
mov rsi, rcx
mov ecx, 0x10
rep movsb byte [rdi], byte [rsi]
mov r9, qword [rsp + 0x200]
mov r8d, 1
lea rdx, [rsp + 0x130]
lea rcx, [rsp + 0x1b8]
call fcn.140010960
lea rcx, [rsp + 0x198]
mov rdi, rcx
mov rsi, rax
mov ecx, 0x20
rep movsb byte [rdi], byte [rsi]
lea rax, [rsp + 0xd0]
lea rcx, [rsp + 0x198]
mov rdi, rax
mov rsi, rcx
mov ecx, 0x20
rep movsb byte [rdi], byte [rsi]
cmp qword [rsp + 0xe8], 0x7fffffff
jle 0x1400225cf
mov dword [rsp + 0x40], 2
lea rcx, [rsp + 0xd0]
call fcn.140010af0
jmp 0x1400226d0
cmp qword [rsp + 0xe0], 0
je 0x140022614
mov rax, qword [rsp + 0x208]
mov qword [rax], 0
mov rax, qword [rsp + 0x208]
mov rcx, qword [rsp + 0xe0]
mov qword [rax + 8], rcx
mov rax, qword [rsp + 0x208]
mov ecx, dword [rsp + 0xe8]
mov dword [rax + 0x10], ecx
jmp 0x1400226d0
lea rax, [rsp + 0x140]
mov rdi, rax
xor eax, eax
mov ecx, 0x38
rep stosb byte [rdi], al
mov rdx, qword [rsp + 0x200]
lea rcx, [rsp + 0x140]
call fcn.140010610
mov dword [rsp + 0x78], eax
lea rdx, [rsp + 0x140]
lea rcx, [rsp + 0xf0]
call fcn.140022720
mov rdx, rax
lea rcx, [rsp + 0xc8]
call fcn.140221050
nop
mov eax, dword [rsp + 0x78]
mov dword [rsp + 0x50], eax
cmp dword [rsp + 0x50], 1
je 0x140022686
cmp dword [rsp + 0x50], 4
je 0x140022690
cmp dword [rsp + 0x50], 5
je 0x14002269a
jmp 0x1400226a2
mov dword [rsp + 0x40], 3
jmp 0x1400226a2
mov dword [rsp + 0x40], 4
jmp 0x1400226a2
mov dword [rsp + 0x40], 5
cmp dword [rsp + 0x40], 0
jne 0x1400226c3
lea rcx, [rsp + 0x140]
call fcn.140229c20
test rax, rax
jne 0x1400226c3
mov dword [rsp + 0x40], 1
lea rcx, [rsp + 0xc8]
call fcn.140022790
mov eax, dword [rsp + 0x40]
add rsp, 0x1e8
pop rdi
pop rsi
ret