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

Disassembly:
sub esp, 0x228
push ebx
push ebp
mov ebp, dword [sym.imp.MSVCRT.dll_malloc]
push 0xc
mov byte [esp + 0xf], 0
mov dword [esp + 0x1c], 0xc
call ebp
mov ebx, eax
add esp, 4
test ebx, ebx
mov dword [esp + 0xc], ebx
je 0x406617
mov ecx, dword [esp + 0x18]
push esi
mov edx, ecx
push edi
xor eax, eax
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
lea eax, [esp + 0x20]
push eax
push ebx
push 0
push 0
push 0
push 6
call sub.DNSAPI.dll_DnsQueryConfig
mov esi, eax
cmp esi, 0xea
jne 0x4061eb
push ebx
call dword [sym.imp.MSVCRT.dll_free]
mov ecx, dword [esp + 0x24]
push ecx
call ebp
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
je 0x406568
lea edx, [esp + 0x20]
push edx
push eax
push 0
push 0
push 0
push 6
call sub.DNSAPI.dll_DnsQueryConfig
mov ebx, dword [esp + 0x14]
mov esi, eax
test esi, esi
jne 0x40656c
mov eax, dword [0x441ff4]
test eax, eax
je 0x40628c
mov ecx, dword [0x441fd4]
mov eax, dword [ecx]
cmp eax, 3
je 0x40621d
mov edx, dword [0x441fdc]
cmp dword [edx], 0
jne 0x40628c
cmp eax, 3
jle 0x40628c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call ebp
mov edi, eax
mov eax, dword [0x436030]
test eax, eax
jge 0x406242
mov eax, dword [0x441fa0]
mov dword [0x436030], eax
call fcn.0041c4b1
test eax, eax
je 0x40627e
mov ecx, dword [0x436030]
push 3
push ecx
push 0x5eb
push str.C:_build_rel_sp_8_4_6_2_srcwindows_atpclient_arr_srvsAdaptCof.cpp
call fcn.0041c4e1
mov edx, dword [ebx]
add esp, 0x10
push edx
call ebp
push eax
push str.DnsQueryConfig_SUCCESS__Error___d__dns_list__AddrCount___d_n
call fcn.0041c506
add esp, 0xc
call fcn.0041c4cc
push esi
call dword [sym.imp.WS2_32.dll_WSASetLastError]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea eax, [esp + 0x1c]
push eax
push 0xf003f
push 0
push str.SYSTEMCurrentControlSetServicesTcpipParametersInterfaces
push reloc.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x406607
mov dword [esp + 0x24], eax
mov eax, dword [ebx]
test eax, eax
jbe 0x406558
mov ebx, dword [sym.imp.WS2_32.dll_inet_ntoa]
mov al, byte [esp + 0x13]
test al, al
jne 0x406554
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x31]
mov byte [esp + 0x30], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0
push 0
push 0
lea ecx, [esp + 0x24]
push 0
lea edx, [esp + 0x40]
stosb byte es:[edi], al
mov eax, dword [esp + 0x2c]
push ecx
push edx
mov ebp, 0x104
push 0
push eax
mov dword [esp + 0x38], ebp
mov esi, 1
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
jne 0x40653d
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x28]
push ecx
push 0xf003f
lea edx, [esp + 0x38]
push 0
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4063cc
mov ecx, 0x40
lea edi, [esp + 0x135]
mov dword [esp + 0x2c], eax
mov byte [esp + 0x134], al
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0x18]
lea edx, [esp + 0x134]
stosb byte es:[edi], al
push ecx
mov ecx, dword [esp + 0x2c]
lea eax, [esp + 0x30]
push edx
push eax
push 0
push str.NameServer
push ecx
mov dword [esp + 0x30], ebp
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x4063c1
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x14]
mov ebp, dword [eax + edx*4 + 4]
push ebp
call ebx
lea ecx, [esp + 0x134]
push eax
push ecx
call dword [sym.imp.MSVCRT.dll_strstr]
add esp, 8
test eax, eax
je 0x4063bc
lea edx, [esp + 0x30]
push edx
call fcn.00405fc0
add esp, 4
test al, al
jne 0x4063fe
mov ebp, 0x104
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0
push 0
push 0
lea ecx, [esp + 0x24]
push 0
lea edx, [esp + 0x40]
mov eax, esi
push ecx
push edx
push eax
mov eax, dword [esp + 0x38]
mov dword [esp + 0x34], ebp
push eax
inc esi
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
test eax, eax
je 0x40631a
jmp 0x40653d
mov edx, dword [esp + 0x23c]
test edx, edx
je 0x40642a
lea edi, [esp + 0x30]
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, 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 edx, dword [esp + 0x240]
test edx, edx
je 0x406459
lea edi, [esp + 0x134]
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, 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 eax, dword [esp + 0x244]
test eax, eax
je 0x40648b
push ebp
call ebx
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, dword [esp + 0x244]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x441ff4]
test eax, eax
je 0x40652d
mov eax, dword [0x441fd4]
mov eax, dword [eax]
cmp eax, 3
je 0x4064b4
mov ecx, dword [0x441fdc]
cmp dword [ecx], 0
jne 0x40652d
cmp eax, 3
jle 0x40652d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, dword [0x436030]
test eax, eax
jge 0x4064d9
mov edx, dword [0x441fa0]
mov dword [0x436030], edx
call fcn.0041c4b1
test eax, eax
je 0x40651f
mov eax, dword [0x436030]
push 3
push eax
push 0x613
push str.C:_build_rel_sp_8_4_6_2_srcwindows_atpclient_arr_srvsAdaptCof.cpp
call fcn.0041c4e1
add esp, 0x10
push ebp
call ebx
lea ecx, [esp + 0x134]
push eax
lea edx, [esp + 0x34]
push ecx
push edx
push str.key_name___s__old_dns___s__old_dns_first___s_n
call fcn.0041c506
add esp, 0x10
call fcn.0041c4cc
push esi
call dword [sym.imp.WS2_32.dll_WSASetLastError]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov byte [esp + 0x13], 1
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
inc eax
mov edx, dword [ecx]
mov dword [esp + 0x24], eax
cmp eax, edx
jb 0x4062c4
mov ebx, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x406607
mov ebx, dword [esp + 0x14]
mov eax, dword [0x441ff4]
test eax, eax
je 0x406607
mov eax, dword [0x441fd4]
mov eax, dword [eax]
cmp eax, 1
je 0x406595
mov ecx, dword [0x441fdc]
cmp dword [ecx], 0
jne 0x406607
cmp eax, 1
jle 0x406607
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
call edi
mov ebx, eax
mov eax, dword [0x436030]
test eax, eax
jge 0x4065bc
mov edx, dword [0x441fa0]
mov dword [0x436030], edx
call fcn.0041c4b1
test eax, eax
je 0x4065f5
mov eax, dword [0x436030]
push 1
push eax
push 0x62a
push str.C:_build_rel_sp_8_4_6_2_srcwindows_atpclient_arr_srvsAdaptCof.cpp
call fcn.0041c4e1
add esp, 0x10
push esi
call edi
push eax
push str.DnsQueryConfig_fail__Error___d__dns_query_ret___d_n
call fcn.0041c506
add esp, 0xc
call fcn.0041c4cc
push ebp
call dword [sym.imp.WS2_32.dll_WSASetLastError]
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [esp + 0x14]
pop edi
pop esi
test ebx, ebx
je 0x406617
push ebx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov al, byte [esp + 0xb]
pop ebp
pop ebx
add esp, 0x228
ret