Function at 0x140004590
Capabilities:
Check if file exists
Read file via mapping

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x58
mov r15d, r9d
mov rdi, r8
mov r13, rdx
mov rsi, rcx
mov r14d, dword [rsp + 0xc0]
mov rax, qword [0x1401f5028]
xor rax, rsp
mov qword [rsp + 0x50], rax
lea eax, [r14 + r15]
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rcx, 0xffffffffffffffff
xor edx, edx
mov r8d, 0x8000004
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov rbx, rax
cmp qword [rsi + 0x28], rax
je 0x14000462f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov rax, qword [rsi + 0x28]
inc rax
cmp rax, 2
jae 0x1400048f9
mov rax, rbx
inc rax
cmp rax, 2
jb 0x140004623
mov qword [rsi + 0x28], rbx
call fcn.1400c18d0
mov ecx, ebp
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rbx, qword [rsi + 0x28]
mov rbp, qword [rsp + 0xc8]
lea rax, [rbx + 1]
cmp rax, 1
jbe 0x14000491b
mov qword [rsp + 0x20], 0
mov rcx, rbx
mov edx, 6
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
test rax, rax
je 0x14000492b
mov r12, rax
mov ebp, r15d
mov ebx, r14d
test rdi, rdi
je 0x1400046c9
test r14d, r14d
je 0x1400046c9
lea rcx, [r12 + rbp]
mov rdx, rdi
mov r8, rbx
call fcn.1400f5740
lea rax, [r12 + rbp]
add rax, 8
xor ecx, ecx
mov rdx, qword [rax + rcx*8 - 8]
test rdx, rdx
jne 0x1400046b6
mov rdx, qword [rax + rcx*8]
test rdx, rdx
jne 0x1400046c0
add rcx, 2
cmp rcx, 0x40
jne 0x140004697
jmp 0x1400046c9
sub rdx, rdi
mov qword [rax + rcx*8 - 8], rdx
jmp 0x1400046a1
sub rdx, rdi
mov qword [rax + rcx*8], rdx
jmp 0x1400046aa
mov qword [0x1402009f0], rbp
mov rcx, rsi
call fcn.140003880
test al, al
je 0x14000493e
movabs rbp, 0xaaaaaaaaaaaaaaaa
lea r14, [rsp + 0x48]
mov qword [r14], rbp
mov rcx, qword [rsi]
mov qword [rsp + 0x20], r14
lea rdx, [0x1402009f0]
mov r9d, 8
mov r8, rdx
call qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x14000488d
cmp qword [rsp + 0x48], 8
mov qword [0x1402009f0], 0
jne 0x140004914
mov qword [0x1402009f8], rbx
mov rcx, rsi
call fcn.140003880
test al, al
je 0x140004948
mov qword [rsp + 0x48], rbp
mov rcx, qword [rsi]
mov qword [rsp + 0x20], r14
lea rdx, [0x1402009f8]
mov r9d, 8
mov r8, rdx
call qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x1400048cd
cmp qword [rsp + 0x48], 8
mov qword [0x1402009f8], 0
jne 0x140004914
mov ecx, 0x40
call fcn.1400f045c
mov rdi, rax
mov r9, qword [rsi + 0x40]
mov r8d, dword [rsi + 0x10]
mov rdx, qword [rsi]
mov qword [rsp + 0x20], r13
mov rcx, rax
call fcn.1400049d0
mov rbx, qword [rsi + 0x38]
mov qword [rsi + 0x38], rdi
test rbx, rbx
jne 0x14000494f
mov rcx, rdi
mov rdx, r12
mov r8d, r15d
mov r9d, 0x400
call fcn.140004e60
test al, al
je 0x140004968
lea rdi, [rsp + 0x40]
mov r15, rbp
mov qword [rdi], rbp
mov rbx, qword [rsi]
mov rbp, qword [rsi + 0x28]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
xor ecx, ecx
mov dword [rsp + 0x30], ecx
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], 7
mov rcx, rax
mov rdx, rbp
mov r8, rbx
mov r9, rdi
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x140004972
mov rax, qword [rsp + 0x40]
mov qword [0x1402002a8], rax
mov rcx, rsi
call fcn.140003880
test al, al
je 0x14000498c
mov qword [rsp + 0x48], r15
mov rcx, qword [rsi]
mov qword [rsp + 0x20], r14
lea rdx, [0x1402002a8]
mov r9d, 8
mov r8, rdx
call qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x1400048df
cmp qword [rsp + 0x48], 8
mov qword [0x1402002a8], 0
jne 0x140004914
mov rcx, rsi
call fcn.1400049a0
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor esi, esi
jmp 0x1400048ad
mov esi, 0x39
mov qword [0x1402009f0], 0
mov rdi, qword [rsp + 0xc8]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rdi], eax
mov rcx, qword [rsp + 0x50]
xor rcx, rsp
call fcn.1400f32c0
mov eax, esi
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov esi, 0x39
mov qword [0x1402009f8], 0
jmp 0x14000489d
mov esi, 0x39
mov rdi, qword [rsp + 0xc8]
mov qword [0x1402002a8], 0
jmp 0x1400048a5
call fcn.1400c18d0
mov rcx, qword [rsi + 0x28]
call fcn.1400def50
mov qword [rsi + 0x28], 0
jmp 0x14000460e
mov esi, 0x3a
jmp 0x14000489d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rbp], eax
mov esi, 0x19
jmp 0x1400048ad
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rbp], eax
mov esi, 0x1b
jmp 0x1400048ad
mov esi, 8
jmp 0x140004892
mov esi, 8
jmp 0x1400048d2
mov rcx, rbx
call fcn.14002e2e0
mov rcx, rbx
call fcn.1400f0498
mov rdi, qword [rsi + 0x38]
jmp 0x1400047be
mov esi, 4
jmp 0x1400048ad
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, qword [rsp + 0xc8]
mov dword [rcx], eax
mov esi, 0x1a
jmp 0x1400048ad
mov esi, 8
jmp 0x1400048e4