Function at 0x401d50
Capabilities:
Get common file path
Query or enumerate registry key

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41560b
mov eax, dword fs:[0]
push eax
sub esp, 0xa9c
mov eax, dword [0x41d174]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor eax, eax
push 0x206
mov esi, ecx
push eax
lea ecx, [ebp - 0x46e]
push ecx
mov word [ebp - 0x470], ax
call fcn.004068d0
xor edx, edx
push 0x206
push edx
lea eax, [ebp - 0xa86]
push eax
mov word [ebp - 0xa88], dx
call fcn.004068d0
add esp, 0x18
push 0x104
lea ecx, [ebp - 0x470]
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push 0x104
lea edx, [ebp - 0xa88]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov ecx, 0x41e378
call fcn.00402fd0
mov edi, eax
cmp word [edi], 0
je 0x401f2e
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x266]
push ecx
mov word [ebp - 0x268], ax
call fcn.004068d0
push 0x2a
push edi
call fcn.00407008
add esp, 0x14
mov dword [ebp - 0xaa0], eax
test eax, eax
je 0x401e28
xor edx, edx
mov word [eax], dx
push 8
push str._WINDIR_
push edi
call fcn.00407334
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpynW]
add esp, 0xc
test eax, eax
jne 0x401e77
push 0x104
lea eax, [ebp - 0x470]
push eax
lea ecx, [ebp - 0x268]
push ecx
call ebx
lea edx, [edi + 0x10]
push edx
lea eax, [ebp - 0x268]
push eax
push str._s_s
mov ecx, eax
push 0x103
push ecx
call fcn.00406e9a
add esp, 0x14
push 8
push str._SYSDIR_
push edi
call fcn.00407334
add esp, 0xc
test eax, eax
push 0x104
lea eax, [ebp - 0x268]
jne 0x401ec2
lea edx, [ebp - 0xa88]
push edx
push eax
call ebx
add edi, 0x10
push edi
lea ecx, [ebp - 0x268]
push ecx
push str._s_s
mov edx, ecx
push 0x103
push edx
call fcn.00406e9a
add esp, 0x14
jmp 0x401ec6
push edi
push eax
call ebx
lea eax, [esi + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 4]
mov ecx, dword [eax + 4]
imul ecx, ecx, 0x210
lea edi, [ecx + eax + 8]
push 0x104
lea edx, [ebp - 0x268]
push edx
lea eax, [edi + 8]
push eax
mov dword [edi], 0x210
call ebx
mov dword [edi + 4], 0
mov eax, dword [esi + 4]
inc dword [eax + 4]
lea eax, [esi + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [ebp - 0xaa0]
test edi, edi
je 0x401f34
mov ecx, 0x2a
mov word [edi], cx
add edi, 2
cmp word [edi], 0
jne 0x401df3
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpynW]
xor edx, edx
push 0x206
push edx
lea eax, [ebp - 0x87e]
push eax
mov dword [ebp - 0xa9c], 0
mov word [ebp - 0x880], dx
call fcn.004068d0
push 0x206
xor edi, edi
lea edx, [ebp - 0x676]
xor ecx, ecx
push edi
push edx
mov word [ebp - 0x678], cx
call fcn.004068d0
add esp, 0x18
push 0x104
push 0x417650
call fcn.004046e0
add esp, 4
push eax
lea eax, [ebp - 0x880]
push eax
call ebx
mov edx, dword [0x417d7c]
mov ecx, dword [0x417d78]
mov eax, dword [0x417d80]
mov dword [ebp - 0xa94], edx
mov dword [ebp - 0xa98], ecx
mov ecx, dword [0x417d84]
lea edx, [ebp - 0xaa8]
push edx
mov dword [ebp - 0xa90], eax
mov dword [ebp - 0xa8c], ecx
call fcn.00404160
add esp, 4
mov eax, dword [ebp - 0xaa8]
mov dword [ebp - 4], edi
cmp eax, edi
je 0x401ff7
push eax
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov edi, eax
test edi, edi
jne 0x401ff7
push 0x8007000e
call fcn.00401b50
lea eax, [ebp - 0xa98]
push eax
push edi
call dword [sym.imp.ole32.dll_CLSIDFromString]
push edi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
lea ecx, [ebp - 0xa98]
push 0x104
push ecx
call fcn.004046e0
add esp, 4
push eax
lea edx, [ebp - 0x678]
push edx
call ebx
mov ecx, 0x41e368
call fcn.00402fd0
lea ecx, [ebp - 0xa9c]
push ecx
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
xor edx, edx
push 0x4e
push edx
lea eax, [ebp - 0x5e]
push eax
mov dword [ebp - 0xaa0], 0
mov word [ebp - 0x60], dx
call fcn.004068d0
mov eax, dword [ebp - 0xa9c]
add esp, 0xc
push 0
push 0
push 0
push 0
lea ecx, [ebp - 0xaa4]
push ecx
lea edx, [ebp - 0x60]
push edx
push 0
push eax
mov dword [ebp - 0xaa4], 0x28
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x40222d
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x266]
push edx
mov word [ebp - 0x268], cx
call fcn.004068d0
lea eax, [ebp - 0x880]
push eax
lea ecx, [ebp - 0x60]
push ecx
call fcn.004071b9
add esp, 0x14
test eax, eax
je 0x4021dd
lea edx, [ebp - 0x678]
push edx
lea eax, [ebp - 0x60]
push eax
call fcn.004071b9
add esp, 8
test eax, eax
je 0x4021dd
lea ecx, [ebp - 0x268]
push ecx
lea edx, [ebp - 0x60]
push edx
call fcn.00401c60
add esp, 8
test eax, eax
je 0x4021dd
push 0x104
lea eax, [ebp - 0x268]
push eax
mov ecx, eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x4021dd
mov ecx, 0x41e358
call fcn.00402fd0
push eax
lea edx, [ebp - 0x268]
push edx
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
test eax, eax
je 0x4021dd
lea ebx, [esi + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 4]
mov ecx, dword [eax + 4]
imul ecx, ecx, 0x210
lea edi, [ecx + eax + 8]
push 0x104
lea edx, [ebp - 0x268]
push edx
lea eax, [edi + 8]
push eax
mov dword [edi], 0x210
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
mov ecx, 1
mov dword [edi + 4], ecx
mov eax, dword [esi + 4]
add dword [eax + 4], ecx
push 0x104
lea ecx, [ebp - 0x268]
push ecx
mov edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetShortPathNameW]
mov eax, dword [esi + 4]
mov ecx, dword [eax + 4]
imul ecx, ecx, 0x210
lea edi, [ecx + eax + 8]
push 0x104
lea edx, [ebp - 0x268]
push edx
lea eax, [edi + 8]
push eax
mov dword [edi], 0x210
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
mov ecx, 1
mov dword [edi + 4], ecx
mov eax, dword [esi + 4]
add dword [eax + 4], ecx
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0x50
lea ecx, [ebp - 0x60]
push 0
push ecx
mov dword [ebp - 0xaa4], 0x28
call fcn.004068d0
mov eax, dword [ebp - 0xaa0]
add esp, 0xc
push 0
push 0
push 0
push 0
lea edx, [ebp - 0xaa4]
push edx
mov edx, dword [ebp - 0xa9c]
lea ecx, [ebp - 0x60]
inc eax
push ecx
push eax
push edx
mov dword [ebp - 0xaa0], eax
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
je 0x40209a
mov eax, dword [ebp - 0xa9c]
test eax, eax
je 0x40223e
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0xaa8]
lea ecx, [eax - 0xc]
mov dword [ebp - 4], 0xffffffff
cmp ecx, dword [0x41d010]
je 0x402276
add eax, 0xfffffff4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x402276
mov edx, dword [ebp - 0xaa8]
add edx, 0xfffffff4
push edx
call fcn.00407244
add esp, 4
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004068b9
mov esp, ebp
pop ebp
ret