Function at 0x409940
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x854
mov esi, edx
mov ebx, ecx
mov dword [ebp - 0x60], 1
mov dword [ebp - 0x5c], edx
lea edi, [ebp - 0x860]
mov dword [ebp - 0x50], edi
mov dword [ebp - 0x4c], 0x400
lea eax, [ebp - 0x60]
push eax
push 0
push 0x113e
push ecx
call dword [sym.imp.user32.dll_SendMessageW]
xor ecx, ecx
test eax, eax
je 0x409b70
mov eax, dword [ebp + 0xc]
test al, 2
je 0x4099d0
test al, 1
jne 0x4099ba
push dword [ebp + 8]
push edi
call dword [sym.imp.shlwapi.dll_StrStrIW]
test eax, eax
mov eax, dword [ebp + 0xc]
mov ecx, 0
je 0x4099d0
mov eax, dword [ebp + 0x10]
mov dword [eax], 0xffffffff
mov ecx, 1
jmp 0x409b70
push dword [ebp + 8]
push edi
call dword [sym.imp.kernel32.dll_lstrcmpiW]
test eax, eax
mov eax, dword [ebp + 0xc]
mov ecx, 0
je 0x4099a7
test al, 0xc
je 0x409b70
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0x400
test esi, esi
jne 0x409a04
push 0
push 9
push 0x110a
push ebx
call dword [sym.imp.user32.dll_SendMessageW]
mov esi, eax
test eax, eax
je 0x409b6e
push 0x800
call dword [sym.imp.ucrtbase.dll_malloc]
add esp, 4
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x409b6e
mov word [eax], 0
lea edx, [ebp - 0x20]
lea eax, [ebp - 0x24]
lea edi, [ebp - 0x38]
mov ecx, ebx
mov ebx, edx
mov edx, esi
push ebx
push eax
lea eax, [ebp - 0x2c]
push eax
push edi
call sym._get_item_path
add esp, 0x10
mov edi, dword [ebp - 0x2c]
test eax, eax
je 0x409b64
xor ecx, ecx
test edi, edi
je 0x409b70
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x409b70
lea ecx, [ebp - 0x14]
push ecx
push 0x20019
push 0
push edi
push eax
call dword [sym.imp.advapi32.dll_RegOpenKeyExW]
mov esi, eax
push edi
call dword [sym.imp.ucrtbase.dll_free]
add esp, 4
test esi, esi
jne 0x409b6e
lea eax, [ebp - 0x34]
lea ecx, [ebp - 0x1c]
push 0
push 0
push eax
push ecx
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push dword [ebp - 0x14]
call dword [sym.imp.advapi32.dll_RegQueryInfoKeyW]
test eax, eax
mov ecx, 0
jne 0x409b70
mov eax, dword [ebp - 0x1c]
lea ecx, [eax + 1]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x10], ecx
lea eax, [eax*2 + 2]
push eax
call dword [sym.imp.ucrtbase.dll_malloc]
add esp, 4
mov edi, eax
lea eax, [ebp - 0x10]
push 0
push 0
push 0
push 0
push eax
push edi
push 0
push dword [ebp - 0x14]
call dword [sym.imp.advapi32.dll_RegEnumValueW]
mov dword [ebp - 0x18], 0
mov ecx, 0
test eax, eax
jne 0x409b07
xor ecx, ecx
cmp word [edi], 0
setne cl
mov eax, dword [ebp + 0x10]
mov esi, dword [eax]
mov dword [ebp - 0x30], ecx
sub esi, ecx
test esi, esi
jg 0x409b17
xor esi, esi
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
push 0
push 0
push ebx
push 0
lea eax, [ebp - 0x10]
push eax
push edi
push esi
push dword [ebp - 0x14]
call dword [sym.imp.advapi32.dll_RegEnumValueW]
test eax, eax
je 0x409b7d
mov esi, dword [sym.imp.ucrtbase.dll_free]
push edi
call esi
add esp, 4
push dword [ebp - 0x18]
call esi
add esp, 4
push dword [ebp - 0x14]
call dword [sym.imp.advapi32.dll_RegCloseKey]
jmp 0x409b6e
push edi
call dword [sym.imp.ucrtbase.dll_free]
add esp, 4
xor ecx, ecx
mov eax, ecx
add esp, 0x854
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x28], edi
jmp 0x409bb8
inc esi
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
push 0
push 0
push ebx
push 0
lea eax, [ebp - 0x10]
push eax
push edi
push esi
push dword [ebp - 0x14]
call dword [sym.imp.advapi32.dll_RegEnumValueW]
test eax, eax
jne 0x409b45
mov eax, dword [ebp + 0xc]
test al, 4
je 0x409be7
test al, 1
jne 0x409bd6
push dword [ebp + 8]
push edi
call dword [sym.imp.shlwapi.dll_StrStrIW]
test eax, eax
mov eax, dword [ebp + 0xc]
je 0x409be7
jmp 0x409c51
push dword [ebp + 8]
push edi
call dword [sym.imp.kernel32.dll_lstrcmpiW]
test eax, eax
mov eax, dword [ebp + 0xc]
je 0x409c51
test al, 8
je 0x409b89
mov eax, dword [ebp - 0x20]
dec eax
cmp eax, 1
ja 0x409b89
mov ebx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x18]
test ecx, ecx
jne 0x409c0a
push ebx
call dword [sym.imp.ucrtbase.dll_malloc]
add esp, 4
mov ecx, eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x24], ebx
lea eax, [ebp - 0x24]
push eax
push ecx
lea ebx, [ebp - 0x20]
push ebx
push 0
lea eax, [ebp - 0x10]
push eax
push edi
push esi
push dword [ebp - 0x14]
mov edi, ecx
call dword [sym.imp.advapi32.dll_RegEnumValueW]
test eax, eax
mov dword [ebp - 0x18], edi
jne 0x409c82
mov ecx, edi
mov edx, dword [ebp + 8]
push dword [ebp + 0xc]
call sym._match_string
add esp, 4
test eax, eax
mov edi, dword [ebp - 0x28]
je 0x409b89
mov ebx, dword [sym.imp.ucrtbase.dll_free]
push edi
call ebx
add esp, 4
push dword [ebp - 0x18]
call ebx
add esp, 4
push dword [ebp - 0x14]
call dword [sym.imp.advapi32.dll_RegCloseKey]
mov ecx, dword [ebp - 0x30]
add ecx, esi
mov eax, dword [ebp + 0x10]
mov dword [eax], ecx
mov ecx, 1
jmp 0x409b70
mov edi, dword [ebp - 0x28]
jmp 0x409b45