Function at 0x5099a0
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x595e81
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x450
push ebx
xor ebx, ebx
mov dword [ebp - 0x14], ebx
mov eax, dword [0x5f5774]
mov edx, dword [eax + 0xc]
push esi
mov esi, ecx
push edi
mov ecx, 0x5f5774
call edx
lea edi, [eax + 0x10]
mov dword [ebp - 0x10], edi
mov dword [ebp - 4], 2
cmp byte [ebp + 0xc], bl
je 0x509b5f
push 0x11
xor eax, eax
push str.PathToProgramData
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x38], 7
mov dword [ebp - 0x3c], ebx
mov word [ebp - 0x4c], ax
call fcn.00407db0
mov byte [ebp - 4], 3
mov edx, dword [esi + 0xc]
lea ecx, [ebp - 0x4c]
push ecx
push edx
lea eax, [ebp - 0x30]
push eax
mov ecx, esi
call fcn.00509830
mov byte [ebp - 4], 5
cmp dword [ebp - 0x38], 8
jb 0x509a39
mov ecx, dword [ebp - 0x4c]
push ecx
call fcn.00553d26
add esp, 4
mov eax, dword [ebp - 0x20]
push ebx
push 0x59c2bc
push eax
xor edx, edx
push ebx
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x38], 7
mov dword [ebp - 0x3c], ebx
mov word [ebp - 0x4c], dx
call fcn.00412190
test eax, eax
jne 0x509afd
lea ecx, [ebp - 0x254]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, dword [ebp + 8]
xor edx, edx
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], ebx
lea eax, [ebp - 0x254]
mov word [esi], dx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x509a91
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x254]
push eax
mov ecx, esi
call fcn.00407db0
mov dword [ebp - 0x14], 1
mov byte [ebp - 4], 2
cmp dword [ebp - 0x1c], 8
jb 0x509acc
mov ecx, dword [ebp - 0x30]
push ecx
call fcn.00553d26
add esp, 4
xor edx, edx
mov dword [ebp - 0x1c], 7
mov dword [ebp - 0x20], ebx
mov word [ebp - 0x30], dx
mov dword [ebp - 4], ebx
add edi, 0xfffffff0
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x509bff
mov ecx, dword [edi]
push edi
jmp 0x509bf8
mov esi, dword [ebp + 8]
xor ecx, ecx
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], ebx
lea edx, [ebp - 0x30]
mov word [esi], cx
push edx
mov ecx, esi
call fcn.0047fbb0
mov dword [ebp - 0x14], 1
mov byte [ebp - 4], 2
cmp dword [ebp - 0x1c], 8
jb 0x509b37
mov eax, dword [ebp - 0x30]
push eax
call fcn.00553d26
add esp, 4
xor ecx, ecx
mov dword [ebp - 0x1c], 7
mov dword [ebp - 0x20], ebx
mov word [ebp - 0x30], cx
mov dword [ebp - 4], ebx
lea eax, [edi - 0x10]
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x509bf3
push 1
push 0x1a
lea ecx, [ebp - 0x45c]
push ecx
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x509b95
push 0x5a00a4
lea edx, [ebp - 0x45c]
push edx
lea eax, [ebp - 0x10]
push 0x5a06c8
push eax
call fcn.004060d0
mov edi, dword [ebp - 0x10]
add esp, 0x10
cmp dword [edi - 4], 1
jle 0x509baa
mov ecx, dword [edi - 0xc]
push ecx
lea ecx, [ebp - 0x10]
call fcn.00403bd0
mov edi, dword [ebp - 0x10]
mov esi, dword [ebp + 8]
xor edx, edx
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], ebx
mov eax, edi
mov word [esi], dx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x509bc1
sub eax, edx
sar eax, 1
push eax
push edi
mov ecx, esi
call fcn.00407db0
mov dword [ebp - 0x14], 1
mov dword [ebp - 4], ebx
lea eax, [edi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x509bff
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xc]
pop edi
mov eax, esi
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8