Function at 0x406640
Capabilities:
Query or enumerate registry value

Disassembly:
sub esp, 0x8d4
mov eax, dword [esp + 0x8dc]
push ebx
push ebp
push esi
mov ebp, dword [eax]
mov ecx, dword [esp + 0x8e4]
lea edx, [esp + 0x24]
push edi
lea eax, [esp + 0x10]
xor ebx, ebx
push edx
push eax
push ebx
push 0x2001f
push ebx
push ebx
push ebx
push str.SOFTWAREMicrosoftMSSQLServerMSSQLServer
push 0x80000002
mov dword [esp + 0x34], ebx
mov dword [esp + 0x40], ebx
xor esi, esi
mov dword [ecx], ebx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x4069af
lea ecx, [esp + 0x24]
lea edx, [esp + 0x4e4]
push ecx
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x30]
push edx
push eax
push ebx
push str.ListenOn
push ecx
mov dword [esp + 0x3c], 0x400
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x4066d8
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8d4
ret
mov edx, dword [0x40e224]
mov edi, dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [esp + 0xbc]
push 0x28
push ecx
lea eax, [esp + 0x4ec]
push 0x48
push edx
mov dword [esp + 0x28], eax
call edi
mov ecx, dword [0x40e224]
lea eax, [esp + 0x94]
push 0x28
push eax
push 0x47
push ecx
call edi
lea edx, [esp + 0x4e4]
lea eax, [esp + 0x30]
push edx
push 0x40b2bc
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
cmp eax, ebx
je 0x4069a4
mov ecx, dword [esp + 0x18]
cmp ebp, ebx
lea edx, [ecx + eax + 1]
mov dword [esp + 0x18], edx
jne 0x406777
push 0x328
call fcn.00407340
mov ebp, eax
add esp, 4
mov byte [ebp], bl
mov byte [ebp + 0x100], bl
mov byte [ebp + 0x120], bl
mov word [ebp + 0x320], bx
mov byte [ebp + 0x220], bl
mov dword [ebp + 0x324], ebx
cmp esi, ebx
je 0x406783
mov dword [esi + 0x324], ebp
jmp 0x40678c
mov eax, dword [esp + 0x8ec]
mov dword [eax], ebp
mov cl, byte [esp + 0x30]
lea eax, [esp + 0x30]
cmp cl, bl
mov dword [esp + 0x20], ebx
je 0x4067b2
cmp cl, 0x2c
je 0x4067ab
mov cl, byte [eax + 1]
inc eax
cmp cl, bl
jne 0x40679c
jmp 0x4067b2
mov byte [eax], bl
inc eax
mov dword [esp + 0x20], eax
lea edi, [esp + 0x30]
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp + 0x100]
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
lea eax, [esp + 0xbc]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea esi, [esp + 0x30]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x406808
cmp cl, bl
je 0x406804
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x406808
add eax, 2
add esi, 2
cmp cl, bl
jne 0x4067e4
xor eax, eax
jmp 0x40680d
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x40689b
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x1c]
push eax
push 0x20019
push ebx
push str.RPCNetLib
push ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40689b
mov ecx, 0x100
lea edi, [esp + 0xe4]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x14]
lea eax, [esp + 0xe4]
push edx
push eax
push ebx
push ebx
push str.Security
push ecx
mov dword [esp + 0x2c], 0x400
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x406890
lea edi, [esp + 0xe4]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x406889
mov word [ebp + 0x320], 1
jmp 0x406890
mov word [ebp + 0x320], bx
mov edx, dword [esp + 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea esi, [esp + 0x30]
lea eax, [esp + 0x94]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4068ca
cmp cl, bl
je 0x4068c6
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4068ca
add eax, 2
add esi, 2
cmp cl, bl
jne 0x4068a6
xor eax, eax
jmp 0x4068cf
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x406936
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0xe4]
mov edx, dword [esp + 0x10]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x14]
lea ecx, [esp + 0xe4]
push eax
push ecx
push ebx
push ebx
push str.RWSListenAddress
push edx
mov dword [esp + 0x2c], 0x400
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x406936
lea edi, [esp + 0xe4]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [ebp + 0x220]
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, dword [esp + 0x20]
cmp edi, ebx
jne 0x406943
mov edi, 0x40d874
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [ebp + 0x120]
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x8e8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [eax]
mov esi, ebp
inc edx
mov dword [eax], edx
mov edx, dword [esp + 0x18]
mov cl, byte [0x40d874]
mov ebp, dword [ebp + 0x324]
push edx
lea eax, [esp + 0x34]
push 0x40b2bc
push eax
mov byte [esp + 0x3c], cl
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
cmp eax, ebx
jne 0x406736
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8d4
ret