Function at 0x407880
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
push ebx
sub esp, 0x66c
mov dword [ebp - 0x650], edx
mov dword [ebp - 0x654], ecx
mov dword [ebp - 0x644], 0x10
mov dword [ebp - 0x640], 0xb
mov dword [ebp - 0x63c], 0x18
mov dword [ebp - 0x638], 0x19
mov dword [ebp - 0x634], 0x16
test byte [section..data], 8
jne 0x407b80
lea edi, [ebp - 0x428]
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]
dec eax
sub esp, 0x10
cmp eax, 0x103
ja 0x407a80
test byte [section..data], 8
jne 0x407a90
lea eax, [ebp - 0x630]
mov dword [esp + 8], 0x104
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_GetLongPathNameW]
mov dword [ebp - 0x64c], eax
dec eax
sub esp, 0xc
cmp eax, 0x103
ja 0x407a80
lea ebx, [ebp - 0x220]
test byte [section..data], 8
jne 0x407d98
lea edi, [ebp - 0x644]
mov esi, 7
jmp 0x407983
lea eax, [ebp - 0x630]
cmp eax, edi
je 0x407a80
mov esi, dword [edi]
add edi, 4
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [sym.imp.shell32.dll_SHGetSpecialFolderPathW]
sub esp, 0x10
test eax, eax
je 0x407970
cmp word [ebp - 0x220], 0
je 0x407fc8
mov eax, ebx
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x4079c0
sub eax, ebx
mov edx, eax
mov ecx, eax
sar edx, 1
cmp dword [ebp - 0x64c], edx
jb 0x407970
cmp eax, 0x206
ja 0x407970
cmp word [ebp + edx*2 - 0x630], 0x5c
jne 0x407970
lea eax, [ebp - 0x630]
mov dword [ebp - 0x658], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsnicmp]
test eax, eax
jne 0x407970
mov ecx, dword [ebp - 0x658]
mov eax, dword [ebp - 0x650]
lea ebx, [ebp + ecx - 0x62e]
mov dword [eax], esi
cmp word [ebx], 0
je 0x40814d
mov eax, ebx
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x407a38
sub eax, ebx
add eax, 2
call sym._xmalloc
mov ecx, eax
xor eax, eax
nop
movzx edx, word [ebx + eax]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x407a50
mov eax, dword [ebp - 0x654]
mov dword [eax], ecx
mov dword [esp], ecx
call dword [sym.imp.shlwapi.dll_PathRemoveExtensionW]
mov eax, 1
sub esp, 4
jmp 0x407a82
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, edi
shr eax, 0x10
je 0x407cb0
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x407cc3
movzx eax, word [ebp - 0x428]
test ax, ax
je 0x40812c
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x407ad0
mov esi, 0x224c
mov dword [ebp - 0x64c], edi
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], si
jmp 0x407b44
cmp ax, 9
je 0x407ee8
cmp ax, 0xa
jne 0x407f06
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [edx - 1]
test edx, edx
jle 0x408079
lea eax, [ebp - 0xfe]
cmp ecx, eax
ja 0x408079
mov eax, dword [ebp - 0x64c]
mov edx, esi
movzx eax, word [eax]
add dword [ebp - 0x64c], 2
cmp ax, 0xd
je 0x407f78
jbe 0x407b00
cmp ax, 0x22
je 0x407f60
cmp ax, 0x5c
jne 0x407ef9
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x407b20
shr eax, 0x10
je 0x407c70
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x407c83
movzx eax, word [esi]
test ax, ax
je 0x4080e3
lea esi, [esi]
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [esi + edx*2 + 2], 0
jne 0x407bc0
mov ecx, 0x224c
mov dword [ebp - 0x64c], esi
mov word [ebp - 0x220], cx
lea ecx, [ebp - 0x21e]
jmp 0x407c34
cmp ax, 9
je 0x407d08
cmp ax, 0xa
jne 0x407d26
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea edi, [edx - 1]
test edx, edx
jle 0x407f90
lea eax, [ebp - 0xfe]
cmp ecx, eax
ja 0x407f90
mov eax, dword [ebp - 0x64c]
mov edx, edi
movzx eax, word [eax]
add dword [ebp - 0x64c], 2
cmp ax, 0xd
je 0x407cf0
jbe 0x407bf0
cmp ax, 0x22
je 0x407d80
cmp ax, 0x5c
jne 0x407d19
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x407c10
movzx eax, si
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40d3df
mov dword [esp + 8], str.get_link_location
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4078d9
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40d3df
mov dword [esp + 8], str.get_link_location
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x407918
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x407c10
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x407c10
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x4080aa
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefGCC:__GNU__10.3.0]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x407c10
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x407c10
lea eax, [ebp - 0x630]
shr eax, 0x10
je 0x408104
lea eax, [ebp - 0x630]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x407eb7
movzx eax, word [ebp - 0x630]
test ax, ax
je 0x4080c2
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebp + edx*2 - 0x62e], 0
jne 0x407de0
mov edi, 0x224c
lea ebx, [ebp - 0x630]
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], di
lea edi, [ebp - 0xfe]
mov dword [ebp - 0x658], ebx
jmp 0x407e56
cmp ax, 9
je 0x407fd8
cmp ax, 0xa
jne 0x407ff6
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [edx - 1]
test edx, edx
jle 0x407e8b
cmp ecx, edi
ja 0x407e8b
mov eax, dword [ebp - 0x658]
mov edx, esi
movzx eax, word [eax]
add dword [ebp - 0x658], 2
cmp ax, 0xd
je 0x408050
jbe 0x407e20
cmp ax, 0x22
je 0x408068
cmp ax, 0x5c
jne 0x407fe9
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x407e40
mov byte [ecx], 0x22
test esi, esi
jle 0x4080db
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
lea ebx, [ebp - 0x220]
mov byte [eax], 0
mov dword [esp], ebx
call sym.___wine_dbg_strdup
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x40d3df
mov dword [esp + 8], str.get_link_location
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x40795b
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x407b20
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x4080b2
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefGCC:__GNU__10.3.0]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x407b20
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x407b20
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x407b20
mov byte [ecx], 0x22
test edi, edi
jle 0x4080fc
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
lea ebx, [ebp - 0x220]
mov byte [eax], 0
mov dword [esp], ebx
call sym.___wine_dbg_strdup
jmp 0x407c83
xor ecx, ecx
xor edx, edx
jmp 0x4079e0
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x407e40
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x4080ba
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefGCC:__GNU__10.3.0]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x407e40
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x407e40
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x407e40
mov byte [ecx], 0x22
test esi, esi
jle 0x408145
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
lea ebx, [ebp - 0x220]
mov byte [eax], 0
mov dword [esp], ebx
call sym.___wine_dbg_strdup
jmp 0x407cc3
mov byte [ecx], al
inc ecx
jmp 0x407c10
mov byte [ecx], al
inc ecx
jmp 0x407b20
mov byte [ecx], al
inc ecx
jmp 0x407e40
mov eax, 0x224c
mov byte [ebp - 0x21e], 0x22
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], ax
lea eax, [ecx + 1]
jmp 0x407ea6
mov eax, 0x224c
mov byte [ebp - 0x21e], 0x22
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], ax
lea eax, [ecx + 1]
jmp 0x407fab
lea eax, [ebp - 0x630]
mov dword [esp], str._04x
mov dword [ebp - 0x658], eax
movzx eax, word [ebp - 0x658]
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x407eb7
mov ebx, 0x224c
mov byte [ebp - 0x21e], 0x22
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], bx
lea eax, [ecx + 1]
jmp 0x408094
mov eax, 2
jmp 0x407a46