Function at 0x4dd040
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
lea eax, [ebp - 0x28]
push eax
push 0x101
push 0
push str.SOFTWAREMicrosoftMicrosoft_SQL_ServerInstance_NamesSQL
push reloc.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x4dd06b
xor eax, eax
mov esp, ebp
pop ebp
ret
push ebx
push esi
push edi
push 0x208
call fcn.004e4629
push 0x208
mov ebx, eax
call fcn.004e4629
mov esi, 0x104
push 0x208
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x2c], 0
call fcn.004e4629
mov edi, eax
push 0x208
mov dword [ebp - 0x10], edi
mov dword [ebp - 0x24], esi
call fcn.004e4629
mov esi, eax
push 0x208
mov dword [ebp - 0x14], esi
call fcn.004e4629
add esp, 0x14
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], 0
mov edi, edi
lea ecx, [ebp - 0x24]
push ecx
mov ecx, dword [ebp - 0x18]
push edi
lea edx, [ebp - 0x2c]
push edx
mov edx, dword [ebp - 0xc]
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x28]
push ecx
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
test eax, eax
jne 0x4dd483
push 0x208
push eax
push ebx
call fcn.004e7d90
push 7
push str.MSSQL.1
push edi
mov dword [ebp - 4], 0
mov dword [ebp - 0x1c], 0x104
call fcn.004e4207
add esp, 0x18
test eax, eax
jne 0x4dd144
mov eax, str.Microsoft_SQL_Server_2005_x64
mov edx, ebx
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4dd130
jmp 0x4dd232
push 8
push str.MSSQL10.
push edi
call fcn.004e4207
add esp, 0xc
test eax, eax
jne 0x4dd175
mov eax, str.Microsoft_SQL_Server_2008_x64
mov edx, ebx
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4dd161
jmp 0x4dd232
push 0xb
push str.MSSQL10_50.
push edi
call fcn.004e4207
add esp, 0xc
test eax, eax
jne 0x4dd1a6
mov eax, str.Microsoft_SQL_Server_2008R2_x64
mov edx, ebx
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4dd192
jmp 0x4dd232
push 8
push str.MSSQL11.
push edi
call fcn.004e4207
add esp, 0xc
test eax, eax
jne 0x4dd1d4
mov eax, str.Microsoft_SQL_Server_2012_x64
mov edx, ebx
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4dd1c3
jmp 0x4dd232
push 8
push str.MSSQL12.
push edi
call fcn.004e4207
add esp, 0xc
test eax, eax
jne 0x4dd202
mov eax, str.Microsoft_SQL_Server_2014_x64
mov edx, ebx
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4dd1f1
jmp 0x4dd232
push 8
push str.MSSQL13.
push edi
call fcn.004e4207
add esp, 0xc
test eax, eax
jne 0x4dd0d0
mov eax, str.Microsoft_SQL_Server_2016_x64
mov edx, ebx
sub edx, eax
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4dd223
push edi
push str.SOFTWAREMicrosoftMicrosoft_SQL_Server_sSetup
push esi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea ecx, [ebp - 4]
push ecx
push 0x101
push 0
push esi
push reloc.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4dd2d9
mov esi, dword [ebp - 8]
mov ecx, dword [ebp - 4]
lea edx, [ebp - 0x1c]
push edx
push esi
lea eax, [ebp - 0x30]
push eax
push 0
push str.Edition
push ecx
mov dword [ebp - 0x30], 1
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, esi
mov ecx, esi
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x4dd293
sub eax, ecx
lea edi, [ebx - 2]
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x4dd2a3
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebx - 2]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4dd2c0
mov eax, dword [0x51d454]
mov esi, dword [ebp - 0x14]
mov dword [edi], eax
mov edi, dword [ebp - 0x10]
push edi
push str.SOFTWAREMicrosoftMicrosoft_SQL_Server_sMSSQLServerCurrentVersion
push esi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea ecx, [ebp - 4]
push ecx
push 1
push 0
push esi
push reloc.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4dd380
mov esi, dword [ebp - 8]
mov ecx, dword [ebp - 4]
lea edx, [ebp - 0x1c]
push edx
push esi
lea eax, [ebp - 0x30]
push eax
push 0
push str.CurrentVersion
push ecx
mov dword [ebp - 0x30], 1
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea edi, [ebx - 2]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x4dd336
mov eax, dword [0x51d454]
mov dword [edi], eax
mov eax, esi
mov edx, esi
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4dd350
sub eax, edx
lea edi, [ebx - 2]
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x4dd360
mov ecx, eax
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 [ebp - 0x10]
mov esi, dword [ebp - 0x14]
lea eax, [ebx - 2]
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x4dd383
mov ecx, dword [0x526530]
mov dword [eax], ecx
mov dx, word [0x526534]
push 0x208
mov word [eax + 4], dx
mov eax, dword [ebp - 8]
push 0
push eax
call fcn.004e7d90
push 0x208
push 0
push esi
call fcn.004e7d90
mov ecx, dword [ebp - 0x18]
push 0x208
push 0
push ecx
call fcn.004e7d90
push 0x208
push 0
push edi
call fcn.004e7d90
mov eax, 0x104
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 8]
add esp, 0x30
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4dd3f0
sub eax, edx
sar eax, 1
mov eax, ebx
jne 0x4dd421
mov edx, dword [ebp + 8]
sub edx, ebx
jmp 0x4dd410
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4dd410
jmp 0x4dd458
mov edx, eax
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4dd423
mov edi, dword [ebp + 8]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x4dd436
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp - 0x10]
mov esi, dword [ebp - 0x14]
mov eax, dword [ebp + 8]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4dd460
mov ecx, dword [ebp + 8]
sub eax, edx
sar eax, 1
inc dword [ebp - 0xc]
mov edx, 1
mov word [ecx + eax*2], dx
jmp 0x4dd0d0
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 8]
push eax
call fcn.004e41ab
push esi
call fcn.004e41ab
mov ecx, dword [ebp - 0x18]
push ecx
call fcn.004e41ab
push edi
call fcn.004e41ab
add esp, 0x10
xor eax, eax
cmp dword [ebp - 0xc], eax
pop edi
pop esi
setg al
pop ebx
mov esp, ebp
pop ebp
ret