Function at 0x406680
Capabilities:
Query or enumerate registry value

Disassembly:
sub esp, 0x214
push ebx
push esi
mov esi, ecx
mov eax, dword [esi + 0x18]
test eax, eax
je 0x4066fb
mov eax, dword [esi + 0x2c]
test eax, eax
jne 0x4066cb
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push str.sqlboot.dll
call ebx
test eax, eax
jne 0x4069e8
mov eax, dword [esi + 0x18]
lea ecx, [esp + 0x10]
push eax
push str._ssqlboot.dll
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea edx, [esp + 0x10]
push edx
jmp 0x406706
push eax
lea eax, [esp + 0x14]
push str._ssqlboot.dll
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
add esp, 0xc
lea ecx, [esp + 0x10]
push ecx
call ebx
test eax, eax
jne 0x4069e8
push str.sqlboot.dll
jmp 0x406706
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push str.sqlboot.dll
call ebx
test eax, eax
jne 0x4069e8
push ebp
push edi
mov ecx, 0x41
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
mov dl, byte [0x41c254]
mov ecx, 0x40
stosb byte es:[edi], al
xor eax, eax
lea edi, [esp + 0x121]
mov byte [esp + 0x120], dl
mov ebp, dword [esi + 0x28]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x18]
test eax, eax
je 0x4069a3
lea ecx, [esp + 0x120]
test ecx, ecx
je 0x4069a3
test ebp, ebp
je 0x406778
cmp byte [ebp], 0
je 0x406778
push str.MSSQLSERVER
push ebp
call fcn.0040d040
add esp, 8
test eax, eax
jne 0x4067cf
mov edx, str.MSSQLSERVER
test edx, edx
je 0x4067e7
mov al, byte [str.MSSQLSERVER]
test al, al
je 0x4067e7
push edx
push edx
call fcn.0040d040
add esp, 8
test eax, eax
je 0x4067e7
mov edi, str.SoftwareMicrosoftMicrosoft_SQL_Server_
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x120]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x120]
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, str.MSSQLSERVER
jmp 0x40683f
cmp byte [ebp], 0
je 0x4067e7
push str.MSSQLSERVER
push ebp
call fcn.0040d040
add esp, 8
test eax, eax
jne 0x40680d
mov edi, str.SoftwareMicrosoftMSSQLServer
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x120]
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
jmp 0x40685f
mov edi, str.SoftwareMicrosoftMicrosoft_SQL_Server_
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x120]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x120]
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, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
xor eax, eax
and ecx, 3
cmp eax, 0x418420
rep movsb byte es:[edi], byte [esi]
je 0x40689c
mov edi, 0x418420
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x120]
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0x10]
lea ecx, [esp + 0x120]
push eax
push 0x20019
push 0
push ecx
push 0x80000002
mov dword [esp + 0x28], 0x104
mov dword [esp + 0x24], 0
mov byte [esp + 0x2c], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4069a3
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x14]
lea eax, [esp + 0x18]
push edx
push eax
push 0
push 0
push 0x418418
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edx, dword [esp + 0x10]
mov esi, eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
jne 0x4069a3
xor eax, eax
cmp eax, 0x418410
je 0x4069a3
mov edi, 0x418410
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0x18]
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [edx + ecx + 2]
cmp eax, 0x104
ja 0x4069a3
cmp byte [0x418410], 0x5c
je 0x406975
mov edi, 0x41840c
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x18]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x418410
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x18]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str._sqlboot.dll
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x18]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x18]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call ebx
mov esi, eax
pop edi
test esi, esi
pop ebp
jne 0x4069e6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, esi
pop esi
pop ebx
add esp, 0x214
ret