Function at 0x417540
Capabilities:
Check if file exists
Get common file path

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x498
lea rsi, [rsp + 0x1c0]
test rdx, rdx
mov rdi, rcx
mov r12, rdx
lea rax, [rsi + 0x10]
mov qword [rsp + 0x1c0], rax
je 0x417df0
mov rcx, rdx
call sub.msvcrt.dll_wcslen
lea rbx, [rax + rax]
mov rdx, rbx
sar rdx, 1
cmp rdx, 7
mov qword [rsp + 0x58], rdx
ja 0x417c50
cmp rdx, 1
mov rcx, qword [rsp + 0x1c0]
je 0x417da0
test rdx, rdx
jne 0x417c78
lea rbx, [rsp + 0x280]
xor r11d, r11d
mov qword [rsp + 0x1c8], rdx
mov word [rcx + rdx*2], r11w
mov edx, 0x104
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x417d85
cmp eax, 0x103
ja 0x417c10
lea r14, [rsp + 0x220]
mov rcx, rbx
lea rax, [r14 + 0x10]
mov qword [rsp + 0x220], rax
call sub.msvcrt.dll_wcslen
lea rbp, [rax + rax]
mov rdx, rbp
sar rdx, 1
cmp rdx, 7
mov qword [rsp + 0x68], rdx
ja 0x417c95
cmp rdx, 1
mov rcx, qword [rsp + 0x220]
je 0x417db0
test rdx, rdx
jne 0x417cbd
xor r10d, r10d
mov qword [rsp + 0x228], rdx
mov word [rcx + rdx*2], r10w
lea rcx, str._version.dll
call sub.msvcrt.dll_wcslen
movabs rdx, 0x3fffffffffffffff
sub rdx, qword [rsp + 0x228]
mov r8, rax
cmp rax, rdx
ja 0x418292
lea rdx, str._version.dll
mov rcx, r14
call fcn.0049c660
lea r13, [rsp + 0x240]
lea rdx, [r13 + 0x10]
mov qword [rsp + 0x240], rdx
mov rcx, qword [rax]
lea rdx, [rax + 0x10]
cmp rcx, rdx
je 0x417e00
mov qword [rsp + 0x240], rcx
mov rcx, qword [rax + 0x10]
mov qword [rsp + 0x250], rcx
mov rcx, qword [rax + 8]
xor r9d, r9d
mov qword [rsp + 0x248], rcx
mov qword [rax], rdx
mov r15, qword [rsp + 0x240]
mov qword [rax + 8], 0
mov word [rax + 0x10], r9w
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
test rax, rax
mov rbp, rax
je 0x417e20
mov rcx, qword [rsp + 0x240]
lea rax, [r13 + 0x10]
cmp rcx, rax
je 0x41770e
call fcn.004aaf10
mov rcx, qword [rsp + 0x220]
add r14, 0x10
cmp rcx, r14
je 0x417724
call fcn.004aaf10
lea rdx, str.GetFileVersionInfoSizeW
mov rcx, rbp
mov r14, qword [sym.imp.KERNEL32.dll_GetProcAddress]
call r14
test rax, rax
mov qword [rsp + 0x38], rax
je 0x417fb0
lea rdx, str.GetFileVersionInfoW
mov rcx, rbp
call r14
test rax, rax
mov qword [rsp + 0x40], rax
je 0x417f60
lea rdx, str.VerQueryValueW
mov rcx, rbp
call r14
test rax, rax
mov r15, rax
je 0x417f84
xor edx, edx
mov rcx, qword [rsp + 0x1c0]
mov rax, qword [rsp + 0x38]
call rax
test eax, eax
mov r14d, eax
jne 0x4177ff
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rsp + 0x38], rax
call rax
cmp eax, 2
je 0x417c21
mov rax, qword [rsp + 0x38]
call rax
cmp eax, 0x714
je 0x417c21
mov rax, qword [rsp + 0x38]
call rax
lea rdx, str.GetFileVersionInfoSizeW_failed_on
mov r8, rsi
mov rcx, r13
mov dword [rsp + 0x38], eax
call fcn.004a9340
mov edx, dword [rsp + 0x38]
mov rcx, qword [rsp + 0x240]
call fcn.00419250
mov rcx, qword [rsp + 0x240]
add r13, 0x10
cmp rcx, r13
je 0x4177ff
call fcn.004aaf10
mov ecx, r14d
call fcn.004aaf30
mov r13, rax
mov r9, rax
mov r8d, r14d
xor edx, edx
mov rcx, qword [rsp + 0x1c0]
mov rax, qword [rsp + 0x40]
call rax
test eax, eax
jne 0x417870
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r14, [rsp + 0x200]
lea rdx, str.GetFileVersionInfoW_failed_on
mov r8, rsi
mov dword [rsp + 0x38], eax
mov rcx, r14
call fcn.004a9340
mov edx, dword [rsp + 0x38]
mov rcx, qword [rsp + 0x200]
call fcn.00419250
mov rcx, qword [rsp + 0x200]
add r14, 0x10
cmp rcx, r14
je 0x417870
call fcn.004aaf10
mov qword [rsp + 0x60], 0
mov dword [rsp + 0x54], 0
lea r9, [rsp + 0x54]
lea r8, [rsp + 0x60]
lea rdx, [0x004b520e]
mov rcx, r13
call r15
test eax, eax
jne 0x417be5
lea r14, [rsp + 0x1e0]
lea rdx, str.VerQueryValueW_failed_on
mov r8, rsi
mov rcx, r14
call fcn.004a9340
mov rcx, qword [rsp + 0x1e0]
call fcn.00419100
mov rcx, qword [rsp + 0x1e0]
add r14, 0x10
cmp rcx, r14
je 0x4178dd
call fcn.004aaf10
mov rax, qword [rsp + 0x60]
mov ecx, dword [rax + 8]
mov r14d, dword [rax + 0x10]
add rsi, 0x10
mov dword [rsp + 0x48], ecx
mov ecx, dword [rax + 0xc]
mov eax, dword [rax + 0x14]
mov dword [rsp + 0x38], ecx
mov rcx, r13
mov dword [rsp + 0x40], eax
call fcn.004aaf00
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rcx, qword [rsp + 0x1c0]
cmp rcx, rsi
je 0x417922
call fcn.004aaf10
lea rax, [rbx + 0x10]
mov edx, 0x40
mov rcx, rbx
mov qword [rsp + 0x288], 0
mov byte [rsp + 0x290], 0
mov qword [rsp + 0x280], rax
call fcn.00499ba0
lea rsi, [rsp + 0x180]
mov rcx, r12
lea rax, [rsi + 0x10]
mov qword [rsp + 0x180], rax
call sub.msvcrt.dll_wcslen
lea rbp, [rax + rax]
mov rdx, rbp
sar rdx, 1
cmp rdx, 7
mov qword [rsp + 0x78], rdx
ja 0x417d40
cmp rdx, 1
mov rcx, qword [rsp + 0x180]
je 0x417dc0
test rdx, rdx
jne 0x417d68
lea rbp, [rsp + 0x1a0]
xor eax, eax
mov qword [rsp + 0x188], rdx
mov word [rcx + rdx*2], ax
mov rdx, rsi
mov rcx, rbp
call fcn.00414ea0
mov r8, qword [rsp + 0x1a8]
mov rdx, qword [rsp + 0x1a0]
mov rcx, rbx
call fcn.00499d20
mov rdx, qword [rsp + 0x280]
lea rax, [rbx + 0x10]
mov r13, qword [rsp + 0x288]
cmp rdx, rax
mov eax, 0xf
cmovne rax, qword [rsp + 0x290]
lea r15, [r13 + 1]
cmp r15, rax
ja 0x417ce0
mov byte [rdx + r13], 0x3a
mov rax, qword [rsp + 0x280]
add rbp, 0x10
mov qword [rsp + 0x288], r15
mov byte [rax + r13 + 1], 0
mov rcx, qword [rsp + 0x1a0]
cmp rcx, rbp
je 0x417a3b
call fcn.004aaf10
mov rcx, qword [rsp + 0x180]
add rsi, 0x10
cmp rcx, rsi
je 0x417a51
call fcn.004aaf10
mov edx, dword [rsp + 0x40]
lea rsi, [rsp + 0x160]
shl r14, 0x20
mov rcx, rsi
or rdx, r14
call fcn.00417030
mov rdx, qword [rsp + 0x48]
mov eax, dword [rsp + 0x38]
lea rbp, [rsp + 0x140]
mov rcx, rbp
shl rdx, 0x20
or rdx, rax
call fcn.00417030
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0x288]
cmp rax, 1
jbe 0x41822d
lea rdx, [0x004b5212]
mov r8d, 2
mov rcx, rbx
call fcn.00499d20
mov r8, qword [rsp + 0x148]
mov rdx, qword [rsp + 0x140]
mov rcx, rbx
call fcn.00499d20
mov rdx, qword [rsp + 0x280]
lea rax, [rbx + 0x10]
mov r13, qword [rsp + 0x288]
cmp rdx, rax
mov eax, 0xf
cmovne rax, qword [rsp + 0x290]
lea r14, [r13 + 1]
cmp r14, rax
ja 0x417d10
mov byte [rdx + r13], 0x2f
mov rax, qword [rsp + 0x280]
mov qword [rsp + 0x288], r14
mov byte [rax + r13 + 1], 0
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0x288]
cmp rax, 1
jbe 0x4182a9
lea rdx, [0x004b5215]
mov r8d, 2
mov rcx, rbx
call fcn.00499d20
mov r8, qword [rsp + 0x168]
mov rdx, qword [rsp + 0x160]
mov rcx, rbx
call fcn.00499d20
mov rcx, qword [rsp + 0x140]
add rbp, 0x10
cmp rcx, rbp
je 0x417b81
call fcn.004aaf10
mov rcx, qword [rsp + 0x160]
add rsi, 0x10
cmp rcx, rsi
je 0x417b97
call fcn.004aaf10
lea rax, [rdi + 0x10]
add rbx, 0x10
mov qword [rdi], rax
mov rax, qword [rsp + 0x280]
cmp rax, rbx
je 0x417dd0
mov qword [rdi], rax
mov rax, qword [rsp + 0x290]
mov qword [rdi + 0x10], rax
mov rax, qword [rsp + 0x288]
mov qword [rdi + 8], rax
mov rax, rdi
add rsp, 0x498
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rax, qword [rsp + 0x60]
test rax, rax
je 0x4178a0
cmp dword [rsp + 0x54], 0x34
jne 0x4178a0
cmp dword [rax], 0xfeef04bd
jne 0x4178a0
jmp 0x4178e2
lea rcx, str.GetSystemDirectory:_path_is_longer_than_MAX_PATH
call fcn.00419100
jmp 0x4175eb
mov ecx, 8
lea rbx, [0x004b5418]
call fcn.004ab090
lea r8, [0x00416ef0]
lea rdx, [0x004b53b8]
mov qword [rax], rbx
mov rcx, rax
call fcn.004ab760
nop dword [rax + rax]
lea rdx, [rsp + 0x58]
xor r8d, r8d
mov rcx, rsi
call fcn.0049c7b0
mov rcx, rax
mov qword [rsp + 0x1c0], rax
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x1d0], rax
mov rdx, r12
mov r8, rbx
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsp + 0x58]
mov rcx, qword [rsp + 0x1c0]
jmp 0x4175b2
lea rdx, [rsp + 0x68]
xor r8d, r8d
mov rcx, r14
call fcn.0049c7b0
mov rcx, rax
mov qword [rsp + 0x220], rax
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0x230], rax
mov rdx, rbx
mov r8, rbp
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x220]
jmp 0x41763b
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, r13
mov rcx, rbx
call fcn.00499ee0
mov rdx, qword [rsp + 0x280]
jmp 0x417a0a
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, r13
mov rcx, rbx
call fcn.00499ee0
mov rdx, qword [rsp + 0x280]
jmp 0x417b07
lea rdx, [rsp + 0x78]
xor r8d, r8d
mov rcx, rsi
call fcn.0049c7b0
mov rcx, rax
mov qword [rsp + 0x180], rax
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0x190], rax
mov rdx, r12
mov r8, rbp
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x180]
jmp 0x41799f
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.GetSystemDirectory_failed
mov edx, eax
call fcn.00419250
jmp 0x4175eb
movzx eax, word [r12]
mov word [rcx], ax
jmp 0x4175b2
movzx eax, word [rsp + 0x280]
mov word [rcx], ax
jmp 0x41763b
movzx eax, word [r12]
mov word [rcx], ax
jmp 0x41799f
mov rax, qword [rsp + 0x290]
mov rdx, qword [rsp + 0x298]
mov qword [rdi + 0x10], rax
mov qword [rdi + 0x18], rdx
jmp 0x417bc2
lea rcx, [0x004b4fc0]
call fcn.004a4e20
nop dword [rax]
mov r9, qword [rax + 0x10]
mov r10, qword [rax + 0x18]
mov qword [rsp + 0x250], r9
mov qword [rsp + 0x258], r10
jmp 0x4176bc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x40], eax
lea rax, [rsp + 0x260]
test r15, r15
mov qword [rsp + 0x38], rax
lea rax, [rsp + 0x270]
mov qword [rsp + 0x260], rax
je 0x4181c0
mov rcx, r15
call sub.msvcrt.dll_wcslen
add rax, rax
mov rdx, rax
mov qword [rsp + 0x48], rax
sar rdx, 1
cmp rdx, 7
mov qword [rsp + 0x70], rdx
ja 0x418160
cmp rdx, 1
mov rcx, qword [rsp + 0x260]
je 0x4181b0
test rdx, rdx
jne 0x41818a
xor r8d, r8d
mov qword [rsp + 0x268], rdx
mov word [rcx + rdx*2], r8w
lea rcx, str.LoadLibraryW_error:
call sub.msvcrt.dll_wcslen
mov rcx, qword [rsp + 0x38]
lea r9, str.LoadLibraryW_error:
mov qword [rsp + 0x20], rax
xor r8d, r8d
xor edx, edx
call fcn.0049a9e0
lea rdx, [rbx + 0x10]
mov qword [rsp + 0x280], rdx
mov rcx, qword [rax]
lea rdx, [rax + 0x10]
cmp rcx, rdx
je 0x418210
mov qword [rsp + 0x280], rcx
mov rcx, qword [rax + 0x10]
mov qword [rsp + 0x290], rcx
mov rcx, qword [rax + 8]
mov qword [rsp + 0x288], rcx
mov qword [rax], rdx
xor edx, edx
mov word [rax + 0x10], dx
mov rcx, qword [rsp + 0x280]
mov edx, dword [rsp + 0x40]
mov qword [rax + 8], 0
call fcn.00419250
mov rcx, qword [rsp + 0x280]
lea rax, [rbx + 0x10]
cmp rcx, rax
je 0x417f3b
call fcn.004aaf10
mov rax, qword [rsp + 0x38]
mov rcx, qword [rsp + 0x260]
add rax, 0x10
cmp rcx, rax
je 0x4176f8
call fcn.004aaf10
jmp 0x4176f8
lea rdx, str.GetFileVersionInfoW
lea rcx, str.GetProcAddress:__s_is_missing
call fcn.00413ac0
lea rcx, str.GetFileVersionInfoW_is_missing
call fcn.00419100
jmp 0x417761
lea rdx, str.VerQueryValueW
lea rcx, str.GetProcAddress:__s_is_missing
call fcn.00413ac0
lea rcx, str.VerQueryValueW_is_missing
call fcn.00419100
jmp 0x41777a
lea rdx, str.GetFileVersionInfoSizeW
lea rcx, str.GetProcAddress:__s_is_missing
call fcn.00413ac0
lea rcx, str.GetFileVersionInfoSizeW_is_missing
call fcn.00419100
jmp 0x417746
mov rcx, qword [rsp + 0x1c0]
add rsi, 0x10
cmp rcx, rsi
je 0x417ff9
call fcn.004aaf10
mov rcx, rbx
mov rbp, r13
cmp rbp, 1
je 0x418418
cmp rbp, 2
jne 0x418413
call fcn.004ab180
mov rdx, qword [rax]
lea rsi, [rsp + 0x100]
mov rcx, rax
call qword [rdx]
mov rcx, rsi
mov rdx, rax
call fcn.00416f10
lea rbp, [rsp + 0x120]
mov rdx, rsi
mov rcx, rbp
call fcn.00414ea0
lea r14, [rsp + 0xc0]
mov rdx, r12
mov rbx, qword [rsp + 0x120]
mov rcx, r14
call fcn.00416f10
lea r13, [rsp + 0xe0]
mov rdx, r14
mov rcx, r13
call fcn.00414ea0
mov rdx, qword [rsp + 0xe0]
lea rcx, str.Error_getting__s_version:__s
mov r8, rbx
call fcn.00413ac0
mov rcx, qword [rsp + 0xe0]
add r13, 0x10
cmp rcx, r13
je 0x4180a1
call fcn.004aaf10
mov rcx, qword [rsp + 0xc0]
add r14, 0x10
cmp rcx, r14
je 0x4180b7
call fcn.004aaf10
mov rcx, qword [rsp + 0x120]
add rbp, 0x10
cmp rcx, rbp
je 0x4180cd
call fcn.004aaf10
mov rcx, qword [rsp + 0x100]
add rsi, 0x10
cmp rcx, rsi
je 0x4180e3
call fcn.004aaf10
lea rsi, [rsp + 0x80]
mov rdx, r12
mov rcx, rsi
call fcn.00416f10
lea rbp, [rsp + 0xa0]
mov rdx, rsi
mov rcx, rbp
call fcn.00414ea0
lea r8, str.:error
mov rdx, rbp
mov rcx, rdi
call fcn.004a8f60
mov rcx, qword [rsp + 0xa0]
add rbp, 0x10
cmp rcx, rbp
je 0x418131
call fcn.004aaf10
mov rcx, qword [rsp + 0x80]
add rsi, 0x10
cmp rcx, rsi
je 0x418147
call fcn.004aaf10
call fcn.004ab3a0
jmp 0x417bce
mov rcx, qword [rsp + 0x38]
lea rdx, [rsp + 0x70]
xor r8d, r8d
call fcn.0049c7b0
mov rcx, rax
mov qword [rsp + 0x260], rax
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x270], rax
mov r8, qword [rsp + 0x48]
mov rdx, r15
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x260]
jmp 0x417e90
movzx eax, word [r15]
mov word [rcx], ax
jmp 0x417e90
lea rcx, [0x004b4fc0]
call fcn.004a4e20
mov rbx, rax
mov rbp, rdx
mov rcx, qword [rsp + 0x240]
add r13, 0x10
cmp rcx, r13
je 0x4181e8
call fcn.004aaf10
mov r13, rbp
mov rcx, qword [rsp + 0x220]
add r14, 0x10
cmp rcx, r14
je 0x417fe3
call fcn.004aaf10
jmp 0x417fe3
mov r9, qword [rax + 0x10]
mov r10, qword [rax + 0x18]
mov qword [rsp + 0x290], r9
mov qword [rsp + 0x298], r10
jmp 0x417ef7
lea rcx, [0x004b502e]
call fcn.004a50e0
mov rcx, qword [rsp + 0x140]
add rbp, 0x10
mov r13, rax
mov r14, rdx
cmp rcx, rbp
je 0x418255
call fcn.004aaf10
mov rbp, r13
mov r13, r14
mov rcx, qword [rsp + 0x160]
add rsi, 0x10
cmp rcx, rsi
je 0x418271
call fcn.004aaf10
mov rcx, qword [rsp + 0x280]
add rbx, 0x10
cmp rcx, rbx
je 0x418287
call fcn.004aaf10
mov rcx, rbp
mov rbp, r13
jmp 0x417fff
lea rcx, [0x004b502e]
call fcn.004a50e0
mov rbx, rax
mov r13, rdx
jmp 0x4181eb
lea rcx, [0x004b502e]
call fcn.004a50e0
mov rbx, rax
mov r13, rdx
jmp 0x417fe3
call fcn.00424a70
lea rsi, [rsp + 0x100]
call fcn.004ab180
mov rdx, r12
mov rcx, rsi
call fcn.00416f10
lea rbp, [rsp + 0x120]
mov rdx, rsi
mov rcx, rbp
call fcn.00414ea0
lea r8, str.:none
mov rdx, rbp
mov rcx, rdi
call fcn.004a8f60
mov rcx, qword [rsp + 0x120]
add rbp, 0x10
cmp rcx, rbp
je 0x41846b
call fcn.004aaf10
mov rcx, qword [rsp + 0x100]
add rsi, 0x10
cmp rcx, rsi
je 0x418481
call fcn.004aaf10
call fcn.004ab3a0
jmp 0x417bce