Function at 0x405820
Capabilities:
Query or enumerate registry key

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x34
mov dword [ebp - 0x24], ecx
mov eax, edx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x10], 0
test ecx, ecx
je 0x405b3f
test eax, eax
je 0x405b3f
mov eax, dword [ebp + 8]
test eax, eax
je 0x405b3f
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x405b3f
push esi
mov dword [ecx], 0xffffffff
mov esi, dword [eax]
lea eax, [ebp - 0x10]
push eax
push 0x20019
push 0
push 0x401130
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4084b7
push ebx
push edi
push 0x200
call dword [sym.imp.msvcrt.dll____U_YAPAXI_Z]
mov edi, eax
add esp, 4
test edi, edi
je 0x405b3b
xor ebx, ebx
mov dword [ebp - 0x18], 0
lea eax, [ebp - 0x34]
mov dword [ebp - 0xc], 0x100
push eax
push ebx
push ebx
push ebx
lea eax, [ebp - 0xc]
push eax
push edi
push ebx
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
mov dword [ebp - 0x14], 1
cmp eax, 0x103
je 0x40859d
jmp 0x4058e0
test eax, eax
jne 0x408587
mov ecx, edi
mov dword [ebp - 8], eax
call fcn.004068b0
test al, al
jne 0x405a69
lea eax, [ebp - 0x28]
test eax, eax
je 0x405a69
lea eax, [ebp - 0x2c]
test eax, eax
je 0x405a69
push 0x2e
push edi
call dword [sym.imp.msvcrt.dll_wcschr]
push 0
push edi
mov dword [ebp - 0x1c], eax
call dword [sym.imp.msvcrt.dll_wcschr]
mov esi, eax
add esp, 0x10
test esi, esi
je 0x405a69
cmp dword [ebp - 0x1c], 0
jne 0x405a69
movzx eax, word [esi]
mov ecx, edi
mov byte [ebp - 1], 1
cmp eax, 0x30
jae 0x408508
xor eax, eax
cmp ax, word [edi]
je 0x405b27
cmp edi, esi
jae 0x405b27
cmp word [ecx], 0x30
je 0x408516
mov eax, esi
sub eax, ecx
and eax, 0xfffffffe
cmp eax, 0x14
jg 0x405b27
push 0xa
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0
push eax
push ecx
call dword [sym.imp.msvcrt.dll_wcstoul]
add esp, 0xc
cmp esi, dword [ebp - 0x1c]
jne 0x405b27
cmp eax, 0x7fffffff
ja 0x405b27
mov cl, byte [ebp - 1]
test cl, cl
je 0x405a69
cmp eax, dword [ebp - 0x18]
jle 0x405a69
mov esi, dword [ebp - 0xc]
inc esi
mov dword [ebp - 0x18], eax
test ebx, ebx
jne 0x405b18
xor ecx, ecx
mov eax, esi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call dword [sym.imp.msvcrt.dll____U_YAPAXI_Z]
mov ebx, eax
add esp, 4
mov dword [ebp - 0x1c], ebx
test ebx, ebx
je 0x405b3b
xor eax, eax
test esi, esi
je 0x405b31
cmp esi, 0x7fffffff
ja 0x405b31
test eax, eax
js 0x408533
mov dword [ebp - 8], 0
mov ecx, ebx
test esi, esi
je 0x408526
mov edx, SysReAllocString
mov ebx, edi
sub edx, esi
sub ebx, dword [ebp - 0x1c]
lea ecx, [ecx]
lea eax, [edx + esi]
test eax, eax
je 0x405a4e
movzx eax, word [ebx + ecx]
test ax, ax
je 0x405a4e
mov word [ecx], ax
add ecx, 2
dec esi
jne 0x405a30
jmp 0x408526
test esi, esi
je 0x408526
mov eax, dword [ebp - 8]
mov ebx, dword [ebp - 0x1c]
xor edx, edx
mov word [ecx], dx
test eax, eax
js 0x405b3b
lea eax, [ebp - 0x34]
mov dword [ebp - 0xc], 0x100
push eax
push 0
push 0
push 0
lea eax, [ebp - 0xc]
push eax
push edi
push dword [ebp - 0x14]
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
inc dword [ebp - 0x14]
cmp eax, 0x103
jne 0x4058e0
test ebx, ebx
je 0x40859d
mov esi, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x18]
push ebx
mov dword [esi], ebx
mov ebx, dword [ebp - 0x20]
mov dword [eax], ecx
lea eax, [ebp - 0x1c]
push 0x17
push eax
push ebx
push 0x4011c0
call fcn.004068d0
add esp, 0x14
test al, al
je 0x405b3b
push dword [ebp - 0x24]
mov eax, dword [esi]
mov esi, dword [ebx]
mov bl, 1
push 0x20019
push 0
push esi
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x20], eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x408545
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x405aff
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test edi, edi
je 0x405b0d
push edi
call dword [sym.imp.msvcrt.dll____V_YAXPAX_Z]
add esp, 4
pop edi
mov al, bl
pop ebx
pop esi
mov esp, ebp
pop ebp
ret 8
push ebx
call dword [sym.imp.msvcrt.dll____V_YAXPAX_Z]
add esp, 4
jmp 0x4059c9
mov eax, dword [ebp - 8]
xor cl, cl
jmp 0x4059a9
mov eax, 0x80070057
jmp 0x405a08
xor bl, bl
jmp 0x405af1
xor al, al
mov esp, ebp
pop ebp
ret 8
cmp eax, 2
jne 0x4084f0
test esi, esi
jne 0x4084d7
push 0x401130
push 0x1e
push esi
call fcn.0040948b
add esp, 0xc
xor al, al
jmp 0x405b11
push esi
push 0x401130
push 0x27
push 0
call fcn.0040948b
add esp, 0x10
xor al, al
jmp 0x405b11
push 0x401130
mov edx, 0x14
mov ecx, eax
call fcn.00409445
xor al, al
jmp 0x405b11
cmp eax, 0x39
jbe 0x405b27
jmp 0x40594e
add ecx, 2
cmp ecx, esi
jb 0x405961
jmp 0x40596b
sub ecx, 2
mov eax, 0x8007007a
jmp 0x405a59
test esi, esi
je 0x405a61
xor ecx, ecx
mov word [ebx], cx
jmp 0x405a61
cmp eax, 2
jne 0x408575
mov eax, dword [ebp - 0x20]
test eax, eax
jne 0x408562
push esi
push 0x1e
push eax
call fcn.0040948b
add esp, 0xc
jmp 0x405b3b
push eax
push esi
push 0x27
push 0
call fcn.0040948b
add esp, 0x10
jmp 0x405b3b
push esi
mov edx, 0x14
mov ecx, eax
call fcn.00409445
jmp 0x405b3b
push 0x401130
mov edx, 0x13
mov ecx, eax
call fcn.00409445
jmp 0x405b3b
push 0x1d
push 0
call fcn.0040948b
add esp, 8
jmp 0x405b3b