Function at 0x404690
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 0x404f40
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 0x404da0
cmp rdx, 1
mov rcx, qword [rsp + 0x1c0]
je 0x404ef0
test rdx, rdx
jne 0x404dc8
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 0x404ed5
cmp eax, 0x103
ja 0x404d60
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 0x404de5
cmp rdx, 1
mov rcx, qword [rsp + 0x220]
je 0x404f00
test rdx, rdx
jne 0x404e0d
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 0x4053e2
lea rdx, str._version.dll
mov rcx, r14
call fcn.00487ab0
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 0x404f50
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 0x404f70
mov rcx, qword [rsp + 0x240]
lea rax, [r13 + 0x10]
cmp rcx, rax
je 0x40485e
call fcn.00496360
mov rcx, qword [rsp + 0x220]
add r14, 0x10
cmp rcx, r14
je 0x404874
call fcn.00496360
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 0x405100
lea rdx, str.GetFileVersionInfoW
mov rcx, rbp
call r14
test rax, rax
mov qword [rsp + 0x40], rax
je 0x4050b0
lea rdx, str.VerQueryValueW
mov rcx, rbp
call r14
test rax, rax
mov r15, rax
je 0x4050d4
xor edx, edx
mov rcx, qword [rsp + 0x1c0]
mov rax, qword [rsp + 0x38]
call rax
test eax, eax
mov r14d, eax
jne 0x40494f
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rsp + 0x38], rax
call rax
cmp eax, 2
je 0x404d71
mov rax, qword [rsp + 0x38]
call rax
cmp eax, 0x714
je 0x404d71
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.00494790
mov edx, dword [rsp + 0x38]
mov rcx, qword [rsp + 0x240]
call fcn.00406300
mov rcx, qword [rsp + 0x240]
add r13, 0x10
cmp rcx, r13
je 0x40494f
call fcn.00496360
mov ecx, r14d
call fcn.00496380
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 0x4049c0
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.00494790
mov edx, dword [rsp + 0x38]
mov rcx, qword [rsp + 0x200]
call fcn.00406300
mov rcx, qword [rsp + 0x200]
add r14, 0x10
cmp rcx, r14
je 0x4049c0
call fcn.00496360
mov qword [rsp + 0x60], 0
mov dword [rsp + 0x54], 0
lea r9, [rsp + 0x54]
lea r8, [rsp + 0x60]
lea rdx, [0x0049c716]
mov rcx, r13
call r15
test eax, eax
jne 0x404d35
lea r14, [rsp + 0x1e0]
lea rdx, str.VerQueryValueW_failed_on
mov r8, rsi
mov rcx, r14
call fcn.00494790
mov rcx, qword [rsp + 0x1e0]
call fcn.004061b0
mov rcx, qword [rsp + 0x1e0]
add r14, 0x10
cmp rcx, r14
je 0x404a2d
call fcn.00496360
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.00496350
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rcx, qword [rsp + 0x1c0]
cmp rcx, rsi
je 0x404a72
call fcn.00496360
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.00484ff0
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 0x404e90
cmp rdx, 1
mov rcx, qword [rsp + 0x180]
je 0x404f10
test rdx, rdx
jne 0x404eb8
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.00402100
mov r8, qword [rsp + 0x1a8]
mov rdx, qword [rsp + 0x1a0]
mov rcx, rbx
call fcn.00485170
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 0x404e30
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 0x404b8b
call fcn.00496360
mov rcx, qword [rsp + 0x180]
add rsi, 0x10
cmp rcx, rsi
je 0x404ba1
call fcn.00496360
mov edx, dword [rsp + 0x40]
lea rsi, [rsp + 0x160]
shl r14, 0x20
mov rcx, rsi
or rdx, r14
call fcn.00404180
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.00404180
movabs rax, 0x7fffffffffffffff
sub rax, qword [rsp + 0x288]
cmp rax, 1
jbe 0x40537d
lea rdx, [0x0049c71a]
mov r8d, 2
mov rcx, rbx
call fcn.00485170
mov r8, qword [rsp + 0x148]
mov rdx, qword [rsp + 0x140]
mov rcx, rbx
call fcn.00485170
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 0x404e60
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 0x4053f9
lea rdx, [0x0049c71d]
mov r8d, 2
mov rcx, rbx
call fcn.00485170
mov r8, qword [rsp + 0x168]
mov rdx, qword [rsp + 0x160]
mov rcx, rbx
call fcn.00485170
mov rcx, qword [rsp + 0x140]
add rbp, 0x10
cmp rcx, rbp
je 0x404cd1
call fcn.00496360
mov rcx, qword [rsp + 0x160]
add rsi, 0x10
cmp rcx, rsi
je 0x404ce7
call fcn.00496360
lea rax, [rdi + 0x10]
add rbx, 0x10
mov qword [rdi], rax
mov rax, qword [rsp + 0x280]
cmp rax, rbx
je 0x404f20
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 0x4049f0
cmp dword [rsp + 0x54], 0x34
jne 0x4049f0
cmp dword [rax], 0xfeef04bd
jne 0x4049f0
jmp 0x404a32
lea rcx, str.GetSystemDirectory:_path_is_longer_than_MAX_PATH
call fcn.004061b0
jmp 0x40473b
mov ecx, 8
lea rbx, [0x0049c918]
call fcn.004964e0
lea r8, [0x00404100]
lea rdx, [0x0049c8c0]
mov qword [rax], rbx
mov rcx, rax
call fcn.00496bb0
nop dword [rax + rax]
lea rdx, [rsp + 0x58]
xor r8d, r8d
mov rcx, rsi
call fcn.00487c00
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 0x404702
lea rdx, [rsp + 0x68]
xor r8d, r8d
mov rcx, r14
call fcn.00487c00
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 0x40478b
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, r13
mov rcx, rbx
call fcn.00485330
mov rdx, qword [rsp + 0x280]
jmp 0x404b5a
mov qword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
mov rdx, r13
mov rcx, rbx
call fcn.00485330
mov rdx, qword [rsp + 0x280]
jmp 0x404c57
lea rdx, [rsp + 0x78]
xor r8d, r8d
mov rcx, rsi
call fcn.00487c00
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 0x404aef
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.GetSystemDirectory_failed
mov edx, eax
call fcn.00406300
jmp 0x40473b
movzx eax, word [r12]
mov word [rcx], ax
jmp 0x404702
movzx eax, word [rsp + 0x280]
mov word [rcx], ax
jmp 0x40478b
movzx eax, word [r12]
mov word [rcx], ax
jmp 0x404aef
mov rax, qword [rsp + 0x290]
mov rdx, qword [rsp + 0x298]
mov qword [rdi + 0x10], rax
mov qword [rdi + 0x18], rdx
jmp 0x404d12
lea rcx, [0x0049c510]
call fcn.00490270
nop dword [rax]
mov r9, qword [rax + 0x10]
mov r10, qword [rax + 0x18]
mov qword [rsp + 0x250], r9
mov qword [rsp + 0x258], r10
jmp 0x40480c
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 0x405310
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 0x4052b0
cmp rdx, 1
mov rcx, qword [rsp + 0x260]
je 0x405300
test rdx, rdx
jne 0x4052da
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.00485e30
lea rdx, [rbx + 0x10]
mov qword [rsp + 0x280], rdx
mov rcx, qword [rax]
lea rdx, [rax + 0x10]
cmp rcx, rdx
je 0x405360
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.00406300
mov rcx, qword [rsp + 0x280]
lea rax, [rbx + 0x10]
cmp rcx, rax
je 0x40508b
call fcn.00496360
mov rax, qword [rsp + 0x38]
mov rcx, qword [rsp + 0x260]
add rax, 0x10
cmp rcx, rax
je 0x404848
call fcn.00496360
jmp 0x404848
lea rdx, str.GetFileVersionInfoW
lea rcx, str.GetProcAddress:__s_is_missing
call fcn.004015c0
lea rcx, str.GetFileVersionInfoW_is_missing
call fcn.004061b0
jmp 0x4048b1
lea rdx, str.VerQueryValueW
lea rcx, str.GetProcAddress:__s_is_missing
call fcn.004015c0
lea rcx, str.VerQueryValueW_is_missing
call fcn.004061b0
jmp 0x4048ca
lea rdx, str.GetFileVersionInfoSizeW
lea rcx, str.GetProcAddress:__s_is_missing
call fcn.004015c0
lea rcx, str.GetFileVersionInfoSizeW_is_missing
call fcn.004061b0
jmp 0x404896
mov rcx, qword [rsp + 0x1c0]
add rsi, 0x10
cmp rcx, rsi
je 0x405149
call fcn.00496360
mov rcx, rbx
mov rbp, r13
cmp rbp, 1
je 0x405568
cmp rbp, 2
jne 0x405563
call fcn.004965d0
mov rdx, qword [rax]
lea rsi, [rsp + 0x100]
mov rcx, rax
call qword [rdx]
mov rcx, rsi
mov rdx, rax
call fcn.0049733c
lea rbp, [rsp + 0x120]
mov rdx, rsi
mov rcx, rbp
call fcn.00402100
lea r14, [rsp + 0xc0]
mov rdx, r12
mov rbx, qword [rsp + 0x120]
mov rcx, r14
call fcn.0049733c
lea r13, [rsp + 0xe0]
mov rdx, r14
mov rcx, r13
call fcn.00402100
mov rdx, qword [rsp + 0xe0]
lea rcx, str.Error_getting__s_version:__s
mov r8, rbx
call fcn.004015c0
mov rcx, qword [rsp + 0xe0]
add r13, 0x10
cmp rcx, r13
je 0x4051f1
call fcn.00496360
mov rcx, qword [rsp + 0xc0]
add r14, 0x10
cmp rcx, r14
je 0x405207
call fcn.00496360
mov rcx, qword [rsp + 0x120]
add rbp, 0x10
cmp rcx, rbp
je 0x40521d
call fcn.00496360
mov rcx, qword [rsp + 0x100]
add rsi, 0x10
cmp rcx, rsi
je 0x405233
call fcn.00496360
lea rsi, [rsp + 0x80]
mov rdx, r12
mov rcx, rsi
call fcn.0049733c
lea rbp, [rsp + 0xa0]
mov rdx, rsi
mov rcx, rbp
call fcn.00402100
lea r8, str.:error
mov rdx, rbp
mov rcx, rdi
call fcn.004943b0
mov rcx, qword [rsp + 0xa0]
add rbp, 0x10
cmp rcx, rbp
je 0x405281
call fcn.00496360
mov rcx, qword [rsp + 0x80]
add rsi, 0x10
cmp rcx, rsi
je 0x405297
call fcn.00496360
call fcn.004967f0
jmp 0x404d1e
mov rcx, qword [rsp + 0x38]
lea rdx, [rsp + 0x70]
xor r8d, r8d
call fcn.00487c00
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 0x404fe0
movzx eax, word [r15]
mov word [rcx], ax
jmp 0x404fe0
lea rcx, [0x0049c510]
call fcn.00490270
mov rbx, rax
mov rbp, rdx
mov rcx, qword [rsp + 0x240]
add r13, 0x10
cmp rcx, r13
je 0x405338
call fcn.00496360
mov r13, rbp
mov rcx, qword [rsp + 0x220]
add r14, 0x10
cmp rcx, r14
je 0x405133
call fcn.00496360
jmp 0x405133
mov r9, qword [rax + 0x10]
mov r10, qword [rax + 0x18]
mov qword [rsp + 0x290], r9
mov qword [rsp + 0x298], r10
jmp 0x405047
lea rcx, [0x0049c53a]
call fcn.00490530
mov rcx, qword [rsp + 0x140]
add rbp, 0x10
mov r13, rax
mov r14, rdx
cmp rcx, rbp
je 0x4053a5
call fcn.00496360
mov rbp, r13
mov r13, r14
mov rcx, qword [rsp + 0x160]
add rsi, 0x10
cmp rcx, rsi
je 0x4053c1
call fcn.00496360
mov rcx, qword [rsp + 0x280]
add rbx, 0x10
cmp rcx, rbx
je 0x4053d7
call fcn.00496360
mov rcx, rbp
mov rbp, r13
jmp 0x40514f
lea rcx, [0x0049c53a]
call fcn.00490530
mov rbx, rax
mov r13, rdx
jmp 0x40533b
lea rcx, [0x0049c53a]
call fcn.00490530
mov rbx, rax
mov r13, rdx
jmp 0x405133
call fcn.00411ad0
lea rsi, [rsp + 0x100]
call fcn.004965d0
mov rdx, r12
mov rcx, rsi
call fcn.0049733c
lea rbp, [rsp + 0x120]
mov rdx, rsi
mov rcx, rbp
call fcn.00402100
lea r8, str.:none
mov rdx, rbp
mov rcx, rdi
call fcn.004943b0
mov rcx, qword [rsp + 0x120]
add rbp, 0x10
cmp rcx, rbp
je 0x4055bb
call fcn.00496360
mov rcx, qword [rsp + 0x100]
add rsi, 0x10
cmp rcx, rsi
je 0x4055d1
call fcn.00496360
call fcn.004967f0
jmp 0x404d1e