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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40c748
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x144
push ebx
push esi
push edi
xor edi, edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x40], edi
mov dword [ebp - 4], edi
mov ebx, 0x80
mov esi, dword [ebp + 8]
push 0
push 0
push 0
lea ecx, [ebp - 0x14]
push 0
lea edx, [ebp - 0x150]
mov eax, edi
push ecx
push edx
inc edi
push eax
push esi
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x4c], edi
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
jne 0x402555
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
push eax
push 0x20019
lea ecx, [ebp - 0x150]
push 0
push ecx
push esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x4022f0
push str.Could_not_read_from_HKLMEnum..._
lea ecx, [ebp + 0x10]
call fcn.0040bfa2
lea edx, [ebp - 0x150]
mov byte [ebp - 4], 1
push edx
push eax
lea eax, [ebp - 0x44]
push eax
call sub.MFC42.DLL_operator
lea ecx, [ebp - 0x44]
push 0x40ea18
push ecx
call sub.MSVCRT.dll__CxxThrowException
mov ecx, dword [ebp - 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea edx, [ebp - 0x14]
lea eax, [ebp - 0xd0]
push edx
push eax
push 0
push 0
push str.PORTNAME
push ecx
mov dword [ebp - 0x14], ebx
call esi
test eax, eax
jne 0x40251a
lea edx, [ebp - 0xd0]
lea ecx, [ebp - 0x1c]
push edx
call fcn.0040bfa2
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 2
call sub.MFC42.DLL_CString::CString_2
mov edx, dword [ebp - 0x18]
lea eax, [ebp - 0x14]
lea ecx, [ebp - 0xd0]
push eax
xor edi, edi
push ecx
push edi
push edi
push str.FRIENDLYNAME
push edx
mov byte [ebp - 4], 3
mov dword [ebp - 0x14], ebx
call esi
test eax, eax
jne 0x40236a
lea eax, [ebp - 0xd0]
lea ecx, [ebp - 0x34]
push eax
call sub.MFC42.DLL_CString::operator
lea ecx, [ebp - 0x30]
call sub.MFC42.DLL_CString::CString_2
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 4
call sub.MFC42.DLL_CString::CString_2
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 5
call sub.MFC42.DLL_CString::CString_2
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 6
mov dword [ebp - 0x24], edi
call sub.MFC42.DLL_CString::CString_2
push str.._
lea ecx, [ebp - 0x38]
mov byte [ebp - 4], 7
call fcn.0040bfa2
lea ecx, [ebp - 0x1c]
lea edx, [ebp - 0x48]
push ecx
push eax
push edx
mov byte [ebp - 4], 8
call sub.MFC42.DLL_operator_1
push eax
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 9
call sub.MFC42.DLL_CString::operator_1
lea ecx, [ebp - 0x48]
mov byte [ebp - 4], 8
call fcn.0040bf60
lea ecx, [ebp - 0x38]
mov byte [ebp - 4], 7
call fcn.0040bf60
lea eax, [ebp - 0x1c]
lea ecx, [ebp - 0x2c]
push eax
call sub.MFC42.DLL_CString::operator_1
lea ecx, [ebp - 0x34]
push ecx
lea ecx, [ebp - 0x28]
call sub.MFC42.DLL_CString::operator_1
mov edx, dword [ebp + 0xc]
xor ebx, ebx
mov dword [ebp - 0x24], edx
mov ecx, dword [ebp + 0x10]
cmp edi, dword [ecx + 8]
jge 0x402477
test ebx, ebx
jne 0x4024ca
mov eax, dword [ecx + 4]
mov ecx, dword [ebp - 0x1c]
lea esi, [edi + edi*4]
push ecx
shl esi, 2
lea eax, [esi + eax + 4]
mov eax, dword [eax]
push eax
call dword [sym.imp.MSVCRT.dll__mbscmp]
add esp, 8
test eax, eax
jne 0x402474
mov edx, dword [ebp + 0x10]
mov ebx, 1
mov eax, dword [edx + 4]
add esi, eax
lea eax, [ebp - 0x30]
push eax
mov ecx, esi
call sub.MFC42.DLL_CString::operator_1
lea ecx, [ebp - 0x2c]
push ecx
lea ecx, [esi + 4]
call sub.MFC42.DLL_CString::operator_1
lea edx, [ebp - 0x28]
lea ecx, [esi + 8]
push edx
call sub.MFC42.DLL_CString::operator_1
mov eax, dword [ebp - 0x24]
lea ecx, [ebp - 0x20]
push ecx
lea ecx, [esi + 0x10]
mov dword [esi + 0xc], eax
call sub.MFC42.DLL_CString::operator_1
inc edi
jmp 0x402401
test ebx, ebx
jne 0x4024ca
mov esi, dword [ecx + 8]
push 0xffffffffffffffff
lea edx, [esi + 1]
push edx
call fcn.00402570
mov ecx, dword [ebp + 0x10]
lea eax, [esi + esi*4]
mov edx, dword [ecx + 4]
lea esi, [edx + eax*4]
lea eax, [ebp - 0x30]
push eax
mov ecx, esi
call sub.MFC42.DLL_CString::operator_1
lea ecx, [ebp - 0x2c]
push ecx
lea ecx, [esi + 4]
call sub.MFC42.DLL_CString::operator_1
lea edx, [ebp - 0x28]
lea ecx, [esi + 8]
push edx
call sub.MFC42.DLL_CString::operator_1
mov eax, dword [ebp - 0x24]
lea ecx, [ebp - 0x20]
push ecx
lea ecx, [esi + 0x10]
mov dword [esi + 0xc], eax
call sub.MFC42.DLL_CString::operator_1
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 0xc
call fcn.0040bf60
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 0xb
call fcn.0040bf60
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 0xa
call fcn.0040bf60
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 3
call fcn.0040bf60
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 2
call fcn.0040bf60
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 0
call fcn.0040bf60
mov edi, dword [ebp - 0x4c]
mov ebx, 0x80
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x402271
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret