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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41705b
mov eax, dword fs:[0]
push eax
sub esp, 0xa9c
mov eax, dword [0x41f19c]
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.004072b0
xor edx, edx
push 0x206
push edx
lea eax, [ebp - 0xa86]
push eax
mov word [ebp - 0xa88], dx
call fcn.004072b0
push str.CTBHGlobal2::InitDefModulesList___Entering...
call fcn.00402fa0
add esp, 0x1c
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, 0x4203b8
call fcn.00403520
mov edi, eax
cmp word [edi], 0
je 0x401f58
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x266]
push ecx
mov word [ebp - 0x268], ax
call fcn.004072b0
push 0x2a
push edi
call fcn.004079e7
add esp, 0x14
mov dword [ebp - 0xaa0], eax
test eax, eax
je 0x401e52
xor edx, edx
mov word [eax], dx
push 8
push str._WINDIR_
push edi
call fcn.00407d13
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpynW]
add esp, 0xc
test eax, eax
jne 0x401ea1
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 0x419e4c
mov ecx, eax
push 0x103
push ecx
call fcn.0040787a
add esp, 0x14
push 8
push str._SYSDIR_
push edi
call fcn.00407d13
add esp, 0xc
test eax, eax
push 0x104
lea eax, [ebp - 0x268]
jne 0x401eec
lea edx, [ebp - 0xa88]
push edx
push eax
call ebx
add edi, 0x10
push edi
lea ecx, [ebp - 0x268]
push ecx
push 0x419e4c
mov edx, ecx
push 0x103
push edx
call fcn.0040787a
add esp, 0x14
jmp 0x401ef0
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 0x401f5e
mov ecx, 0x2a
mov word [edi], cx
add edi, 2
cmp word [edi], 0
jne 0x401e1d
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.004072b0
push 0x206
xor edi, edi
lea edx, [ebp - 0x676]
xor ecx, ecx
push edi
push edx
mov word [ebp - 0x678], cx
call fcn.004072b0
add esp, 0x18
push 0x104
push 0x419718
call fcn.00404c00
add esp, 4
push eax
lea eax, [ebp - 0x880]
push eax
call ebx
mov edx, dword [0x419f00]
mov ecx, dword [0x419efc]
mov eax, dword [0x419f04]
mov dword [ebp - 0xa94], edx
mov dword [ebp - 0xa98], ecx
mov ecx, dword [0x419f08]
lea edx, [ebp - 0xaa8]
push edx
mov dword [ebp - 0xa90], eax
mov dword [ebp - 0xa8c], ecx
call fcn.00404680
add esp, 4
mov eax, dword [ebp - 0xaa8]
mov dword [ebp - 4], edi
cmp eax, edi
je 0x402021
push eax
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov edi, eax
test edi, edi
jne 0x402021
push 0x8007000e
call fcn.00401b70
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.00404c00
add esp, 4
push eax
lea edx, [ebp - 0x678]
push edx
call ebx
mov ecx, 0x4203a8
call fcn.00403520
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.004072b0
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 0x402257
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x266]
push edx
mov word [ebp - 0x268], cx
call fcn.004072b0
lea eax, [ebp - 0x880]
push eax
lea ecx, [ebp - 0x60]
push ecx
call fcn.00407b98
add esp, 0x14
test eax, eax
je 0x402207
lea edx, [ebp - 0x678]
push edx
lea eax, [ebp - 0x60]
push eax
call fcn.00407b98
add esp, 8
test eax, eax
je 0x402207
lea ecx, [ebp - 0x268]
push ecx
lea edx, [ebp - 0x60]
push edx
call fcn.00401c80
add esp, 8
test eax, eax
je 0x402207
push 0x104
lea eax, [ebp - 0x268]
push eax
mov ecx, eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x402207
mov ecx, 0x420398
call fcn.00403520
push eax
lea edx, [ebp - 0x268]
push edx
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
test eax, eax
je 0x402207
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.004072b0
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 0x4020c4
mov eax, dword [ebp - 0xa9c]
test eax, eax
je 0x402268
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 [0x41f010]
je 0x4022a0
add eax, 0xfffffff4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x4022a0
mov edx, dword [ebp - 0xaa8]
add edx, 0xfffffff4
push edx
call fcn.00407c23
add esp, 4
push str.CTBHGlobal2::InitDefModulesList___Leaving...
call fcn.00402fa0
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.00407299
mov esp, ebp
pop ebp
ret