Function at 0x40a250
Capabilities:
Get common file path

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x10
test eax, eax
push ebx
push ebp
push esi
push edi
mov ebp, ecx
je 0x40a4b9
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x28]
push eax
push 0xb
push ecx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
mov eax, dword [ebp + 0x24]
lea edi, [ebp + 0x24]
mov ecx, 0x400
mov dword [esp + 0x10], edi
mov edx, dword [eax - 0xc]
lea ebx, [eax - 0xc]
cmp edx, 1
jg 0x40a296
cmp dword [eax - 4], ecx
jge 0x40a2f8
mov esi, dword [eax - 8]
cmp esi, ecx
mov dword [esp + 0x14], esi
jle 0x40a2a3
mov ecx, esi
push ecx
mov ecx, edi
call fcn.004012f0
test eax, eax
jne 0x40a2b3
xor edi, edi
jmp 0x40a2fa
mov edi, dword [edi]
lea ecx, [esi + esi + 2]
mov edx, ecx
lea esi, [ebx + 0xc]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x10]
mov ecx, edx
mov edx, dword [esp + 0x14]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [eax]
mov dword [ecx - 8], edx
mov eax, dword [0x4d9544]
cmp ebx, eax
je 0x40a2f4
push ebx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x40a2f4
push ebx
call fcn.004c5432
add esp, 4
mov edi, dword [esp + 0x10]
mov edi, dword [edi]
mov eax, dword [esp + 0x28]
push edi
push eax
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x28]
push ecx
push 0
push edx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
mov eax, dword [ebp + 0x20]
lea ebx, [ebp + 0x20]
mov ecx, 0x400
mov dword [esp + 0x14], ebx
mov edx, dword [eax - 0xc]
lea esi, [eax - 0xc]
cmp edx, 1
mov dword [esp + 0x1c], esi
jg 0x40a33b
cmp dword [eax - 4], ecx
jge 0x40a386
mov edi, dword [eax - 8]
cmp edi, 0x400
mov dword [esp + 0x18], edi
jle 0x40a34c
mov ecx, edi
push ecx
mov ecx, ebx
call fcn.004012f0
test eax, eax
jne 0x40a35c
xor ebx, ebx
jmp 0x40a388
lea ecx, [edi + edi + 2]
mov edi, dword [ebx]
mov eax, ecx
add esi, 0xc
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov edx, dword [esp + 0x18]
mov ecx, eax
mov eax, dword [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx]
push eax
mov dword [ecx - 8], edx
call fcn.00401350
mov ebx, dword [ebx]
mov ecx, dword [esp + 0x28]
push ebx
push ecx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x28]
push edx
push 2
push eax
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
mov eax, dword [ebp + 0x28]
lea ebx, [ebp + 0x28]
mov ecx, 0x400
mov edx, dword [eax - 0xc]
lea esi, [eax - 0xc]
cmp edx, 1
mov dword [esp + 0x18], esi
jg 0x40a3c5
cmp dword [eax - 4], ecx
jge 0x40a40c
mov edi, dword [eax - 8]
cmp edi, 0x400
mov dword [esp + 0x1c], edi
jle 0x40a3d6
mov ecx, edi
push ecx
mov ecx, ebx
call fcn.004012f0
test eax, eax
je 0x40a40e
lea ecx, [edi + edi + 2]
mov edi, dword [ebx]
mov edx, ecx
add esi, 0xc
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x18]
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx]
mov ecx, dword [esp + 0x20]
mov dword [eax - 8], ecx
call fcn.00401350
mov eax, dword [ebx]
push eax
mov eax, dword [esp + 0x2c]
push eax
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x28]
push ecx
push 0x1a
push edx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
mov eax, dword [ebp + 0x2c]
add ebp, 0x2c
mov ecx, 0x400
mov edx, dword [eax - 0xc]
lea esi, [eax - 0xc]
cmp edx, 1
mov dword [esp + 0x1c], esi
jg 0x40a44b
cmp dword [eax - 4], ecx
jge 0x40a4a5
mov edi, dword [eax - 8]
cmp edi, 0x400
mov dword [esp + 0x24], edi
jle 0x40a45c
mov ecx, edi
push ecx
mov ecx, ebp
call fcn.004012f0
test eax, eax
jne 0x40a479
mov ecx, dword [esp + 0x28]
push eax
push ecx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
jmp 0x40a5c4
lea ecx, [edi + edi + 2]
mov edi, dword [ebp]
mov eax, ecx
add esi, 0xc
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov edx, dword [esp + 0x24]
mov ecx, eax
mov eax, dword [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp]
push eax
mov dword [ecx - 8], edx
call fcn.00401350
mov eax, dword [ebp]
mov ecx, dword [esp + 0x28]
push eax
push ecx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
jmp 0x40a5c4
mov edi, dword [esp + 0x24]
lea edx, [esp + 0x28]
push edx
push 0x16
push edi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
mov eax, dword [ebp + 0x24]
lea ebx, [ebp + 0x24]
mov ecx, 0x400
mov dword [esp + 0x10], ebx
mov edx, dword [eax - 0xc]
lea esi, [eax - 0xc]
cmp edx, 1
mov dword [esp + 0x1c], esi
jg 0x40a4ee
cmp dword [eax - 4], ecx
jge 0x40a545
mov eax, dword [eax - 8]
cmp eax, ecx
mov dword [esp + 0x14], eax
jle 0x40a4fb
mov ecx, eax
push ecx
mov ecx, ebx
call fcn.004012f0
test eax, eax
jne 0x40a50b
xor ebx, ebx
jmp 0x40a547
mov eax, dword [esp + 0x14]
mov edi, dword [ebx]
add esi, 0xc
lea ecx, [eax + eax + 2]
mov eax, dword [esp + 0x10]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x14]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [eax]
mov eax, dword [esp + 0x1c]
push eax
mov dword [ecx - 8], edx
call fcn.00401350
mov ebx, dword [esp + 0x10]
mov edi, dword [esp + 0x24]
mov ebx, dword [ebx]
mov ecx, dword [esp + 0x28]
mov esi, dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
push ebx
push ecx
call esi
mov ebx, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
lea edx, [esp + 0x28]
push edx
push 0x19
push edi
call ebx
lea ecx, [ebp + 0x20]
push 0x400
mov dword [esp + 0x18], ecx
call fcn.0040f900
push eax
mov eax, dword [esp + 0x2c]
push eax
call esi
lea ecx, [esp + 0x28]
push ecx
push 0x17
push edi
call ebx
lea ebx, [ebp + 0x28]
push 0x400
mov ecx, ebx
call fcn.0040f900
mov edx, dword [esp + 0x28]
push eax
push edx
call esi
lea eax, [esp + 0x28]
push eax
push 0x1a
push edi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
add ebp, 0x2c
push 0x400
mov ecx, ebp
call fcn.0040f900
mov ecx, dword [esp + 0x28]
push eax
push ecx
call esi
mov ecx, ebx
call fcn.00401380
mov edx, dword [ebx]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [ebx]
push 0xffffffffffffffff
mov dword [ecx - 8], eax
mov edx, dword [ebx]
mov ecx, dword [esp + 0x18]
mov word [edx + eax*2], 0
call fcn.00401970
mov ecx, dword [esp + 0x10]
push 0xffffffffffffffff
call fcn.00401970
push 0xffffffffffffffff
mov ecx, ebp
call fcn.00401970
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 8