Function at 0x40c820
Capabilities:
Reference sql statements

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41c560
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x878
mov eax, dword [0x42729c]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x874], 0
lea ecx, [ebp - 0x81c]
call fcn.00418f50
mov dword [ebp - 4], 0
mov ecx, 0x432214
call fcn.00418820
mov dword [ebp - 0x870], eax
movzx eax, word [0x431918]
test eax, eax
jne 0x40c89d
push str.00000000_0000_0000_0000_000000000000
lea ecx, [ebp - 0x86c]
push ecx
call dword [sym.imp.MSVCR71.dll_wcscpy]
add esp, 8
jmp 0x40c8b2
push 0x431918
lea edx, [ebp - 0x86c]
push edx
call dword [sym.imp.MSVCR71.dll_wcscpy]
add esp, 8
mov eax, dword [ebp - 0x870]
cmp eax, dword [ebp + 8]
jne 0x40c8e2
lea ecx, [ebp - 0x86c]
push ecx
lea edx, [ebp - 0x86c]
push edx
push str.SELECT_max_history_rows_FROM_msdb.dbo.sysdbmaintplans_WHERE_plan_id___s_SELECT_COUNT___FROM_msdb.dbo.sysdbmaintplan_history_WHERE_plan_id___s
lea eax, [ebp - 0x814]
push eax
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0x10
jmp 0x40c905
lea ecx, [ebp - 0x86c]
push ecx
lea edx, [ebp - 0x86c]
push edx
push str.SELECT_max_remote_history_rows_FROM_msdb.dbo.sysdbmaintplans_WHERE_plan_id___s_SELECT_COUNT___FROM_msdb.dbo.sysdbmaintplan_history_WHERE_plan_id___s
lea eax, [ebp - 0x814]
push eax
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0x10
push 0
lea ecx, [ebp - 0x81c]
call fcn.00418fc0
push eax
lea ecx, [ebp - 0x814]
push ecx
mov edx, dword [ebp - 0x870]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x870]
push ecx
call dword [eax + 0x170]
test eax, eax
jl 0x40c971
lea ecx, [ebp - 0x81c]
call fcn.00418fe0
test eax, eax
jne 0x40c971
lea ecx, [ebp - 0x81c]
call fcn.00419000
mov dword [ebp - 0x878], eax
lea edx, [ebp - 0x10]
push edx
push 0
push 0
mov eax, dword [ebp - 0x878]
push eax
mov ecx, dword [ebp - 0x878]
mov edx, dword [ecx]
call dword [edx + 0x40]
test eax, eax
jge 0x40c988
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x81c]
call fcn.00418f70
jmp 0x40cb49
cmp dword [ebp - 0x10], 0
jg 0x40c9a5
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x81c]
call fcn.00418f70
jmp 0x40cb49
lea ecx, [ebp - 0x81c]
call fcn.00419000
mov dword [ebp - 0x87c], eax
push 1
mov eax, dword [ebp - 0x87c]
push eax
mov ecx, dword [ebp - 0x87c]
mov edx, dword [ecx]
call dword [edx + 0x28]
test eax, eax
jl 0x40ca00
lea ecx, [ebp - 0x81c]
call fcn.00419000
mov dword [ebp - 0x880], eax
lea eax, [ebp - 0x874]
push eax
push 0
push 0
mov ecx, dword [ebp - 0x880]
push ecx
mov edx, dword [ebp - 0x880]
mov eax, dword [edx]
call dword [eax + 0x40]
test eax, eax
jge 0x40ca17
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x81c]
call fcn.00418f70
jmp 0x40cb49
mov ecx, dword [ebp - 0x874]
cmp ecx, dword [ebp - 0x10]
jg 0x40ca39
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x81c]
call fcn.00418f70
jmp 0x40cb49
lea ecx, [ebp - 0x81c]
call fcn.00419020
mov dword [ebp - 0x818], 0
lea edx, [ebp - 0x86c]
push edx
push str.SELECT_sequence_id_FROM_msdb.dbo.sysdbmaintplan_history_WHERE_plan_id___s_ORDER_BY_sequence_id
lea eax, [ebp - 0x814]
push eax
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0xc
push 0
lea ecx, [ebp - 0x81c]
call fcn.00418fc0
push eax
lea ecx, [ebp - 0x814]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov ecx, dword [ebp + 8]
push ecx
call dword [eax + 0x170]
test eax, eax
jl 0x40cadb
lea ecx, [ebp - 0x81c]
call fcn.00418fe0
test eax, eax
jne 0x40cadb
lea ecx, [ebp - 0x81c]
call fcn.00419000
mov dword [ebp - 0x884], eax
lea edx, [ebp - 0x818]
push edx
push 0
mov eax, dword [ebp - 0x874]
sub eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0x884]
push ecx
mov edx, dword [ebp - 0x884]
mov eax, dword [edx]
call dword [eax + 0x40]
test eax, eax
jge 0x40caef
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x81c]
call fcn.00418f70
jmp 0x40cb49
lea ecx, [ebp - 0x81c]
call fcn.00419020
mov ecx, dword [ebp - 0x818]
push ecx
lea edx, [ebp - 0x86c]
push edx
push str.DELETE_msdb.dbo.sysdbmaintplan_history_WHERE_plan_id___s_AND_sequence_id____d
lea eax, [ebp - 0x814]
push eax
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0x10
push 0
push 0
lea ecx, [ebp - 0x814]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov ecx, dword [ebp + 8]
push ecx
call dword [eax + 0x16c]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x81c]
call fcn.00418f70
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x14]
call fcn.00419641
mov esp, ebp
pop ebp
ret