Function at 0x512650
Capabilities:
Get common file path

Disassembly:
sub esp, 0x6c
push ebx
push ebp
mov ebp, ecx
push esi
mov ecx, dword [0x55e528]
push edi
xor eax, eax
xor edi, edi
xor esi, esi
cmp ecx, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
je 0x512680
cmp dword [ebp + 0xd4], eax
jne 0x512680
mov edi, 0x400
jmp 0x512685
mov esi, 0x400
cmp dword [0x55e520], eax
je 0x512698
or edi, 0x1000
or esi, 6
jmp 0x5126a1
or esi, 0x1000
or edi, 6
mov eax, dword [ebp + 4]
mov ebx, dword [sym.imp.USER32.dll_GetWindowLongW]
push 0xfffffffffffffff0
push eax
call ebx
not esi
and esi, eax
or esi, edi
mov edi, dword [sym.imp.USER32.dll_SetWindowLongW]
cmp eax, esi
je 0x5126c8
mov ecx, dword [ebp + 4]
push esi
push 0xfffffffffffffff0
push ecx
call edi
mov eax, dword [0x55e518]
test eax, eax
je 0x5126eb
mov edx, dword [ebp + 4]
push 0xfffffffffffffff0
push edx
call ebx
mov ecx, eax
and ecx, 0xfffffff9
cmp eax, ecx
je 0x5126eb
mov eax, dword [ebp + 4]
push ecx
push 0xfffffffffffffff0
push eax
call edi
mov ecx, dword [ebp + 4]
push ecx
call fcn.004b0e80
mov eax, dword [0x55e51c]
add esp, 4
test eax, eax
push 0xfffffffffffffff0
je 0x51271a
mov edx, dword [ebp + 4]
push edx
call ebx
mov ecx, eax
or ecx, 4
cmp eax, ecx
je 0x512732
mov eax, dword [ebp + 4]
push ecx
push 0xfffffffffffffff0
push eax
jmp 0x512730
mov ecx, dword [ebp + 4]
push ecx
call ebx
mov ecx, eax
and ecx, 0xfffffffb
cmp eax, ecx
je 0x512732
mov edx, dword [ebp + 4]
push ecx
push 0xfffffffffffffff0
push edx
call edi
mov dword [ebp + 0xf8], 0x20
mov eax, dword [0x54fb30]
test eax, eax
je 0x51274f
mov dword [ebp + 0xf8], 0x60
lea eax, [esp + 0x18]
push 0x23
push eax
call dword [sym.imp.SHELL32.dll_SHGetSettings]
test byte [esp + 0x18], 1
je 0x512771
mov eax, dword [ebp + 0xf8]
or al, 0x80
mov dword [ebp + 0xf8], eax
mov ebx, dword [esp + 0x80]
mov edi, dword [sym.imp.SHELL32.dll_ILClone]
test ebx, ebx
je 0x5127c1
push ebx
call edi
mov esi, eax
push esi
call dword [sym.imp.SHELL32.dll_ILRemoveLastID]
test esi, esi
je 0x5128b3
push ebx
call dword [sym.imp.SHELL32.dll_ILFindLastID]
push eax
call edi
cmp word [esi], 0
lea edx, [esp + 0x10]
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 0xfc]
push edx
push 0x542354
mov ecx, dword [eax]
push 0
push esi
push eax
call dword [ecx + 0x14]
mov eax, dword [ebp + 0xec]
mov ecx, dword [ebp + 4]
mov esi, dword [sym.imp.USER32.dll_SendMessageW]
push eax
push 0
push 0x1109
push ecx
call esi
mov edx, dword [ebp + 4]
push 0
push 0x64
push 0x1121
push edx
call esi
lea eax, [esp + 0x1c]
push eax
push 0
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jl 0x5128b3
push 0xc
push 0x40
mov dword [esp + 0x28], 0x67
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ecx, dword [esp + 0x14]
mov esi, eax
push ebx
mov dword [esi + 8], ecx
call edi
mov dword [esi + 4], eax
mov edx, dword [esp + 0x10]
or eax, 0xffffffff
mov dword [esi], edx
mov dword [esp + 0x44], esi
mov dword [esp + 0x30], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x38], eax
mov ecx, 0xa
lea esi, [esp + 0x20]
lea edi, [esp + 0x50]
mov dword [esp + 0x40], 1
lea eax, [esp + 0x48]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp + 4]
mov edi, dword [sym.imp.USER32.dll_SendMessageW]
push eax
push 0
push 0x1132
push ecx
mov dword [esp + 0x5c], 0xffff0002
mov dword [esp + 0x58], 0xffff0000
call edi
mov ecx, dword [ebp + 0x7c]
mov esi, eax
mov eax, dword [ebp + 0xfc]
push ecx
push ebx
push 0
mov edx, dword [eax]
push eax
call dword [edx + 0x1c]
test eax, eax
jne 0x512896
mov dword [ebp + 0x68], esi
mov edx, dword [ebp + 4]
push esi
push 2
push 0x1102
push edx
call edi
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x6c
ret 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x6c
ret 4