Function at 0x403980
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
push ebx
sub esp, 0x654
mov dword [ebp - 0x644], edx
mov dword [ebp - 0x648], ecx
mov dword [ebp - 0x63c], 7
mov dword [ebp - 0x638], 0x10
mov dword [ebp - 0x634], 0xb
mov dword [ebp - 0x630], 0x18
mov dword [ebp - 0x62c], 0x19
mov dword [ebp - 0x628], 0x16
test byte [0x40d000], 8
jne 0x403c20
lea edi, [ebp - 0x41c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], 0x104
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub eax, 1
sub esp, 0x10
cmp eax, 0x103
ja 0x403aa2
test byte [0x40d000], 8
jne 0x403ab0
lea eax, [ebp - 0x624]
mov dword [esp + 8], 0x104
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_GetLongPathNameW]
mov dword [ebp - 0x640], eax
sub eax, 1
sub esp, 0xc
cmp eax, 0x103
ja 0x403aa2
lea ebx, [ebp - 0x214]
test byte [0x40d000], 8
jne 0x403e43
lea edi, [ebp - 0x63c]
mov esi, dword [edi]
mov dword [esp + 0xc], 0
mov dword [esp + 4], ebx
mov dword [esp + 8], esi
mov dword [esp], 0
call dword [sym.imp.shell32.dll_SHGetSpecialFolderPathW]
sub esp, 0x10
test eax, eax
jne 0x403b70
add edi, 4
lea eax, [ebp - 0x624]
cmp eax, edi
jne 0x403a6b
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, edi
shr eax, 0x10
je 0x403d12
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov esi, eax
sub esp, 8
mov eax, str._invalid_
test esi, esi
jne 0x403d25
cmp word [ebp - 0x41c], 0
je 0x403afa
lea esi, [esi]
nop
add esi, 1
cmp word [edi + esi*2], 0
jne 0x403af0
mov eax, 0x224c
mov dword [ebp - 0x640], edi
lea edx, [ebp - 0x212]
mov word [ebp - 0x214], ax
lea ebx, [esi - 1]
test esi, esi
jle 0x404050
lea eax, [ebp - 0xf2]
cmp edx, eax
ja 0x404050
add dword [ebp - 0x640], 2
mov eax, dword [ebp - 0x640]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x403f70
ja 0x403d75
cmp ax, 9
je 0x404000
cmp ax, 0xa
jne 0x403fa0
mov eax, 0x6e5c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x403b12
cmp word [ebp - 0x214], 0
je 0x404043
mov eax, ebx
add eax, 2
cmp word [eax], 0
jne 0x403b80
sub eax, ebx
sar eax, 1
mov ecx, eax
cmp dword [ebp - 0x640], eax
jb 0x403a95
cmp eax, 0x103
ja 0x403a95
cmp word [ebp + ecx*2 - 0x624], 0x5c
jne 0x403a95
lea eax, [ebp - 0x624]
mov dword [esp + 8], ecx
mov dword [ebp - 0x64c], ecx
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsnicmp]
test eax, eax
jne 0x403a95
mov eax, dword [ebp - 0x644]
mov ecx, dword [ebp - 0x64c]
mov dword [eax], esi
lea eax, [ebp + ecx*2 - 0x622]
test eax, eax
je 0x403bf8
call sym._xwcsdup.part.9
mov ecx, dword [ebp - 0x648]
mov dword [ecx], eax
mov dword [esp], eax
call dword [sym.imp.shlwapi.dll_PathRemoveExtensionW]
mov eax, 1
sub esp, 4
jmp 0x403aa4
shr eax, 0x10
je 0x403cd2
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edi, eax
sub esp, 8
mov eax, str._invalid_
test edi, edi
jne 0x403ce5
cmp word [esi], 0
je 0x403c5c
add edi, 1
cmp word [esi + edi*2], 0
jne 0x403c52
mov eax, 0x224c
mov dword [ebp - 0x640], esi
lea edx, [ebp - 0x212]
mov word [ebp - 0x214], ax
lea ebx, [edi - 1]
test edi, edi
jle 0x404013
lea eax, [ebp - 0xf2]
cmp edx, eax
ja 0x404013
add dword [ebp - 0x640], 2
mov eax, dword [ebp - 0x640]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x403da0
ja 0x403d52
cmp ax, 9
je 0x403e13
cmp ax, 0xa
jne 0x403db3
mov eax, 0x6e5c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x403c74
movzx eax, si
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.16
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40f844
mov dword [esp + 8], global___func__.0
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.18
jmp 0x4039e3
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.16
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40f844
mov dword [esp + 8], global___func__.0
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.18
jmp 0x403a24
cmp ax, 0x22
je 0x403e30
cmp ax, 0x5c
jne 0x403db3
mov edi, 0x5c5c
add edx, 2
mov word [edx - 2], di
mov edi, ebx
jmp 0x403c74
cmp ax, 0x22
je 0x403f83
cmp ax, 0x5c
jne 0x403fa0
mov esi, 0x5c5c
add edx, 2
mov word [edx - 2], si
mov esi, ebx
jmp 0x403b12
mov eax, 0x725c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x403c74
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x404123
mov edi, eax
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ecx, byte [edi + str.0123456789abcdef]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [edx - 4], cl
movzx ecx, byte [edi + str.0123456789abcdef]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdef]
and edi, 0xf
mov byte [edx - 3], cl
movzx ecx, byte [edi + str.0123456789abcdef]
mov byte [edx - 1], al
mov edi, ebx
mov byte [edx - 2], cl
jmp 0x403c74
mov eax, 0x745c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x403c74
mov eax, 0x225c
add edx, 2
mov edi, ebx
mov word [edx - 2], ax
jmp 0x403c74
lea eax, [ebp - 0x624]
shr eax, 0x10
je 0x404147
lea eax, [ebp - 0x624]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x403f42
cmp word [ebp - 0x624], 0
je 0x403e93
add edx, 1
cmp word [ebp + edx*2 - 0x624], 0
jne 0x403e85
mov eax, 0x224c
lea ecx, [ebp - 0x212]
lea ebx, [ebp - 0x624]
mov word [ebp - 0x214], ax
lea edi, [ebp - 0xf2]
lea esi, [edx - 1]
test edx, edx
jle 0x403f17
cmp ecx, edi
ja 0x403f17
add ebx, 2
movzx eax, word [ebx - 2]
cmp ax, 0xd
je 0x404080
ja 0x403ef3
cmp ax, 9
je 0x4040f3
cmp ax, 0xa
jne 0x404093
mov eax, 0x6e5c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x403eb1
cmp ax, 0x22
je 0x404110
cmp ax, 0x5c
jne 0x404093
mov eax, 0x5c5c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x403eb1
mov byte [ecx], 0x22
lea eax, [ecx + 1]
test esi, esi
jle 0x403f31
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
lea ebx, [ebp - 0x214]
mov byte [eax], 0
mov dword [esp], ebx
call dbg.__wine_dbg_strdup
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40f844
mov dword [esp + 8], global___func__.0
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.18
jmp 0x403a65
mov eax, 0x725c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x403b12
mov eax, 0x225c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x403b12
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x40412f
mov esi, eax
mov byte [edx], 0x5c
add edx, 5
shr si, 0xc
movzx esi, si
movzx ecx, byte [esi + str.0123456789abcdef]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [edx - 4], cl
movzx ecx, byte [esi + str.0123456789abcdef]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdef]
and esi, 0xf
mov byte [edx - 3], cl
movzx ecx, byte [esi + str.0123456789abcdef]
mov byte [edx - 1], al
mov esi, ebx
mov byte [edx - 2], cl
jmp 0x403b12
mov eax, 0x745c
add edx, 2
mov esi, ebx
mov word [edx - 2], ax
jmp 0x403b12
mov byte [edx], 0x22
lea eax, [edx + 1]
test ebx, ebx
jle 0x40402d
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
lea ebx, [ebp - 0x214]
mov byte [eax], 0
mov dword [esp], ebx
call dbg.__wine_dbg_strdup
jmp 0x403ce5
xor ecx, ecx
jmp 0x403ba6
mov byte [edx], 0x22
lea eax, [edx + 1]
test ebx, ebx
jle 0x40406a
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
lea ebx, [ebp - 0x214]
mov byte [eax], 0
mov dword [esp], ebx
call dbg.__wine_dbg_strdup
jmp 0x403d25
mov eax, 0x725c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x403eb1
lea edx, [eax - 0x20]
cmp dx, 0x5e
jbe 0x40413b
mov edx, eax
mov byte [ecx], 0x5c
add ecx, 5
shr dx, 0xc
movzx edx, dx
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 4], dl
mov edx, eax
shr dx, 8
and edx, 0xf
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 3], dl
mov edx, eax
and eax, 0xf
shr dx, 4
movzx eax, byte [eax + str.0123456789abcdef]
and edx, 0xf
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 1], al
mov byte [ecx - 2], dl
mov edx, esi
jmp 0x403eb1
mov eax, 0x745c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x403eb1
mov eax, 0x225c
add ecx, 2
mov edx, esi
mov word [ecx - 2], ax
jmp 0x403eb1
mov byte [edx], al
mov edi, ebx
add edx, 1
jmp 0x403c74
mov byte [edx], al
mov esi, ebx
add edx, 1
jmp 0x403b12
mov byte [ecx], al
mov edx, esi
add ecx, 1
jmp 0x403eb1
lea eax, [ebp - 0x624]
mov dword [esp], str._04x
mov dword [ebp - 0x64c], eax
movzx eax, word [ebp - 0x64c]
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.16
jmp 0x403f42