Function at 0x4874e0
Capabilities:
Get common file path

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x18
mov ebx, ecx
lea eax, [esp + 0x10]
push eax
push 0
push 0
push edx
call sym._SHGetKnownFolderPath_16
test eax, eax
js 0x487761
mov ebp, dword [esp + 0x10]
test ebp, ebp
mov dword [esp + 8], ebx
je 0x487592
push ebp
call sym._wcslen
add esp, 4
test eax, eax
je 0x487592
sub esp, 0x20
xorps xmm0, xmm0
movups xmmword [esp + 0x10], xmm0
mov dword [esp + 0x20], eax
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
mov ebx, eax
mov esi, eax
inc esi
mov dword [esp + 4], eax
jne 0x4875ef
mov esi, dword [0x5052b0]
push 0
push 0
push ebx
push esi
push dword [esp + 0x10]
push ebp
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov byte [esi + ebx], 0
mov esi, 0x20
push 0x20
call sym._malloc
add esp, 4
mov ebp, eax
jmp 0x487626
mov al, 1
mov dword [esp + 0xc], eax
xor edi, edi
mov ebp, dword [0x5052b0]
mov al, 1
mov esi, 0x20
lea ecx, [edi + 2]
mov edx, esi
nop dword [eax]
mov esi, edx
add edx, edx
cmp ecx, esi
ja 0x4875b0
test al, al
je 0x4875de
mov dword [esp], ebp
push esi
call sym._malloc
add esp, 4
mov ebp, eax
cmp byte [esp + 0xc], 0
je 0x48765a
mov byte [ebp], 0
jmp 0x48766b
push esi
push ebp
call sym._realloc
add esp, 8
mov ebp, eax
jmp 0x48766b
push esi
call sym._malloc
add esp, 4
mov byte [eax], 0
push 0
push 0
push ebx
push eax
push dword [esp + 0x10]
push ebp
mov ebp, eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov byte [ebp + ebx], 0
test edi, edi
mov eax, edi
je 0x48776f
mov edi, eax
mov ebx, dword [esp + 8]
push 0x5c
push ebp
nop dword [eax]
call sym._strchr
add esp, 8
test eax, eax
je 0x487645
mov byte [eax], 0x2f
inc eax
push 0x5c
push eax
jmp 0x487630
mov eax, dword [esp + 4]
cmp byte [eax + ebp - 1], 0x2f
jne 0x487769
mov eax, dword [esp + 4]
jmp 0x487678
lea eax, [edi + 1]
push eax
push dword [esp + 4]
push ebp
call sym._memcpy
add esp, 0xc
lea eax, [edi + 1]
mov byte [ebp + edi], 0x2f
mov byte [ebp + eax], 0
mov ecx, dword [ebx + 8]
test ecx, ecx
mov dword [esp + 4], eax
je 0x4876e4
mov dword [esp], ebp
mov eax, dword [ebx]
mov edx, dword [ebx + 4]
mov dword [esp + 0xc], edx
mov dword [esp + 0x14], eax
lea ebp, [eax + 8]
xor edi, edi
nop dword [eax + eax]
mov ebx, ecx
mov eax, dword [ebp - 4]
mov ecx, dword [esp + 4]
cmp eax, ecx
cmovae eax, ecx
inc eax
push eax
push dword [esp + 4]
push dword [ebp]
call sym._memcmp
add esp, 0xc
test eax, eax
je 0x48773d
inc edi
add ebp, dword [esp + 0xc]
mov ecx, ebx
cmp ebx, edi
jne 0x4876a0
mov ebx, dword [esp + 8]
mov edi, dword [esp + 4]
mov ebp, dword [esp]
mov eax, dword [esp + 0x14]
cmp ecx, dword [ebx + 0xc]
je 0x4876f9
jmp 0x48771c
mov edx, ebx
xor edi, edi
cmp edi, ecx
jne 0x48774a
mov ebx, edx
mov eax, dword [edx]
mov edi, dword [esp + 4]
cmp ecx, dword [ebx + 0xc]
jne 0x48771c
lea edx, [ecx + ecx]
test ecx, ecx
mov ecx, 0x10
cmovne ecx, edx
mov dword [ebx + 0xc], ecx
imul ecx, dword [ebx + 4]
push ecx
push eax
call sym._realloc
add esp, 8
mov dword [ebx], eax
mov ecx, dword [ebx + 8]
lea edx, [ecx + 1]
mov dword [ebx + 8], edx
imul ecx, dword [ebx + 4]
mov dword [eax + ecx], esi
mov dword [eax + ecx + 8], ebp
mov dword [eax + ecx + 4], edi
push dword [esp + 0x10]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
jmp 0x487761
mov edx, dword [esp + 8]
mov ebp, dword [esp]
mov ecx, ebx
cmp edi, ecx
je 0x4876ec
push dword [esp + 0x10]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
test esi, esi
je 0x487761
push ebp
call sym._free
add esp, 4
add esp, 0x18
pop esi
pop edi
pop ebx
pop ebp
ret
xor ecx, ecx
mov eax, edi
jmp 0x48777a
mov esi, 1
mov cl, 1
mov ebx, dword [esp + 8]
inc eax
cmp esi, eax
mov edi, dword [esp + 4]
jne 0x48766e
mov dword [esp + 0xc], ecx
xor eax, eax
cmp esi, 1
jbe 0x4875a2
jmp 0x4875a7