Function at 0x40f090
Capabilities:
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x420
mov eax, dword [0x42729c]
mov dword [ebp - 4], eax
mov ecx, 0x43221c
call fcn.00418840
test eax, eax
je 0x40f0bb
mov ecx, 0x43221c
call fcn.004188c0
mov dword [ebp - 0x410], 0
lea eax, [ebp - 0x410]
push eax
push 0x20019
push 0
push str.SOFTWAREMicrosoftMSSQLServerITG
push SysStringLen
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x40f11d
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x70c], 0
push str.Reg_read_KEY_SOFTWAREMicrosoftMSSQLServerITG_failed._Unable_to_determine_remote_history_server.
mov edx, dword [ebp + 8]
add edx, 0xb18
push edx
call dword [sym.imp.MSVCR71.dll_wcscpy]
add esp, 8
mov eax, dword [ebp + 8]
push eax
call fcn.0040edd0
add esp, 4
jmp 0x40f346
mov dword [ebp - 0x414], 0x400
mov dword [ebp - 0x40c], 0
mov ecx, dword [ebp - 0x414]
push ecx
push 0
lea edx, [ebp - 0x408]
push edx
call sub.MSVCR71.dll_memset
add esp, 0xc
lea eax, [ebp - 0x414]
push eax
lea ecx, [ebp - 0x408]
push ecx
lea edx, [ebp - 0x40c]
push edx
push 0
push str.HistoryServer
mov eax, dword [ebp - 0x410]
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40f18a
movzx ecx, word [ebp - 0x408]
test ecx, ecx
je 0x40f18a
cmp dword [ebp - 0x40c], 1
je 0x40f1cc
mov edx, dword [ebp + 8]
mov dword [edx + 0x70c], 0
push str.Reg_read_VALUE_SOFTWAREMicrosoftMSSQLServerITGHistoryServer_failed._Unable_to_determine_remote_history_server.
mov eax, dword [ebp + 8]
add eax, 0xb18
push eax
call dword [sym.imp.MSVCR71.dll_wcscpy]
add esp, 8
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040edd0
add esp, 4
mov edx, dword [ebp - 0x410]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40f346
mov eax, dword [ebp - 0x410]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, 0x43221c
call fcn.00418860
push eax
push 0x424b4c
push 1
push 0
push 0x424b8c
call dword [sym.imp.ole32.dll_CoCreateInstance]
push eax
call fcn.00407110
add esp, 4
test eax, eax
jne 0x40f213
mov ecx, 0x43221c
call fcn.00418880
test eax, eax
je 0x40f257
mov word [0x427d24], 0
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x70c], 0
push 0x427924
push str.OLE_Error:_CoCreateInstance_on_IID_ISQLDMOServer_failed._Unable_to_write_history_to_remote_server._Error_message:__s
mov edx, dword [ebp + 8]
add edx, 0xb18
push edx
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0xc
mov eax, dword [ebp + 8]
push eax
call fcn.0040edd0
add esp, 4
jmp 0x40f346
mov ecx, 0x43221c
call fcn.004188a0
mov dword [ebp - 0x418], eax
push 0xa
mov ecx, dword [ebp - 0x418]
push ecx
mov edx, dword [ebp - 0x418]
mov eax, dword [edx]
call dword [eax + 0x5c]
push eax
call fcn.00407110
add esp, 4
test eax, eax
jne 0x40f2f6
mov ecx, 0x43221c
call fcn.004188a0
mov dword [ebp - 0x41c], eax
push 1
mov ecx, dword [ebp - 0x41c]
push ecx
mov edx, dword [ebp - 0x41c]
mov eax, dword [edx]
call dword [eax + 0x64]
push eax
call fcn.00407110
add esp, 4
test eax, eax
jne 0x40f2f6
mov ecx, 0x43221c
call fcn.004188a0
mov dword [ebp - 0x420], eax
push 0
push 0
lea ecx, [ebp - 0x408]
push ecx
mov edx, dword [ebp - 0x420]
push edx
mov eax, dword [ebp - 0x420]
mov ecx, dword [eax]
call dword [ecx + 0x158]
push eax
call fcn.00407110
add esp, 4
test eax, eax
je 0x40f346
mov word [0x427d24], 0
mov ecx, 0x43221c
call fcn.004188c0
mov edx, dword [ebp + 8]
mov dword [edx + 0x70c], 0
push 0x427924
lea eax, [ebp - 0x408]
push eax
push str.Unable_to_connect_to_remote_history_server:__s._Error_message:__s
mov ecx, dword [ebp + 8]
add ecx, 0xb18
push ecx
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0x10
mov edx, dword [ebp + 8]
push edx
call fcn.0040edd0
add esp, 4
mov ecx, dword [ebp - 4]
call fcn.00419641
mov esp, ebp
pop ebp
ret