Function at 0x40df50
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 0x40e1b9
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 0x40df96
cmp dword [eax - 4], ecx
jge 0x40dff8
mov esi, dword [eax - 8]
cmp esi, ecx
mov dword [esp + 0x14], esi
jle 0x40dfa3
mov ecx, esi
push ecx
mov ecx, edi
call fcn.00405530
test eax, eax
jne 0x40dfb3
xor edi, edi
jmp 0x40dffa
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 [0x546564]
cmp ebx, eax
je 0x40dff4
push ebx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x40dff4
push ebx
call fcn.00531732
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 0x40e03b
cmp dword [eax - 4], ecx
jge 0x40e086
mov edi, dword [eax - 8]
cmp edi, 0x400
mov dword [esp + 0x18], edi
jle 0x40e04c
mov ecx, edi
push ecx
mov ecx, ebx
call fcn.00405530
test eax, eax
jne 0x40e05c
xor ebx, ebx
jmp 0x40e088
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.00405590
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 0x40e0c5
cmp dword [eax - 4], ecx
jge 0x40e10c
mov edi, dword [eax - 8]
cmp edi, 0x400
mov dword [esp + 0x1c], edi
jle 0x40e0d6
mov ecx, edi
push ecx
mov ecx, ebx
call fcn.00405530
test eax, eax
je 0x40e10e
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.00405590
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 0x40e14b
cmp dword [eax - 4], ecx
jge 0x40e1a5
mov edi, dword [eax - 8]
cmp edi, 0x400
mov dword [esp + 0x24], edi
jle 0x40e15c
mov ecx, edi
push ecx
mov ecx, ebp
call fcn.00405530
test eax, eax
jne 0x40e179
mov ecx, dword [esp + 0x28]
push eax
push ecx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
jmp 0x40e2c4
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.00405590
mov eax, dword [ebp]
mov ecx, dword [esp + 0x28]
push eax
push ecx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
jmp 0x40e2c4
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 0x40e1ee
cmp dword [eax - 4], ecx
jge 0x40e245
mov eax, dword [eax - 8]
cmp eax, ecx
mov dword [esp + 0x14], eax
jle 0x40e1fb
mov ecx, eax
push ecx
mov ecx, ebx
call fcn.00405530
test eax, eax
jne 0x40e20b
xor ebx, ebx
jmp 0x40e247
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.00405590
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.00413620
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.00413620
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.00413620
mov ecx, dword [esp + 0x28]
push eax
push ecx
call esi
mov ecx, ebx
call fcn.004055c0
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.00405bb0
mov ecx, dword [esp + 0x10]
push 0xffffffffffffffff
call fcn.00405bb0
push 0xffffffffffffffff
mov ecx, ebp
call fcn.00405bb0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 8