Function at 0x404e20
Capabilities:
Get common file path

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
mov rbp, rsp
sub rsp, 0x80
mov qword [rbp - 0x40], 0xfffffffffffffffe
mov qword [rsp + 0xc0], rbx
mov rax, qword [0x0041f2d0]
xor rax, rsp
mov qword [rbp - 0x10], rax
mov rsi, rcx
test rdx, rdx
je 0x404e73
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
lea rcx, [rsi + 8]
call fcn.004033a0
lea rbx, [rsi + 8]
cmp qword [rbx + 0x18], 0x10
jb 0x404e83
mov rcx, qword [rbx]
jmp 0x404e86
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov qword [rsi], rax
test rax, rax
jne 0x405033
xor r13d, r13d
mov qword [rbp - 0x60], r13
mov qword [rbp - 0x58], r13
mov qword [rbp - 0x50], r13
mov edx, 0x400
lea rcx, [rbp - 0x60]
call fcn.004034d0
nop
mov edx, 0x400
mov r12, qword [rbp - 0x60]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
cmp eax, 0x400
jae 0x405026
mov qword [rbp - 0x20], 0xf
mov qword [rbp - 0x28], r13
mov byte [rbp - 0x38], r13b
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, r12
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
mov rdx, r12
lea rcx, [rbp - 0x38]
call fcn.004033a0
nop
or rax, 0xffffffffffffffff
mov rcx, qword [rbp - 0x28]
sub rax, rcx
cmp rax, 1
ja 0x404f21
lea rcx, str.string_too_long
call qword [sym.imp.MSVCP100.dll_void___cdecl_std::_Xlength_error_char_const____ptr64_]
int3
lea rdi, [rcx + 1]
cmp rdi, 0xfffffffffffffffe
jbe 0x404f39
lea rcx, str.string_too_long
call qword [sym.imp.MSVCP100.dll_void___cdecl_std::_Xlength_error_char_const____ptr64_]
int3
mov rdx, qword [rbp - 0x20]
cmp rdx, rdi
jae 0x404f53
mov r8, rcx
mov rdx, rdi
lea rcx, [rbp - 0x38]
call fcn.00401300
jmp 0x404f6c
test rdi, rdi
jne 0x404f77
mov qword [rbp - 0x28], r13
lea rax, [rbp - 0x38]
cmp rdx, 0x10
cmovae rax, qword [rbp - 0x38]
mov byte [rax], dil
mov rcx, qword [rbp - 0x28]
mov rdx, qword [rbp - 0x20]
test rdi, rdi
setne al
test al, al
je 0x404fa5
lea rax, [rbp - 0x38]
cmp rdx, 0x10
cmovae rax, qword [rbp - 0x38]
mov byte [rax + rcx], 0x5c
mov qword [rbp - 0x28], rdi
lea rax, [rbp - 0x38]
cmp qword [rbp - 0x20], 0x10
cmovae rax, qword [rbp - 0x38]
mov byte [rax + rdi], 0
or r9, 0xffffffffffffffff
xor r8d, r8d
mov rdx, rbx
lea rcx, [rbp - 0x38]
call fcn.004048d0
lea rdx, [rbp - 0x38]
cmp rdx, rbx
je 0x404fff
mov rcx, qword [rbp - 0x38]
mov rdx, qword [rbp - 0x30]
mov rax, qword [rbx]
mov qword [rbp - 0x38], rax
mov rax, qword [rbx + 8]
mov qword [rbp - 0x30], rax
mov qword [rbx], rcx
mov qword [rbx + 8], rdx
mov rcx, qword [rbp - 0x28]
mov rax, qword [rbx + 0x10]
mov qword [rbp - 0x28], rax
mov qword [rbx + 0x10], rcx
mov rcx, qword [rbp - 0x20]
mov rax, qword [rbx + 0x18]
mov qword [rbp - 0x20], rax
mov qword [rbx + 0x18], rcx
cmp qword [rbx + 0x18], 0x10
jb 0x405009
mov rbx, qword [rbx]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov qword [rsi], rax
cmp qword [rbp - 0x20], 0x10
jb 0x405026
mov rcx, qword [rbp - 0x38]
call sub.MSVCR100.dll_void___cdecl_operator_delete_void____ptr64_
nop
test r12, r12
je 0x405033
mov rcx, r12
call sub.MSVCR100.dll_void___cdecl_operator_delete_void____ptr64_
mov rax, qword [rsi]
mov rcx, qword [rbp - 0x10]
xor rcx, rsp
call fcn.0040ead0
mov rbx, qword [rsp + 0xc0]
add rsp, 0x80
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret