Function at 0x52f3b0
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x577804
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x5d52e0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov ebx, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
test ebx, ebx
je 0x52f64a
push str.Shell32.dll
mov dword [ebp - 0x14], 0
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
mov dword [ebp - 0x18], esi
mov dword [ebp - 4], 0
test esi, esi
je 0x52f41b
push str.SHGetKnownFolderIDList
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x52f430
push 0x5c77e8
lea eax, [ebp - 0x1c]
push eax
mov dword [ebp - 0x1c], 1
call fcn.005039bf
lea ecx, [ebp - 0x14]
push ecx
push 0
push 0
push edi
call eax
test eax, eax
je 0x52f454
push 0x5c77e8
lea edx, [ebp - 0x20]
push edx
mov dword [ebp - 0x20], 2
call fcn.005039bf
mov dword [ebp - 4], 0xffffffff
jmp 0x52f473
test esi, esi
je 0x52f47e
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x52f5dd
lea ecx, [ebp + 0xc]
call fcn.004011e0
push 0x5a9024
push edi
mov dword [ebp - 4], 2
call fcn.004043e0
add esp, 8
test eax, eax
je 0x52f4dd
mov esi, dword [ebp + 0xc]
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x52f4d1
push 0x104
lea ecx, [ebp + 0xc]
call fcn.004019b0
mov esi, dword [ebp + 0xc]
push esi
push 0
push 0
push 5
jmp 0x52f55f
push 0x5a9054
push edi
call fcn.004043e0
add esp, 8
test eax, eax
je 0x52f51f
mov esi, dword [ebp + 0xc]
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x52f516
push 0x104
lea ecx, [ebp + 0xc]
call fcn.004019b0
mov esi, dword [ebp + 0xc]
push esi
push 0
push 0
push 0x27
jmp 0x52f55f
push 0x5a9044
push edi
call fcn.004043e0
mov esi, dword [ebp + 0xc]
add esp, 8
test eax, eax
je 0x52f567
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x52f558
push 0x104
lea ecx, [ebp + 0xc]
call fcn.004019b0
mov esi, dword [ebp + 0xc]
push esi
push 0
push 0
push 0x25
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov eax, dword [esi - 8]
push eax
push esi
call fcn.004ff818
add esp, 8
test eax, eax
js 0x52f5d3
cmp eax, dword [esi - 8]
jg 0x52f5d3
xor ecx, ecx
mov dword [esi - 0xc], eax
push esi
mov word [esi + eax*2], cx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
je 0x52f59b
push esi
call dword [sym.imp.SHELL32.dll_ILCreateFromPathW]
mov dword [ebp - 0x14], eax
lea eax, [esi - 0x10]
mov dword [ebp - 4], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x52f5be
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x52f5dd
push 0x5a95c8
mov ecx, ebx
call fcn.004012d0
jmp 0x52f640
push 0x80070057
call fcn.004010a0
lea ecx, [ebp + 0xc]
push ecx
push eax
push 0
push 0
mov dword [ebp + 0xc], 0
call dword [sym.imp.SHELL32.dll_SHCreateShellItem]
test eax, eax
jne 0x52f640
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 0xc]
mov edx, dword [eax]
mov edx, dword [edx + 0x14]
lea ecx, [ebp - 0x18]
push ecx
push 0
push eax
call edx
mov eax, dword [ebp - 0x18]
push eax
lea ecx, [ebp - 0x24]
call fcn.00401210
push eax
mov ecx, ebx
mov dword [ebp - 4], 3
call fcn.004015b0
lea ecx, [ebp - 0x24]
mov dword [ebp - 4], 0xffffffff
call fcn.00404b10
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.SHELL32.dll_ILFree]
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x52f79d
call fcn.0040c84f
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x52f66f
push 0x80004005
call fcn.004010a0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [ebp + 0xc], esi
push 0x5a9024
push edi
mov dword [ebp - 4], 4
call fcn.004043e0
add esp, 8
test eax, eax
je 0x52f6c4
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x52f6bb
push 0x104
lea ecx, [ebp + 0xc]
call fcn.004019b0
mov esi, dword [ebp + 0xc]
push esi
push 0
push 0
push 5
jmp 0x52f740
push 0x5a9054
push edi
call fcn.004043e0
add esp, 8
test eax, eax
je 0x52f703
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x52f6fa
push 0x104
lea ecx, [ebp + 0xc]
call fcn.004019b0
mov esi, dword [ebp + 0xc]
push esi
push 0
push 0
push 0x27
jmp 0x52f740
push 0x5a9044
push edi
call fcn.004043e0
add esp, 8
test eax, eax
je 0x52f748
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x52f739
push 0x104
lea ecx, [ebp + 0xc]
call fcn.004019b0
mov esi, dword [ebp + 0xc]
push esi
push 0
push 0
push 0x25
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov eax, dword [esi - 8]
push eax
push esi
call fcn.004ff818
add esp, 8
test eax, eax
js 0x52f5d3
cmp eax, dword [esi - 8]
jg 0x52f5d3
xor ecx, ecx
mov dword [esi - 0xc], eax
lea edx, [ebp + 0xc]
mov word [esi + eax*2], cx
push edx
mov ecx, ebx
call fcn.004015b0
lea eax, [esi - 0x10]
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x52f79d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret