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

Disassembly:
sub rsp, 0xca8
mov rax, qword [0x0042a560]
xor rax, rsp
mov qword [rsp + 0xc80], rax
mov qword [rsp + 0xcb8], rbx
mov rbx, rcx
lea rcx, [rsp + 0xa72]
xor edx, edx
mov r8d, 0x206
mov word [rsp + 0xa70], 0
call fcn.0040e3f0
lea rcx, [rsp + 0x862]
xor edx, edx
mov r8d, 0x206
mov word [rsp + 0x860], 0
call fcn.0040e3f0
lea rcx, [rsp + 0x442]
xor edx, edx
mov r8d, 0x206
mov word [rsp + 0x440], 0
call fcn.0040e3f0
lea rcx, [rsp + 0x652]
xor edx, edx
mov r8d, 0x206
mov word [rsp + 0x650], 0
call fcn.0040e3f0
lea rcx, [rsp + 0x232]
xor edx, edx
mov r8d, 0x206
mov word [rsp + 0x230], 0
call fcn.0040e3f0
lea rcx, [rsp + 0x22]
xor edx, edx
mov r8d, 0x206
mov word [rsp + 0x20], 0
call fcn.0040e3f0
xor r9d, r9d
lea rdx, [rsp + 0xa70]
lea r8d, [r9 + 0x1a]
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
xor edx, edx
movzx eax, word [rsp + rdx + 0xa70]
add rdx, 2
test ax, ax
mov word [rsp + rdx + 0x22e], ax
jne 0x40d771
lea rcx, [rsp + 0x230]
mov dx, 0x5c
call fcn.0040e5f0
test rax, rax
jne 0x40d7ad
mov rcx, rbx
call fcn.0040cfd0
jmp 0x40dabb
mov word [rax], 0
xor ecx, ecx
nop
nop
nop
movzx eax, word [rsp + rcx + 0x230]
add rcx, 2
test ax, ax
mov word [rsp + rcx + 0x85e], ax
jne 0x40d7c0
xor eax, eax
mov qword [rsp + 0xcc0], rbp
mov qword [rsp + 0xca0], rdi
lea rdi, [rsp + 0x860]
mov rcx, 0xffffffffffffffff
mov qword [rsp + 0xc98], r12
repne scasw ax, word [rdi]
mov rax, qword [str.Local]
lea rcx, [rsp + 0x860]
mov qword [rdi - 2], rax
mov eax, dword [0x00422b28]
mov dword [rdi + 6], eax
movzx eax, word [0x00422b2c]
mov word [rdi + 0xa], ax
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
xor ebp, ebp
test eax, eax
mov r12d, 1
cmovne ebp, r12d
xor ecx, ecx
nop
nop
nop
nop
movzx eax, word [rsp + rcx + 0x230]
add rcx, 2
test ax, ax
mov word [rsp + rcx + 0x43e], ax
jne 0x40d850
xor eax, eax
lea rdi, [rsp + 0x440]
mov rcx, 0xffffffffffffffff
repne scasw ax, word [rdi]
mov rax, qword [str.LocalLow]
lea rcx, [rsp + 0x440]
mov qword [rdi - 2], rax
mov rax, qword [0x00422b10]
mov qword [rsp + 0xcc8], rsi
mov qword [rdi + 6], rax
mov eax, dword [0x00422b18]
mov dword [rdi + 0xe], eax
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
xor esi, esi
test eax, eax
cmovne esi, r12d
xor ecx, ecx
nop
movzx eax, word [rsp + rcx + 0x230]
add rcx, 2
test ax, ax
mov word [rsp + rcx + 0x64e], ax
jne 0x40d8c0
xor eax, eax
lea rdi, [rsp + 0x650]
mov rcx, 0xffffffffffffffff
repne scasw ax, word [rdi]
mov rax, qword [str.Roaming]
lea rcx, [rsp + 0x650]
mov qword [rdi - 2], rax
mov rax, qword [0x00422af8]
mov qword [rdi + 6], rax
movzx eax, word [0x00422b00]
mov word [rdi + 0xe], ax
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
xor ecx, ecx
test eax, eax
cmovne ecx, r12d
test ebp, ebp
mov r12, qword [rsp + 0xc98]
je 0x40da9b
test esi, esi
je 0x40da9b
test ecx, ecx
je 0x40da9b
mov rcx, rbx
call fcn.004095a0
test eax, eax
je 0x40da9b
lea r9, str.WanNengWBIME.users
lea r8, [rsp + 0x440]
lea rdx, str._s_s_
lea rcx, [rsp + 0x20]
call fcn.0040e620
lea rcx, [rsp + 0x20]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40d98d
lea rcx, [rsp + 0x20]
call fcn.0040ddc0
mov rdx, qword [rbx + 0x28]
xor eax, eax
add rbx, 8
lea rdi, [rsp + 0x20]
mov rcx, 0xffffffffffffffff
repne scasw ax, word [rdi]
cmp rdx, 8
not rcx
lea rsi, [rcx - 1]
jb 0x40d9bd
mov rax, qword [rbx + 8]
lea rdi, [rbx + 8]
jmp 0x40d9c4
lea rdi, [rbx + 8]
mov rax, rdi
lea rcx, [rsp + 0x20]
cmp rcx, rax
jb 0x40da15
cmp rdx, 8
jb 0x40d9d9
mov rcx, qword [rdi]
jmp 0x40d9dc
mov rcx, rdi
mov rax, qword [rbx + 0x18]
lea rcx, [rcx + rax*2]
lea rax, [rsp + 0x20]
cmp rcx, rax
jbe 0x40da15
cmp rdx, 8
jb 0x40d9f7
mov rdi, qword [rdi]
lea r8, [rsp + 0x20]
mov r9, rsi
mov rdx, rbx
sub r8, rdi
mov rcx, rbx
sar r8, 1
call fcn.00401a30
jmp 0x40daa3
movabs rax, 0x7ffffffffffffffe
cmp rsi, rax
jbe 0x40da29
call fcn.0040e230
mov rax, qword [rbx + 0x20]
cmp rax, rsi
jae 0x40da55
mov r8, qword [rbx + 0x18]
mov rdx, rsi
mov rcx, rbx
call fcn.00401420
test rsi, rsi
je 0x40daa3
mov rdx, qword [rbx + 0x20]
cmp rdx, 8
jb 0x40da6e
mov rcx, qword [rdi]
jmp 0x40da71
test rsi, rsi
jne 0x40da41
cmp rax, 8
mov qword [rbx + 0x18], rsi
jb 0x40da67
mov rdi, qword [rdi]
mov word [rdi], 0
jmp 0x40daa3
mov rcx, rdi
lea rbp, [rsi + rsi]
lea r8, [rsp + 0x20]
add rdx, rdx
mov r9, rbp
call fcn.0040e710
cmp qword [rbx + 0x20], 8
mov qword [rbx + 0x18], rsi
jb 0x40da93
mov rdi, qword [rdi]
mov word [rdi + rbp], 0
jmp 0x40daa3
mov rcx, rbx
call fcn.0040cfd0
mov rsi, qword [rsp + 0xcc8]
mov rbp, qword [rsp + 0xcc0]
mov rdi, qword [rsp + 0xca0]
mov rbx, qword [rsp + 0xcb8]
mov rcx, qword [rsp + 0xc80]
xor rcx, rsp
call fcn.0040e5d0
add rsp, 0xca8
ret