Function at 0x40a1e0
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 [0x412808], 0
call fcn.0040a880
cmp dword [0x412d58], 0
je 0x40a2b9
mov dword [ebp - 0xc], 1
jmp 0x40a225
mov eax, dword [ebp - 0xc]
add eax, 1
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xb
jae 0x40a2b4
mov ecx, dword [ebp - 0xc]
mov edx, dword [ecx*4 + 0x40f368]
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ecx, dword [ebp - 0xc]
mov dword [ecx*4 + 0x412808], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
mov edx, dword [ebp - 0xc]
cmp dword [edx*4 + 0x412808], 0
jne 0x40a2af
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 0x411514
lea edx, [ebp - 0x318]
push edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax*4 + 0x40f368]
push ecx
mov edx, dword [ebp - 0xc]
mov eax, dword [edx*4 + 0x412808]
push eax
call fcn.0040a7bc
add esp, 0x14
xor eax, eax
jmp 0x40a6ab
jmp 0x40a21c
jmp 0x40a487
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 0x40a335
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 0x40a2fc
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 [0x412808], eax
cmp dword [0x412808], 0
jne 0x40a335
mov byte [ebp - 0x144], 0
cmp dword [0x412808], 0
jne 0x40a487
lea eax, [ebp - 0x218]
push eax
push str.SOFTWAREMicrosoftMSSQLServer_70Setup
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
jne 0x40a392
lea ecx, [ebp - 0x14]
push ecx
lea edx, [ebp - 0x144]
push edx
lea eax, [ebp - 0x210]
push eax
push 0
push 0x411550
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 0x40a3e9
lea eax, [ebp - 0x218]
push eax
push str.SOFTWAREMicrosoftMSSQLServerSetup
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
jne 0x40a3e2
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 0x40a3e9
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 [0x412808], eax
cmp dword [0x412808], 0
jne 0x40a430
push 8
push 0
mov eax, dword [str.SQLSTR.DLL]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov dword [0x412808], eax
cmp dword [0x412808], 0
jne 0x40a487
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 0x40a6ab
mov dword [ebp - 0xc], 0
jmp 0x40a499
mov ecx, dword [ebp - 0xc]
add ecx, 1
mov dword [ebp - 0xc], ecx
cmp dword [ebp - 0xc], 0x13d
jae 0x40a687
mov edx, dword [ebp - 0xc]
mov eax, dword [edx*4 + 0x40f398]
push eax
lea ecx, [ebp - 0x20c]
push ecx
call sub.MSVCRT.dll_strcpy
add esp, 8
cmp dword [0x412d58], 0
je 0x40a5b3
push 0x4115b8
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 0x40a4f9
mov eax, dword [ebp - 0x214]
mov byte [eax], 0
movsx ecx, byte [ebp - 0x20c]
cmp ecx, 0x41
jl 0x40a520
movsx edx, byte [ebp - 0x20c]
cmp edx, 0x5a
jg 0x40a520
movsx eax, byte [ebp - 0x20c]
sub eax, 0x37
mov dword [ebp - 4], eax
jmp 0x40a52d
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 + 0x412808]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edx, dword [ebp - 0xc]
mov dword [edx*4 + 0x412860], eax
mov eax, dword [ebp - 0xc]
cmp dword [eax*4 + 0x412860], 0
jne 0x40a5ae
mov ecx, dword [ebp - 4]
mov edx, dword [ecx*4 + 0x40f368]
push edx
push 0x4115bc
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0x1d6
push 0x4115e0
lea ecx, [ebp - 0x420]
push ecx
lea edx, [ebp - 0x20b]
push edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax*4 + 0x412860]
push ecx
call fcn.0040a7bc
add esp, 0x14
xor eax, eax
jmp 0x40a6ab
jmp 0x40a682
mov byte [ebp - 0x20c], 0x5f
push 0x4115f4
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 0x40a612
mov eax, dword [ebp - 0x214]
movsx ecx, byte [eax + 1]
test ecx, ecx
jne 0x40a5ff
lea edx, [ebp - 0x20b]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x214]
mov byte [eax], 0
jmp 0x40a608
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 [0x412808]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edx, dword [ebp - 0xc]
mov dword [edx*4 + 0x412860], eax
mov eax, dword [ebp - 0xc]
cmp dword [eax*4 + 0x412860], 0
jne 0x40a682
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 + 0x412860]
push eax
call fcn.0040a7bc
add esp, 0x14
xor eax, eax
jmp 0x40a6ab
jmp 0x40a490
cmp dword [0x412d58], 0
je 0x40a6a6
cmp dword [0x412808], 0
je 0x40a6a6
mov ecx, dword [0x412808]
push ecx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, 1
mov esp, ebp
pop ebp
ret