Function at 0x402720
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 0x40279b
mov eax, dword [esi + 0x2c]
test eax, eax
jne 0x40276b
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push str.sqlboot.dll
call ebx
test eax, eax
jne 0x402a88
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 0x4027a6
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 0x402a88
push str.sqlboot.dll
jmp 0x4027a6
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push str.sqlboot.dll
call ebx
test eax, eax
jne 0x402a88
push ebp
push edi
mov ecx, 0x41
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
mov dl, byte [0x416274]
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 0x402a43
lea ecx, [esp + 0x120]
test ecx, ecx
je 0x402a43
test ebp, ebp
je 0x402818
cmp byte [ebp], 0
je 0x402818
push str.MSSQLSERVER
push ebp
call fcn.00408b40
add esp, 8
test eax, eax
jne 0x40286f
mov edx, str.MSSQLSERVER
test edx, edx
je 0x402887
mov al, byte [str.MSSQLSERVER]
test al, al
je 0x402887
push edx
push edx
call fcn.00408b40
add esp, 8
test eax, eax
je 0x402887
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 0x4028df
cmp byte [ebp], 0
je 0x402887
push str.MSSQLSERVER
push ebp
call fcn.00408b40
add esp, 8
test eax, eax
jne 0x4028ad
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 0x4028ff
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, str.Setup
rep movsb byte es:[edi], byte [esi]
je 0x40293c
mov edi, str.Setup
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 0x402a43
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x14]
lea eax, [esp + 0x18]
push edx
push eax
push 0
push 0
push str.SQLPath
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 0x402a43
xor eax, eax
cmp eax, str.Binn
je 0x402a43
mov edi, str.Binn
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 0x402a43
cmp byte [str.Binn], 0x5c
je 0x402a15
mov edi, 0x413040
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.Binn
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 0x402a86
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, esi
pop esi
pop ebx
add esp, 0x214
ret