Function at 0x4021f0
Capabilities:
Get common file path

Disassembly:
push r13
push r12
push rsi
push rbx
sub rsp, 0x378
mov rbx, qword [sym.imp.ucrtbase.dll__wcsicmp]
mov r12, rdx
mov rsi, rcx
lea rdx, str.runtime.system32
mov rcx, r12
call rbx
test eax, eax
je 0x40222e
lea rdx, str.runtime.drivers
mov rcx, r12
call rbx
test eax, eax
jne 0x402338
mov rcx, qword [rsi + 0x38]
lea rdx, [0x0040d102]
call rbx
test eax, eax
jne 0x4022e0
mov r8d, 0x29
lea r13, [rsp + 0x160]
xor ecx, ecx
mov r9d, 1
mov rdx, r13
call qword [sym.imp.shell32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x402300
lea rdx, str.runtime.inf
mov rcx, r12
call rbx
test eax, eax
jne 0x4022a8
lea rdx, str.inf
mov rcx, r13
call qword [sym.imp.ucrtbase.dll_wcscat]
mov rcx, r13
call qword [sym.imp.ucrtbase.dll__wcsdup]
add rsp, 0x378
pop rbx
pop rsi
pop r12
pop r13
ret
lea rdx, str.runtime.drivers
mov rcx, r12
call rbx
test eax, eax
je 0x402320
lea rdx, str.runtime.wbem
mov rcx, r12
call rbx
test eax, eax
jne 0x40228a
lea rdx, str.wbem
mov rcx, r13
call qword [sym.imp.ucrtbase.dll_wcscat]
jmp 0x40228a
mov rcx, qword [rsi + 0x38]
lea rdx, str.wow64
call rbx
mov r8d, 0x25
test eax, eax
jne 0x402249
jmp 0x402243
test byte [section..data], 2
jne 0x402370
xor eax, eax
add rsp, 0x378
pop rbx
pop rsi
pop r12
pop r13
ret
lea rdx, str.drivers
mov rcx, r13
call qword [sym.imp.ucrtbase.dll_wcscat]
jmp 0x40228a
lea rdx, str.runtime.wbem
mov rcx, r12
call rbx
test eax, eax
je 0x40222e
lea rdx, str.runtime.windows
mov rcx, r12
call rbx
test eax, eax
jne 0x4024b8
mov r8d, 0x24
jmp 0x402249
lea rax, [0x0040d020]
test r12, r12
je 0x402489
mov rax, r12
shr rax, 0x10
je 0x4025a8
mov rdx, 0xffffffffffffffff
mov rcx, r12
call qword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov r8d, eax
lea rax, [0x0040d027]
test r8d, r8d
jne 0x402489
cmp word [r12], 0
je 0x4025cb
xor eax, eax
nop
mov ecx, eax
add rax, 1
cmp word [r12 + rax*2], 0
jne 0x4023c0
mov eax, 0x224c
lea rdx, [rsp + 0x32]
lea r9, str.0123456789abcdefcabinet_copy_file
mov word [rsp + 0x30], ax
lea r8, [rsp + 0x152]
jmp 0x402426
cmp ax, 9
je 0x402518
cmp ax, 0xa
jne 0x402539
mov r13d, 0x6e5c
add rdx, 2
mov word [rdx - 2], r13w
nop dword [rax + rax]
lea eax, [rcx - 1]
test ecx, ecx
jle 0x402460
cmp rdx, r8
ja 0x402460
mov ecx, eax
movzx eax, word [r12]
add r12, 2
cmp ax, 0xd
je 0x402500
jbe 0x4023f0
cmp ax, 0x22
je 0x402590
cmp ax, 0x5c
jne 0x40252a
mov r10d, 0x5c5c
add rdx, 2
mov word [rdx - 2], r10w
jmp 0x402418
mov byte [rdx], 0x22
test eax, eax
jle 0x4025df
mov ecx, 0x2e2e
mov byte [rdx + 3], 0x2e
lea rax, [rdx + 4]
mov word [rdx + 1], cx
mov byte [rax], 0
lea rcx, [rsp + 0x30]
call sym.__wine_dbg_strdup
mov qword [rsp + 0x20], rax
lea r9, str.Failed_to_get_folder_path_for__s_n
lea r8, str.lookup_expression
mov ecx, 1
lea rdx, section..data
call sym.wine_dbg_log.constprop.1
xor eax, eax
jmp 0x40230b
lea rdx, str.runtime.inf
mov rcx, r12
call rbx
test eax, eax
je 0x402360
lea rdx, str.runtime.programfiles
mov rcx, r12
call rbx
test eax, eax
jne 0x4025e8
mov rcx, qword [rsi + 0x38]
lea rdx, [0x0040d102]
call rbx
test eax, eax
jne 0x4026b0
mov r8d, 0x2a
jmp 0x402249
mov esi, 0x725c
add rdx, 2
mov word [rdx - 2], si
jmp 0x402418
mov ebx, 0x745c
add rdx, 2
mov word [rdx - 2], bx
jmp 0x402418
lea r10d, [rax - 0x20]
cmp r10w, 0x5e
jbe 0x4025c0
mov r10d, eax
mov byte [rdx], 0x5c
add rdx, 5
shr r10w, 0xc
and r10d, 0xf
movzx r10d, byte [r9 + r10]
mov byte [rdx - 4], r10b
mov r10d, eax
shr r10w, 8
and r10d, 0xf
movzx r10d, byte [r9 + r10]
mov byte [rdx - 3], r10b
mov r10d, eax
and eax, 0xf
shr r10w, 4
movzx eax, byte [r9 + rax]
and r10d, 0xf
movzx r10d, byte [r9 + r10]
mov byte [rdx - 1], al
mov byte [rdx - 2], r10b
jmp 0x402418
mov r11d, 0x225c
add rdx, 2
mov word [rdx - 2], r11w
jmp 0x402418
movzx edx, r12w
lea rcx, [0x0040d01a]
call sym.wine_dbg_sprintf.constprop.0
jmp 0x402489
mov byte [rdx], al
add rdx, 1
jmp 0x402418
mov byte [rsp + 0x32], 0x22
mov edx, 0x224c
mov word [rsp + 0x30], dx
lea rdx, [rsp + 0x32]
lea rax, [rdx + 1]
jmp 0x40247c
lea rdx, str.runtime.commonfiles
mov rcx, r12
call rbx
test eax, eax
jne 0x402618
mov rcx, qword [rsi + 0x38]
lea rdx, [0x0040d102]
call rbx
test eax, eax
jne 0x4026d0
mov r8d, 0x2c
jmp 0x402249
lea rdx, str.runtime.programfilesx86
mov rcx, r12
call rbx
test eax, eax
je 0x4024f5
lea rdx, str.runtime.commonfilesx86
mov rcx, r12
call rbx
test eax, eax
je 0x40260d
lea rdx, str.runtime.programdata
mov rcx, r12
call rbx
mov r8d, 0x23
test eax, eax
je 0x402249
lea rdx, str.runtime.fonts
mov rcx, r12
call rbx
mov r8d, 0x14
test eax, eax
je 0x402249
test byte [section..data], 1
je 0x402309
or edx, 0xffffffff
mov rcx, r12
call sym.wine_dbgstr_wn
lea r9, str.Unknown_expression__s_n
lea r8, str.lookup_expression
xor ecx, ecx
mov qword [rsp + 0x20], rax
lea rdx, section..data
call sym.wine_dbg_log.constprop.1
xor eax, eax
jmp 0x402293
mov rcx, qword [rsi + 0x38]
lea rdx, str.wow64
call rbx
mov r8d, 0x26
test eax, eax
jne 0x402249
jmp 0x4024f5
mov rcx, qword [rsi + 0x38]
lea rdx, str.wow64
call rbx
mov r8d, 0x2b
test eax, eax
jne 0x402249
jmp 0x40260d