Function at 0x10051148
Capabilities:
Get common file path

Disassembly:
push ecx
mov eax, dword [esp]
mov ecx, dword [0x1005bdec]
push ebx
push esi
push edi
push 0x10028edc
xor ebx, ebx
push ebx
push 0x1f0001
lea esi, [eax + ecx + 3]
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
mov edi, 0x41d
push edi
call fcn.100519b7
mov dword [esp + 0x10], eax
mov eax, dword [0x1005bdec]
lea esi, [esi + eax - 0x166c]
push esi
call fcn.1005103e
pop ecx
pop ecx
push ebx
push 7
mov dword [0x1005bdec], eax
mov eax, dword [0x1005bd74]
push 7
push ebx
lea esi, [esi + eax - 0x166c]
call dword [sym.imp.KERNEL32.dll_CreateSemaphoreW]
mov ecx, dword [0x1005bde4]
mov eax, dword [0x1005bd78]
sub ecx, eax
add ecx, 0x50
mov dword [0x1005bdec], ecx
mov ecx, 0x1005bd94
sub dword [ecx], eax
sub ecx, 4
cmp ecx, 0x1005bd84
jg 0x100511c7
push ebp
push esi
call fcn.1005103e
pop ecx
push edi
push dword [esp + 0x14]
mov dword [0x1005bdec], eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov ecx, dword [0x1005bd78]
add ecx, eax
mov ebp, 0x1de
mov dword [0x1005bdec], eax
lea esi, [esi + ecx + 0x17]
cmp dword [0x1005bdb8], ebp
jne 0x1005121e
add eax, dword [0x1005bdb0]
mov dword [0x1005bdec], eax
lea eax, [eax + eax - 4]
mov dword [0x1005bde4], eax
push edi
push 0x1015f690
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
mov ecx, dword [0x1005bd98]
mov dword [0x1005bde4], eax
mov eax, dword [0x1005bdbc]
add ecx, eax
cmp ecx, 0x323
jne 0x10051252
mov ebx, dword [0x1005bd78]
add ebx, 0xffff5e1d
jmp 0x1005126e
mov eax, dword [0x1005bd78]
mov ecx, dword [0x1005bd8c]
lea ecx, [ecx + eax - 0x166c]
mov dword [0x1005bd8c], ecx
lea ebx, [esi + eax*2 + 0x17]
mov ecx, ebx
call fcn.10050ea4
mov dword [0x1005bdec], eax
cmp dword [0x1005bdb8], ebp
jne 0x10051291
add ebx, dword [0x1005bdb0]
lea eax, [ebx + ebx - 4]
mov dword [0x1005bdec], eax
mov ebp, 0x1693
shl eax, 4
mov ecx, ebp
push 3
sub ecx, eax
pop edx
mov dword [0x1005bd74], ecx
cmp dword [0x1005bda8], ebp
je 0x100512b4
inc edx
cmp edx, 9
jl 0x100512a6
push ecx
call fcn.1004fea1
mov edx, dword [0x1005bd78]
mov dword [0x1005bd74], eax
xor eax, eax
pop ecx
mov ecx, dword [0x1005bd98]
cmp eax, dword [0x1005bd7c]
ja 0x10051306
jb 0x100512dc
cmp ecx, edx
ja 0x10051306
mov eax, dword [0x1005bdec]
mov ecx, dword [0x1005bde4]
mov dword [0x1005bd80], eax
sub eax, edx
lea esi, [ecx + eax + 0x27]
mov eax, esi
sub eax, edx
add eax, 0x50
mov dword [0x1005bde4], esi
mov dword [0x1005bdec], eax
jmp 0x10051311
mov eax, dword [0x1005bdec]
mov esi, dword [0x1005bde4]
cmp dword [0x1005bd8c], eax
jb 0x10051329
add dword [0x1005bd8c], 0x24
lea esi, [eax + 0x20]
mov dword [0x1005bde4], esi
cmp ebx, 0x57da749
je 0x1005138c
sub edx, eax
sub edx, 0x8b77
cmp dword [0x1005bdb8], 0x1de
mov dword [0x1005bde4], edx
jne 0x1005135f
add eax, dword [0x1005bdb0]
mov dword [0x1005bdec], eax
lea eax, [eax + eax - 4]
mov dword [0x1005bde4], eax
jb 0x100513c8
add byte [eax], al
mov eax, dword [0x1005bdec]
mov edx, dword [0x1005bd78]
lea esi, [edx + eax - 4]
mov dword [0x1005bde4], esi
cmp dword [0x1005bd8c], eax
jb 0x1005138c
add dword [0x1005bd8c], edx
mov dword [0x1005bde4], esi
mov ecx, esi
imul ecx, eax
add ecx, edx
mov dword [0x1005bdec], ecx
call fcn.10050ea4
mov ecx, dword [0x1005bdec]
and dword [0x1005bd7c], 0
mov dword [0x1005bd78], eax
cmp dword [0x1005bd8c], ecx
jb 0x100513c8
add dword [0x1005bd8c], eax
lea esi, [eax + ecx - 4]
mov dword [0x1005bde4], esi
add esi, 0xffffe9bd
mov dword [0x1005bdec], esi
mov eax, 0x1005bd94
add dword [eax], 0xffffe96d
sub eax, 4
cmp eax, 0x1005bd84
jg 0x100513d9
call 0x10028f60
mov eax, dword [0x1005bde4]
mov ecx, eax
imul eax, eax, 0x1693
imul ecx, dword [0x1005bdec]
add eax, dword [0x1005bd74]
push edi
push dword [esp + 0x14]
add ecx, ebp
push 0
mov dword [0x1005bdec], ecx
mov dword [0x1005bde4], eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov ecx, dword [0x1005bdbc]
mov edx, dword [0x1005bd98]
add edx, ecx
mov ecx, dword [0x1005bde4]
mov esi, 0x323
pop ebp
cmp edx, esi
je 0x10051454
mov ebx, dword [0x1005bd8c]
mov edi, eax
sub edi, ecx
lea edi, [ebx + edi + 0x27]
mov dword [0x1005bd8c], edi
lea edi, [ecx + eax - 4]
mov dword [0x1005bdec], edi
mov edi, dword [0x1005bd74]
lea ecx, [edi + ecx - 4]
movzx ecx, cx
cmp edx, esi
jne 0x10051482
mov esi, dword [0x1005bd78]
movzx eax, cx
sub esi, eax
sub esi, 0x8b50
jmp 0x100514a3
movzx edx, cx
mov ecx, dword [0x1005bd78]
mov esi, ecx
sub esi, edx
mov edx, dword [0x1005bd8c]
lea edx, [edx + esi + 0x27]
mov dword [0x1005bd8c], edx
lea esi, [eax + ecx*2 + 0x17]
call fcn.10050f72
cmp dword [0x1005bd8c], esi
jb 0x100514bd
mov ecx, esi
shl ecx, 4
sub eax, ecx
add dword [0x1005bd8c], eax
mov eax, dword [0x1005bde4]
lea ecx, [eax + esi - 4]
mov dword [0x1005bdec], ecx
sub ecx, eax
push 3
add ecx, 0x50
pop edx
shl eax, 4
mov esi, ecx
sub esi, eax
movzx eax, word [0x1005bdd4]
pop edi
mov dword [0x1005bd74], esi
pop esi
pop ebx
cmp ecx, eax
je 0x100514f5
inc edx
cmp edx, 9
jl 0x100514eb
xor eax, eax
inc eax
pop ecx
ret 0xc