Function at 0x40db50
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x520
mov dword [ebp - 0x14], 0x130
mov byte [ebp - 0x144], 0
mov dword [0x416a48], 0
call fcn.0040e1f0
cmp dword [0x416f98], 0
je 0x40dc29
mov dword [ebp - 0xc], 1
jmp 0x40db95
mov eax, dword [ebp - 0xc]
add eax, 1
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xb
jae 0x40dc24
mov ecx, dword [ebp - 0xc]
mov edx, dword [ecx*4 + 0x4135b8]
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ecx, dword [ebp - 0xc]
mov dword [ecx*4 + 0x416a48], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
mov edx, dword [ebp - 0xc]
cmp dword [edx*4 + 0x416a48], 0
jne 0x40dc1f
mov eax, dword [ebp - 8]
push eax
push str.Could_not_be_loaded__NT_Error__d
lea ecx, [ebp - 0x318]
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0x183
push 0x415764
lea edx, [ebp - 0x318]
push edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax*4 + 0x4135b8]
push ecx
mov edx, dword [ebp - 0xc]
mov eax, dword [edx*4 + 0x416a48]
push eax
call fcn.0040e12c
add esp, 0x14
xor eax, eax
jmp 0x40e01b
jmp 0x40db8c
jmp 0x40ddf7
mov ecx, dword [ebp - 0x14]
push ecx
lea edx, [ebp - 0x144]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x40dca5
push 0x5c
lea ecx, [ebp - 0x144]
push ecx
call sub.MSVCRT.dll__mbsrchr
add esp, 8
mov dword [ebp - 0x31c], eax
cmp dword [ebp - 0x31c], 0
je 0x40dc6c
mov edx, dword [ebp - 0x31c]
mov byte [edx + 1], 0
mov eax, dword [str.SQLSTR.DLL]
push eax
lea ecx, [ebp - 0x144]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 8
push 0
lea edx, [ebp - 0x144]
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov dword [0x416a48], eax
cmp dword [0x416a48], 0
jne 0x40dca5
mov byte [ebp - 0x144], 0
cmp dword [0x416a48], 0
jne 0x40ddf7
lea eax, [ebp - 0x218]
push eax
push str.SOFTWAREMicrosoftMSSQLServer_70Setup
push reloc.ODBC32.dll_SQLAllocEnv
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
jne 0x40dd02
lea ecx, [ebp - 0x14]
push ecx
lea edx, [ebp - 0x144]
push edx
lea eax, [ebp - 0x210]
push eax
push 0
push 0x4157a0
mov ecx, dword [ebp - 0x218]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edx, dword [ebp - 0x218]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40dd59
lea eax, [ebp - 0x218]
push eax
push str.SOFTWAREMicrosoftMSSQLServerSetup
push reloc.ODBC32.dll_SQLAllocEnv
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
jne 0x40dd52
lea ecx, [ebp - 0x14]
push ecx
lea edx, [ebp - 0x144]
push edx
lea eax, [ebp - 0x210]
push eax
push 0
push str.SQLPath
mov ecx, dword [ebp - 0x218]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edx, dword [ebp - 0x218]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40dd59
mov byte [ebp - 0x144], 0
mov eax, dword [str.SQLSTR.DLL]
push eax
lea ecx, [ebp - 0x144]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 8
push 0
lea edx, [ebp - 0x144]
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov dword [0x416a48], eax
cmp dword [0x416a48], 0
jne 0x40dda0
push 8
push 0
mov eax, dword [str.SQLSTR.DLL]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov dword [0x416a48], eax
cmp dword [0x416a48], 0
jne 0x40ddf7
push 0
push 0
lea ecx, [ebp - 0x320]
push ecx
push 0x800
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1100
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push 0x30
push str.SQLUNI_Internal_Error:__Cannot_load_SQLSTR.DLL
mov edx, dword [ebp - 0x320]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, dword [ebp - 0x320]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor eax, eax
jmp 0x40e01b
mov dword [ebp - 0xc], 0
jmp 0x40de09
mov ecx, dword [ebp - 0xc]
add ecx, 1
mov dword [ebp - 0xc], ecx
cmp dword [ebp - 0xc], 0x13d
jae 0x40dff7
mov edx, dword [ebp - 0xc]
mov eax, dword [edx*4 + 0x4135e8]
push eax
lea ecx, [ebp - 0x20c]
push ecx
call sub.MSVCRT.dll_strcpy
add esp, 8
cmp dword [0x416f98], 0
je 0x40df23
push 0x415808
lea edx, [ebp - 0x20c]
push edx
call sub.MSVCRT.dll_strstr
add esp, 8
mov dword [ebp - 0x214], eax
cmp dword [ebp - 0x214], 0
je 0x40de69
mov eax, dword [ebp - 0x214]
mov byte [eax], 0
movsx ecx, byte [ebp - 0x20c]
cmp ecx, 0x41
jl 0x40de90
movsx edx, byte [ebp - 0x20c]
cmp edx, 0x5a
jg 0x40de90
movsx eax, byte [ebp - 0x20c]
sub eax, 0x37
mov dword [ebp - 4], eax
jmp 0x40de9d
movsx ecx, byte [ebp - 0x20c]
sub ecx, 0x30
mov dword [ebp - 4], ecx
lea edx, [ebp - 0x20b]
push edx
mov eax, dword [ebp - 4]
mov ecx, dword [eax*4 + 0x416a48]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edx, dword [ebp - 0xc]
mov dword [edx*4 + 0x416aa0], eax
mov eax, dword [ebp - 0xc]
cmp dword [eax*4 + 0x416aa0], 0
jne 0x40df1e
mov ecx, dword [ebp - 4]
mov edx, dword [ecx*4 + 0x4135b8]
push edx
push 0x41580c
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0x1d6
push 0x415830
lea ecx, [ebp - 0x420]
push ecx
lea edx, [ebp - 0x20b]
push edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax*4 + 0x416aa0]
push ecx
call fcn.0040e12c
add esp, 0x14
xor eax, eax
jmp 0x40e01b
jmp 0x40dff2
mov byte [ebp - 0x20c], 0x5f
push 0x415844
lea edx, [ebp - 0x20c]
push edx
call sub.MSVCRT.dll_strstr
add esp, 8
mov dword [ebp - 0x214], eax
cmp dword [ebp - 0x214], 0
je 0x40df82
mov eax, dword [ebp - 0x214]
movsx ecx, byte [eax + 1]
test ecx, ecx
jne 0x40df6f
lea edx, [ebp - 0x20b]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x214]
mov byte [eax], 0
jmp 0x40df78
lea ecx, [ebp - 0x20c]
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x214]
mov byte [edx - 1], 0x5f
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [0x416a48]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edx, dword [ebp - 0xc]
mov dword [edx*4 + 0x416aa0], eax
mov eax, dword [ebp - 0xc]
cmp dword [eax*4 + 0x416aa0], 0
jne 0x40dff2
mov ecx, dword [str.SQLSTR.DLL]
push ecx
push str.entrypoint_could_not_be_found_in__s
lea edx, [ebp - 0x520]
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0x1f2
push str..._srcprocaddr.c
lea eax, [ebp - 0x520]
push eax
mov ecx, dword [ebp - 0x10]
push ecx
mov edx, dword [ebp - 0xc]
mov eax, dword [edx*4 + 0x416aa0]
push eax
call fcn.0040e12c
add esp, 0x14
xor eax, eax
jmp 0x40e01b
jmp 0x40de00
cmp dword [0x416f98], 0
je 0x40e016
cmp dword [0x416a48], 0
je 0x40e016
mov ecx, dword [0x416a48]
push ecx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, 1
mov esp, ebp
pop ebp
ret