Function at 0x10002e50
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
mov ebx, ecx
cmp dword [ebx + 0x628], 0
jne 0x1000316e
push esi
lea esi, [ebx + 0x62c]
test esi, esi
je 0x10002e85
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [ebx + 0x628], 0
jne 0x10003162
push edi
xor eax, eax
mov dword [ebx + 0x208], 0
push eax
push 0x28
push ebx
mov dword [ebx + 0x414], 0
lea edi, [ebx + 0x20c]
push eax
mov word [ebx], ax
mov word [edi], ax
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x10002f25
push ebx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10002ec3
push 0x104
sub ecx, edx
push edi
sar ecx, 1
push ebx
mov dword [ebx + 0x208], ecx
call dword [sym.imp.KERNEL32.dll_GetShortPathNameW]
test eax, eax
je 0x10002ef0
cmp eax, 0x104
jb 0x10002ef5
xor eax, eax
mov word [edi], ax
push edi
push ebx
call sub.msvcrt.dll__wcsicmp
add esp, 8
test eax, eax
jne 0x10002f06
mov word [edi], ax
lea ecx, [edi + 2]
lea esp, [esp]
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x10002f10
sub edi, ecx
sar edi, 1
mov dword [ebx + 0x414], edi
push 0x104
lea edi, [ebx + 0x418]
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemWindowsDirectoryW]
push 0x10202944
push 0x104
push edi
call fcn.101e6de0
push edi
call sub.msvcrt.dll__wcslwr
add esp, 0x10
call fcn.10009c50
test eax, eax
je 0x1000306d
lea eax, [ebp - 0xc]
push str._ProgramFiles_x86__
push eax
call fcn.10008d60
add esp, 8
lea ecx, [ebx + 0x620]
push eax
call fcn.10002790
mov edx, dword [ebp - 0xc]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10002f95
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebx + 0x620]
call fcn.100032c0
mov eax, dword [ebx + 0x620]
mov ecx, 0x10202944
sub ecx, eax
mov dword [ebp - 0xc], 0x10202944
sar ecx, 1
push 1
mov eax, dword [eax - 0xc]
push 0x10202944
mov dword [ebp - 0x10], ecx
mov dword [ebp - 4], eax
call fcn.101e6fd0
mov dword [ebp - 8], eax
mov edx, 1
mov eax, dword [ebx + 0x620]
add esp, 8
sub edx, dword [eax - 4]
mov ecx, dword [eax - 8]
mov eax, dword [ebp - 4]
add eax, dword [ebp - 8]
sub ecx, eax
or edx, ecx
jge 0x10002ffa
push eax
lea ecx, [ebx + 0x620]
call fcn.10003310
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 4]
mov ecx, dword [ebx + 0x620]
cmp eax, edx
ja 0x10003010
lea eax, [ecx + eax*2]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 8]
add eax, eax
push eax
push dword [ebp - 0xc]
push eax
lea eax, [ecx + edx*2]
push eax
call fcn.10004510
mov eax, dword [ebx + 0x620]
add esp, 0x10
mov ecx, dword [ebp - 4]
xor edx, edx
add ecx, dword [ebp - 8]
mov dword [eax - 0xc], ecx
mov eax, dword [ebx + 0x620]
mov word [eax + ecx*2], dx
lea eax, [ebx + 0x620]
push eax
lea ecx, [ebx + 0x624]
call fcn.10002790
push 0x10202940
push str.__x86_
lea ecx, [ebx + 0x624]
call fcn.10003450
jmp 0x10003151
lea eax, [ebp - 0x10]
push str._ProgramFiles_
push eax
call fcn.10008d60
add esp, 8
lea ecx, [ebx + 0x624]
push eax
call fcn.10002790
mov edx, dword [ebp - 0x10]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x100030a5
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebx + 0x624]
call fcn.100032c0
mov eax, dword [ebx + 0x624]
mov ecx, 0x10202944
sub ecx, eax
mov dword [ebp - 0xc], 0x10202944
sar ecx, 1
push 1
mov eax, dword [eax - 0xc]
push 0x10202944
mov dword [ebp - 0x10], ecx
mov dword [ebp - 8], eax
call fcn.101e6fd0
mov dword [ebp - 4], eax
mov edx, 1
mov eax, dword [ebx + 0x624]
add esp, 8
sub edx, dword [eax - 4]
mov ecx, dword [eax - 8]
mov eax, dword [ebp - 8]
add eax, dword [ebp - 4]
sub ecx, eax
or edx, ecx
jge 0x1000310a
push eax
lea ecx, [ebx + 0x624]
call fcn.10003310
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 8]
mov ecx, dword [ebx + 0x624]
cmp eax, edx
ja 0x10003120
lea eax, [ecx + eax*2]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 4]
add eax, eax
push eax
push dword [ebp - 0xc]
push eax
lea eax, [ecx + edx*2]
push eax
call fcn.10004510
mov eax, dword [ebx + 0x624]
add esp, 0x10
mov ecx, dword [ebp - 8]
add ecx, dword [ebp - 4]
xor edx, edx
mov dword [eax - 0xc], ecx
mov eax, dword [ebx + 0x624]
mov word [eax + ecx*2], dx
lea esi, [ebx + 0x62c]
mov dword [ebx + 0x628], 1
pop edi
test esi, esi
je 0x1000316d
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret