Function at 0x402270
Capabilities:
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
sub esp, 0x334
push ebx
push ebp
push esi
mov ebp, ecx
push edi
xor ebx, ebx
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x39]
mov byte [esp + 0x38], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0xb
mov esi, 0x4178c4
lea edi, [esp + 0x13c]
xor eax, eax
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov ecx, 0x35
lea edi, [esp + 0x16a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [esp + 0x14]
lea ecx, [esp + 0x13c]
push eax
push ecx
push 0x80000002
mov dword [esp + 0x20], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x24], 0x104
mov dword [esp + 0x1c], ebx
mov dword [ebp + 0x24], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
jne 0x402517
push ebx
push ebx
mov eax, dword [esp + 0x1c]
push ebx
push ebx
push ebx
push ebx
lea edx, [esp + 0x28]
push ebx
push edx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyA]
cmp eax, ebx
jne 0x40250c
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x40250c
cmp eax, 7
jbe 0x40232c
mov eax, 7
mov dword [esp + 0x10], eax
mov ecx, dword [ebp + 0x20]
cmp ecx, ebx
je 0x40233e
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [esp + 0x10]
mov ecx, eax
mov dword [ebp + 0x20], ebx
shl ecx, 6
add ecx, eax
shl ecx, 2
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp eax, ebx
mov dword [ebp + 0x20], eax
jne 0x402373
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x334
ret
mov eax, dword [esp + 0x10]
mov edi, 0x104
mov esi, edi
mov dword [ebp + 0x24], eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x1c], esi
jmp 0x40238f
mov esi, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
push ebx
push ebx
push ebx
lea ecx, [esp + 0x24]
push ebx
lea edx, [esp + 0x48]
push ecx
mov ecx, dword [esp + 0x28]
push edx
push eax
push ecx
mov dword [esp + 0x38], edi
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
cmp eax, ebx
mov dword [esp + 0x2c], eax
jne 0x4024ab
cmp dword [esp + 0x18], edi
jae 0x4024ab
lea edx, [esp + 0x38]
lea eax, [esp + 0x13c]
push edx
push eax
lea ecx, [esp + 0x248]
push 0x4170c8
push ecx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], 4
mov dword [esp + 0x38], 0x64
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x10
lea edx, [esp + 0x20]
lea eax, [esp + 0x240]
push edx
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x402445
lea ecx, [esp + 0x34]
lea edx, [esp + 0x28]
push ecx
lea ecx, [esp + 0x34]
push edx
push ecx
push ebx
push 0x4178bc
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edx, dword [esp + 0x20]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [esp + 0x28], ebx
jne 0x402474
lea edi, [esp + 0x38]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, dword [ebp + 0x20]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x104
jmp 0x4024ab
cmp esi, 0x71c
jge 0x4024a7
mov edx, dword [ebp + 0x20]
lea edi, [esp + 0x38]
or ecx, 0xffffffff
xor eax, eax
add edx, esi
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x104
add dword [esp + 0x1c], edi
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x2c]
inc ecx
cmp eax, ebx
mov dword [esp + 0x24], ecx
je 0x40238b
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x10]
xor esi, esi
cmp eax, ebx
jbe 0x4024fc
mov ebx, dword [sym.imp.MSVCRT.dll_printf]
xor edi, edi
mov edx, dword [ebp + 0x20]
add edx, edi
push edx
push 0x4178b4
call ebx
mov eax, dword [esp + 0x18]
add esp, 8
inc esi
add edi, 0x104
cmp esi, eax
jb 0x4024dd
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x334
ret
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x334
ret