Function at 0x100417480
Capabilities:
Reference sql statements

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x400]
sub rsp, 0x500
mov qword [rbp - 0x78], 0xfffffffffffffffe
mov qword [rsp + 0x558], rbx
mov rax, qword [0x100499010]
xor rax, rsp
mov qword [rbp + 0x3f0], rax
mov rsi, rdx
mov rdi, rcx
mov dword [rsp + 0x50], r8d
movups xmm0, xmmword [str.ConnCacheMSXInstructions]
movups xmmword [rbp - 0x50], xmm0
movups xmm1, xmmword [0x100474cf0]
movups xmmword [rbp - 0x40], xmm1
movups xmm0, xmmword [0x100474d00]
movups xmmword [rbp - 0x30], xmm0
movzx eax, word [0x100474d10]
mov word [rbp - 0x20], ax
xor ebx, ebx
lea rax, [rsp + 0x68]
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x78], rbx
mov qword [rbp - 0x80], 7
mov word [rsp + 0x68], bx
lea r8d, [rbx + 0xc]
lea rdx, str.LoginTimeout
lea rcx, [rsp + 0x68]
call fcn.10040da90
nop
call fcn.10044da70
mov rcx, rax
lea rdx, [rsp + 0x68]
call fcn.100409ee0
mov r9d, eax
lea r8, [rbp - 0x50]
xor edx, edx
mov rcx, rdi
call fcn.10040fcc0
test eax, eax
je 0x1004177b0
xor eax, eax
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], rax
mov qword [rbp - 0x60], rax
mov dword [rbp - 0x58], eax
lea r15d, [rbx + 4]
lea r12d, [rbx + 1]
lea r13d, [rbx + 2]
cmp word [rdi + 0xa4c], 9
jb 0x100417662
mov qword [rsp + 0x68], rdi
mov word [rsp + 0x70], bx
mov qword [rsp + 0x60], r15
mov word [rsp + 0x70], r12w
lea r9d, [rbx - 0x10]
mov r8d, r12d
mov edx, r12d
lea rax, [rsp + 0x60]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], rbx
lea rax, [rsp + 0x50]
mov qword [rsp + 0x38], rax
mov word [rsp + 0x30], bx
mov qword [rsp + 0x28], rbx
mov word [rsp + 0x20], r15w
mov rcx, qword [rdi + 0x18]
call qword [sym.imp.ODBC32.dll_SQLBindParameter]
lea rcx, [0x1004a8db0]
mov rax, 0xffffffffffffffff
nop dword [rax]
inc rax
cmp word [rcx + rax*2], 0
jne 0x1004175e0
add eax, eax
mov word [rsp + 0x70], r13w
movsxd r10, eax
mov r11d, 0xfffffff7
lea r9d, [r11 + 1]
mov r8d, r12d
mov edx, r13d
lea rax, [0x100499038]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], r10
mov qword [rsp + 0x38], rcx
mov word [rsp + 0x30], bx
mov qword [rsp + 0x28], 0x80
mov word [rsp + 0x20], r11w
mov rcx, qword [rdi + 0x18]
call qword [sym.imp.ODBC32.dll_SQLBindParameter]
lea rdx, str.SELECT_TOP_____instance_id__operation_code__object_type__object_id_FROM_msdb.dbo.sysdownloadlist_WHERE__target_server_____AND__status__0__ORDER_BY_instance_id
mov rcx, rdi
call qword [sym.imp.SQLSVC.dll_QSQLExecDirect]
mov r14d, eax
mov rcx, qword [rdi + 0x18]
test rcx, rcx
je 0x1004176a9
mov edx, 3
call qword [sym.imp.ODBC32.dll_SQLFreeStmt]
jmp 0x1004176a9
xor edx, edx
mov r8d, 0x400
lea rcx, [rbp - 0x10]
call sub.VCRUNTIME140.dll_memset
lea rcx, [0x1004a8db0]
mov qword [rsp + 0x20], rcx
mov r9d, dword [rsp + 0x50]
lea r8, str.SELECT_TOP__ld_instance_id__operation_code__object_type__object_id_FROM_msdb.dbo.sysdownloadlist_WHERE__target_server__N_s__AND__status__0__ORDER_BY_instance_id
mov edx, 0x200
lea rcx, [rbp - 0x10]
call fcn.10040b460
lea rdx, [rbp - 0x10]
mov rcx, rdi
call qword [sym.imp.SQLSVC.dll_QSQLExecDirect]
mov r14d, eax
cmp r14d, 1
jne 0x1004177b0
nop dword [rax]
nop word [rax + rax]
lea rax, [rsp + 0x58]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x70]
mov qword [rsp + 0x20], rax
mov r9d, r15d
mov r8d, 0xfffffff0
mov edx, r12d
mov rcx, rdi
call qword [sym.imp.SQLSVC.dll_QSQLBind]
lea rax, [rsp + 0x58]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x6c]
mov qword [rsp + 0x20], rax
mov r9d, r15d
mov r8d, 0xfffffff0
mov edx, r13d
mov rcx, rdi
call qword [sym.imp.SQLSVC.dll_QSQLBind]
lea rax, [rsp + 0x58]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x68]
mov qword [rsp + 0x20], rax
mov r9d, r15d
mov edx, 3
lea r8d, [rdx - 0x13]
mov rcx, rdi
call qword [sym.imp.SQLSVC.dll_QSQLBind]
lea rax, [rsp + 0x58]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x64]
mov qword [rsp + 0x20], rax
mov r9d, reloc.ODBC32.dll_SQLFreeStmt
lea r8d, [r9 - 0x12]
mov edx, r15d
mov rcx, rdi
call qword [sym.imp.SQLSVC.dll_QSQLBind]
mov rcx, rdi
call qword [sym.imp.SQLSVC.dll_QSQLNextRow]
cmp eax, 0xffffffff
jne 0x10041779e
nop
lea rdx, [rbp - 0x70]
mov rcx, rsi
call qword [sym.imp.SQLSVC.dll_SHRecMemAdd]
inc ebx
xor eax, eax
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], rax
mov qword [rbp - 0x60], rax
mov dword [rbp - 0x58], eax
mov rcx, rdi
call qword [sym.imp.SQLSVC.dll_QSQLNextRow]
cmp eax, 0xffffffff
je 0x100417770
mov rcx, rdi
call qword [sym.imp.SQLSVC.dll_QSQLResults]
cmp eax, 1
je 0x1004176c0
mov eax, ebx
mov rcx, qword [rbp + 0x3f0]
xor rcx, rsp
call fcn.100469360
mov rbx, qword [rsp + 0x558]
add rsp, 0x500
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret