Function at 0x402240
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 - 0x654], edx
mov dword [ebp - 0x658], ecx
mov dword [ebp - 0x648], 7
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 0x402540
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]
sub eax, 1
sub esp, 0x10
cmp eax, 0x103
ja 0x402440
test byte [section..data], 8
jne 0x402450
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 - 0x650], eax
sub eax, 1
sub esp, 0xc
cmp eax, 0x103
ja 0x402440
lea ebx, [ebp - 0x220]
test byte [section..data], 8
jne 0x402748
lea edi, [ebp - 0x648]
jmp 0x402349
add edi, 4
lea eax, [ebp - 0x630]
cmp edi, eax
je 0x402440
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
je 0x402338
cmp word [ebp - 0x220], 0
je 0x402978
mov eax, ebx
nop
add eax, 2
cmp word [eax], 0
jne 0x402380
sub eax, ebx
mov ecx, eax
sar eax, 1
cmp dword [ebp - 0x650], eax
jb 0x402338
cmp ecx, 0x206
ja 0x402338
cmp word [ebp + eax*2 - 0x630], 0x5c
jne 0x402338
mov dword [esp + 8], eax
lea eax, [ebp - 0x630]
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 0x402338
mov ecx, dword [ebp - 0x64c]
mov eax, dword [ebp - 0x654]
lea ebx, [ebp + ecx - 0x62e]
mov dword [eax], esi
cmp word [ebx], 0
je 0x402b07
mov eax, ebx
add eax, 2
cmp word [eax], 0
jne 0x4023f0
sub eax, ebx
add eax, 2
call fcn.00401530
mov ecx, eax
xor eax, eax
lea esi, [esi]
nop
movzx edx, word [ebx + eax]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x402410
mov eax, dword [ebp - 0x658]
mov dword [eax], ecx
mov dword [esp], ecx
call dword [sym.imp.shlwapi.dll_PathRemoveExtensionW]
mov eax, 1
sub esp, 4
jmp 0x402442
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, edi
shr eax, 0x10
je 0x402662
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x402677
cmp word [ebp - 0x428], 0
je 0x402ae6
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x402490
mov esi, 0x224c
mov dword [ebp - 0x64c], edi
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], si
jmp 0x4024fb
cmp ax, 9
je 0x4028a0
cmp ax, 0xa
jne 0x4028be
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea eax, [edx - 1]
test edx, edx
jle 0x402a29
lea ebx, [ebp - 0xfe]
cmp ecx, ebx
ja 0x402a29
mov edx, eax
add dword [ebp - 0x64c], 2
mov eax, dword [ebp - 0x64c]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x402928
jbe 0x4024c0
cmp ax, 0x22
je 0x402910
cmp ax, 0x5c
jne 0x4028b1
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x4024e0
shr eax, 0x10
je 0x402620
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x402635
cmp word [esi], 0
je 0x402a9b
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [esi + edx*2 + 2], 0
jne 0x402578
mov ecx, 0x224c
mov dword [ebp - 0x64c], esi
mov word [ebp - 0x220], cx
lea ecx, [ebp - 0x21e]
jmp 0x4025db
cmp ax, 9
je 0x4026c0
cmp ax, 0xa
jne 0x4026de
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea eax, [edx - 1]
test edx, edx
jle 0x402940
lea ebx, [ebp - 0xfe]
cmp ecx, ebx
ja 0x402940
mov edx, eax
add dword [ebp - 0x64c], 2
mov eax, dword [ebp - 0x64c]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x4026a8
jbe 0x4025a0
cmp ax, 0x22
je 0x402730
cmp ax, 0x5c
jne 0x4026d1
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x4025c0
movzx eax, si
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00401420
mov edx, eax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0x40d3df
mov dword [esp + 8], str.get_link_location
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call fcn.004014e0
jmp 0x4022a3
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00401420
mov edx, eax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0x40d3df
mov dword [esp + 8], str.get_link_location
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call fcn.004014e0
jmp 0x4022e4
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4025c0
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4025c0
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x402a5c
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefxmalloc]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x4025c0
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x4025c0
lea eax, [ebp - 0x630]
shr eax, 0x10
je 0x402abc
lea eax, [ebp - 0x630]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x40286a
cmp word [ebp - 0x630], 0
je 0x402a7a
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [ebp + edx*2 - 0x62e], 0
jne 0x402790
mov edi, 0x224c
lea ebx, [ebp - 0x630]
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], di
lea edi, [ebp - 0xfe]
mov dword [ebp - 0x64c], ebx
jmp 0x4027fd
cmp ax, 9
je 0x402988
cmp ax, 0xa
jne 0x4029a6
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea eax, [edx - 1]
test edx, edx
jle 0x40283c
cmp ecx, edi
ja 0x40283c
mov edx, eax
add dword [ebp - 0x64c], 2
mov eax, dword [ebp - 0x64c]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x402a00
jbe 0x4027d0
cmp ax, 0x22
je 0x402a18
cmp ax, 0x5c
jne 0x402999
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x4027f0
mov byte [ecx], 0x22
test eax, eax
jle 0x402a93
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 fcn.0040b160
mov edx, eax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0x40d3df
mov dword [esp + 8], str.get_link_location
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call fcn.004014e0
jmp 0x402329
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4024e0
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x402a66
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdefxmalloc]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdefxmalloc]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefxmalloc]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdefxmalloc]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x4024e0
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x4024e0
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4024e0
mov byte [ecx], 0x22
test eax, eax
jle 0x402ab4
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 fcn.0040b160
mov edx, eax
jmp 0x402635
xor ecx, ecx
xor eax, eax
jmp 0x40239f
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4027f0
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x402a70
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdefxmalloc]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdefxmalloc]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefxmalloc]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdefxmalloc]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x4027f0
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4027f0
mov esi, 0x225c
add ecx, 2
mov word [ecx - 2], si
jmp 0x4027f0
mov byte [ecx], 0x22
test eax, eax
jle 0x402aff
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 fcn.0040b160
mov edx, eax
jmp 0x402677
mov byte [ecx], al
add ecx, 1
jmp 0x4025c0
mov byte [ecx], al
add ecx, 1
jmp 0x4024e0
mov byte [ecx], al
add ecx, 1
jmp 0x4027f0
mov eax, 0x224c
mov byte [ebp - 0x21e], 0x22
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], ax
lea eax, [ecx + 1]
jmp 0x402857
mov eax, 0x224c
mov byte [ebp - 0x21e], 0x22
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], ax
lea eax, [ecx + 1]
jmp 0x40295b
lea eax, [ebp - 0x630]
mov dword [esp], str._04x
mov dword [ebp - 0x64c], eax
movzx eax, word [ebp - 0x64c]
mov dword [esp + 4], eax
call fcn.00401420
mov edx, eax
jmp 0x40286a
mov ebx, 0x224c
mov byte [ebp - 0x21e], 0x22
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], bx
lea eax, [ecx + 1]
jmp 0x402a44
mov eax, 2
jmp 0x4023fe