Function at 0x405870
Capabilities:
Query or enumerate registry key

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x45e21e
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x30
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x24], edi
mov dword [ebp - 4], 0
call fcn.00415f44
xor edx, edx
mov ecx, eax
test ecx, ecx
setne dl
test edx, edx
jne 0x4058b6
push 0x80004005
call fcn.0040f420
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
xor ebx, ebx
mov dword [ebp - 0x3c], vtable.CArray_class_ATL::CStringT_wchar_t__class_StrTraitMFC_wchar_t__class_ATL::ChTraitsCRT_wchar_t_____class_ATL::CStringT_wchar_t__class_StrTraitMFC_wchar_t__class_ATL::ChTraitsCRT_wchar_t____.0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x34], ebx
mov byte [ebp - 4], 2
lea eax, [ebp + 8]
add dword [0x4835c8], 1
push 1
adc dword [0x4835cc], ebx
push ecx
mov ecx, esp
mov dword [ebp - 0x1c], 0x200
push eax
mov dword [ebp - 0x14], ebx
mov dword [0x47e094], 0x46d1a8
mov dword [ebp - 0x20], ecx
call fcn.0040ee30
mov ecx, edi
call dword [ebp + 0xc]
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x405b5c
cmp dword [edi + 0x48], 1
je 0x405b5c
push 0x20019
push eax
lea eax, [ebp - 0x14]
mov ecx, edi
push eax
lea eax, [ebp + 8]
push eax
call fcn.00405090
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x405b5c
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x200
or eax, ecx
mov dword [0x47e094], 0x46d44c
jge 0x405980
push 0x200
lea ecx, [ebp - 0x10]
call fcn.0040f040
mov esi, dword [ebp - 0x10]
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x1c]
push eax
push esi
push 0
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
mov dword [edi + 0x28], eax
push dword [esi - 8]
push esi
call fcn.00430a52
add esp, 8
test eax, eax
js 0x405ab2
cmp eax, dword [esi - 8]
jg 0x405ab2
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
mov dword [ebp - 0x20], 1
cmp dword [edi + 0x28], ecx
jne 0x405a8e
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x18]
call fcn.0040ee30
push ecx
mov ecx, esp
mov byte [ebp - 4], 3
lea eax, [ebp - 0x18]
mov dword [ebp - 0x28], ecx
push eax
call fcn.0040ee30
push ebx
lea ecx, [ebp - 0x3c]
call fcn.0040e4d0
mov byte [ebp - 4], 2
or eax, 0xffffffff
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x405a18
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 0x1c], 0x200
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x200
or eax, ecx
jge 0x405a43
push 0x200
lea ecx, [ebp - 0x10]
call fcn.0040f040
mov esi, dword [ebp - 0x10]
mov ebx, dword [ebp - 0x20]
lea eax, [ebp - 0x1c]
push 0
push 0
push 0
push 0
push eax
push esi
push ebx
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
mov dword [edi + 0x28], eax
push dword [esi - 8]
push esi
call fcn.00430a52
add esp, 8
test eax, eax
js 0x405ab2
cmp eax, dword [esi - 8]
jg 0x405ab2
xor ecx, ecx
mov dword [esi - 0xc], eax
inc ebx
mov word [esi + eax*2], cx
mov dword [ebp - 0x20], ebx
mov ebx, dword [ebp - 0x34]
cmp dword [edi + 0x28], ecx
je 0x4059d1
cmp dword [edi + 0x28], 0x103
mov eax, dword [ebp - 0x14]
je 0x405abc
test eax, eax
je 0x405aa5
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, 0x17
mov dword [ebp - 0x18], edi
jmp 0x405b5f
push 0x80070057
call fcn.0040f420
mov dword [edi + 0x28], 0
test eax, eax
je 0x405ace
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor edi, edi
test ebx, ebx
jle 0x405b50
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x18], eax
nop
push dword [ebp + 0xc]
lea eax, [ebp + 8]
mov dword [0x47e094], 0x46d1a8
push 0x46e4d0
push eax
lea eax, [ebp - 0x20]
push eax
call fcn.0040cce0
add esp, 0xc
mov ecx, eax
mov byte [ebp - 4], 4
test edi, edi
js 0x405b57
cmp edi, ebx
jge 0x405b57
push ecx
mov eax, esp
push dword [ebp - 0x18]
push ecx
push eax
call fcn.0040cdb0
mov ecx, dword [ebp - 0x24]
add esp, 0xc
call fcn.00405870
mov byte [ebp - 4], 2
or eax, 0xffffffff
mov edx, dword [ebp - 0x20]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x405b47
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add dword [ebp - 0x18], 4
inc edi
cmp edi, ebx
jl 0x405ae0
xor edi, edi
mov dword [ebp - 0x18], edi
jmp 0x405b5f
call fcn.0041618e
mov edi, dword [ebp - 0x18]
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x38]
test ecx, ecx
je 0x405ba4
xor edi, edi
test ebx, ebx
jle 0x405b98
or esi, 0xffffffff
mov edx, dword [ecx + edi*4]
mov eax, esi
sub edx, 0x10
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x405b90
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0x38]
inc edi
cmp edi, ebx
jl 0x405b73
mov esi, dword [ebp - 0x10]
push ecx
call fcn.00415c43
mov edi, dword [ebp - 0x18]
add esp, 4
or ebx, 0xffffffff
mov byte [ebp - 4], 0
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x405bc2
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x405be1
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
mov ecx, dword [ebp - 0xc]
mov eax, edi
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 8