Function at 0x403790
Capabilities:
Reference sql statements

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
xor ebx, ebx
push edi
push str.declare__ret_int_n__n0:_6.5_version_n1:_6.0_version__replication_is_not_installed_n2:_6.0_version__replication_is_installed_n__n_nIF_0______SELECT_PATINDEX___6.0_____version_____nbegin_n____if_exists__SELECT__FROM_master..sysservers_n_t____WHERE__srvstatus__8_____0__n________select__ret__2_n____else_n________select__ret__1_nend_nelse_n____select__ret__0_n_nselect__ret_n
mov esi, ecx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ebx
call fcn.00401010
add esp, 4
push ebx
lea edx, [ebp - 8]
mov edi, eax
mov eax, dword [esi + 0xa20]
mov ecx, dword [eax]
push edx
push edi
push eax
call dword [ecx + 0x170]
mov ebx, eax
test ebx, ebx
setl byte [ebp - 1]
test edi, edi
je 0x4037e1
push edi
call sub.MSVCR71.dll_void___cdecl_operator_delete_void__
add esp, 4
mov al, byte [ebp - 1]
test al, al
jne 0x403877
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
lea edx, [ebp - 0x10]
push edx
push eax
call dword [ecx + 0x2c]
cmp dword [ebp - 0x10], 1
jne 0x403812
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
lea edx, [ebp - 0xc]
push edx
push 0
push 0
push eax
call dword [ecx + 0x40]
jmp 0x40381c
mov dword [esi + 0xa0c], 0xc
mov eax, dword [ebp - 8]
xor ebx, ebx
cmp eax, ebx
je 0x40382e
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov dword [ebp - 8], ebx
cmp dword [ebp - 0xc], ebx
jne 0x403990
push str._tSET_NOCOUNT_ON_n_tDECLARE__cmd_varchar_255__n_tDECLARE__name_varchar_30__n_tDECLARE__distname_varchar_30__n_tDECLARE__distdb_varchar_30__n_tDECLARE__proc_varchar_255__n_tDECLARE__status_int_n_tDECLARE__dbname_varchar_30__n_n_tDECLARE__status_ok_int_n_tDECLARE__invalid_dist_version_int_n_tDECLARE__replicated_tran_left_int_n_tDECLARE__undelivered_tran_left_int_n_tDECLARE__no_replication_installed_int_n_tDECLARE__incomplete_sub_left_int_n_tDECLARE__incomplete_tran_left_int_n_tDECLARE__is_distributor_bit_n_n_tSELECT__status___1___execution_failure___n_n__Dont_change_08._They_defined_in_replupd.h___n_tSELECT__status_ok__0_n_tSELECT__no_replication_installed__2_n_tSELECT__invalid_dist_version__3_n_tSELECT__replicated_tran_left__4_n_tSELECT__undelivered_tran_left__5_n_tSELECT__incomplete_sub_left__6_n_tSELECT__incomplete_tran_left__7_n_n_n_tSELECT__distname__NULL_n_n__create_global_temp_tables___n_tCREATE_TABLE_repl_trans__page_int__row_smallint__ts_binary_8___n_n_n_tCREATE_TABLE_distcounters___n_t_tsubscriber_varchar__30___n_t_tdelivered_jobs_int__n_t_tundelivered_jobs_int__n_t_tdelivery_rate_int__n_t_tdelivery_latency_int__n_n_tCREATE_TABLE_incomplete_sub_artid_int__n_n_tCREATE_TABLE_dist_version__version_varchar_255___n_n_t__n_t_Get_the_distribution_server_name_n_t__n____SELECT__distname__srvname_FROM_master..sysservers_n_tWHERE__srvstatus__8_____0_n_n_tIF__distname_IS_NULL_n_tBEGIN_n_t_tSELECT__status___no_replication_installed_n_t_tGOTO_DONE_n_tEND_n_n_t__n_t_Get_the_distribution_database_name_n_t__n_tSELECT__proc___distname_.master..sp_helpdistributor__n_tEXECUTE__proc__distribdb___distdb_OUTPUT_n_n_tselect__is_distributor__1_t_t_n_t__Make_sure_the_remote_distribution_server_is_7.0_version___n_tIF__distname______SERVERNAME_n_tBEGIN_n_t_tselect__is_distributor__0_n_t_tSELECT__proc___distname___n_t_t_t.master.dbo.sp_sqlexec_n_n__n__97.06.08_tmc___Due_to_sqlbug_65_Bug:12265_this_does_not_work_pre_65_sp1.__Must_create_entire_call_and_exec_it_to_n__t_tforce_eval_of_local_vars_prior_to_eval_of_insert_into.._n__n__t_tINSERT_INTO_dist_version_EXEC__proc_SELECT___VERSION_n__n_tselect__proc__insert_into_dist_version_exec____proc___select___version_n_texec__proc__n_n_t_tIF___ERROR____0__n_t_t_tGOTO_DONE_n_n_t_tIF_0____SELECT_PATINDEX___6.6___version___FROM_dist_version__n_t_t_tAND_0____SELECT_PATINDEX___7.___version___FROM_dist_version__n_t_t_tAND_0____SELECT_PATINDEX___8.___version___FROM_dist_version__n_t_tBEGIN_n_t_t_t__RAISERROR_You_have_to_upgrade_the_distributor__s_before_you_upgrade_the_replication.__n_t_t_t___t16___1___name__n_t_t_tSELECT__status___invalid_dist_version_n_t_t_tSELECT__dbname__NULL_n_t_t_tGOTO_DONE_n_t_tEND_n_tEND_t_n_n_t__n_t_Make_sure__n_t_1._Theres_no_replication_transactions_in_the_published_databases._n_t_2._All_the_subscriptions_are_activated_n_t_3._All_the_transactions_have_been_distributed_to_the_subscriber__n_t__n_n____SELECT__cmd___n____SELECT__cmd___cmd__DECLARE_hCreplupd_CURSOR_FOR__n____SELECT__cmd___cmd__SELECT_name_FROM_master..sysdatabases__n____SELECT__cmd___cmd__WHERE__category__1_____0_n____EXECUTE___cmd__n____OPEN_hCreplupd_n____FETCH_hCreplupd_INTO__name_n____WHILE____fetch_status_____1__n____BEGIN_n_t_tSELECT__proc___name__.dbo.sp_repltrans_n_n__n__97.06.08_tmc___Due_to_sqlbug_65_Bug:12265_this_does_not_work_pre_65_sp1.__Must_create_entire_call_and_exec_it_to_n__t_tforce_eval_of_local_vars_prior_to_eval_of_insert_into.._n__n_________INSERT_INTO_repl_trans_EXEC__proc_n__n_tselect__proc__insert_into_repl_trans_exec____proc_n_texec__proc__n_n_t_t__n_t_t_Note_retcode_is_not_set_by_this_ex_sp___n_t_t__n_t_tIF___ERROR____0__n_t_tBEGIN_n_t_t_tCLOSE_hCreplupd_n_t_t_tDEALLOCATE_hCreplupd_n_t_t_tGOTO_DONE_n_t_tEND_n_n_t_tIF_EXISTS__SELECT__FROM_repl_trans__n_t_tBEGIN_n_t_t_t__RAISERROR_There_are_replicated_transactions_left_in_the_published_database__s._Please_run__logreader_and_distribution_tasks_and_cleanup_the_distribution_databse.__n_t
call fcn.00401010
add esp, 4
push ebx
lea ecx, [ebp - 8]
mov edi, eax
mov eax, dword [esi + 0xa20]
mov edx, dword [eax]
push ecx
push edi
push eax
call dword [edx + 0x170]
mov ebx, eax
test ebx, ebx
setl byte [ebp - 1]
test edi, edi
je 0x403870
push edi
call sub.MSVCR71.dll_void___cdecl_operator_delete_void__
add esp, 4
mov al, byte [ebp - 1]
test al, al
je 0x40388e
push ebx
mov ecx, esi
call fcn.00403310
mov dword [esi + 0xa0c], 0xc
jmp case.0x403902.1
mov eax, dword [ebp - 8]
mov edx, dword [eax]
lea ecx, [ebp - 0x10]
push ecx
push eax
call dword [edx + 0x2c]
cmp dword [ebp - 0x10], 1
jne 0x40387f
mov eax, dword [ebp - 8]
mov edx, dword [eax]
lea ecx, [ebp - 0xc]
push ecx
push 0
push 0
push eax
call dword [edx + 0x40]
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
mov dword [esi + 0xa0c], edx
mov ecx, dword [eax]
lea edx, [ebp - 0x14]
push edx
push 1
push 0
push eax
call dword [ecx + 0x50]
mov eax, dword [ebp - 0x14]
test eax, eax
lea edi, [esi + 0xa24]
je 0x4038eb
push 0x80
push eax
push edi
call dword [sym.imp.MSVCR71.dll_wcsncpy]
add esp, 0xc
jmp 0x4038f0
mov word [edi], 0
mov ecx, dword [ebp - 0xc]
cmp ecx, 7
mov dword [esi + 0xa0c], ecx
ja case.0x403902.1
jmp dword [ecx*4 + 0x4039dc]
xor ebx, ebx
cmp word [edi], bx
mov edx, dword [esi + 0x2b28]
setne bl
push edi
lea eax, [esi + 0x2b28]
push ebx
xor ebx, ebx
cmp ecx, 2
setne bl
push ebx
push str.IsReplicationInstalled_d_IsDistributor_d_DistributionDB_s
push eax
call dword [edx + 0x10]
mov dword [esi + 0xa0c], 0
jmp 0x4039ae
push 0x6d62
push esi
call fcn.00402680
add esp, 8
jmp case.0x403902.1
push edi
push 0x6d63
push esi
call fcn.00402680
add esp, 0xc
jmp case.0x403902.1
push 0x6d64
push esi
call fcn.00402680
add esp, 8
jmp case.0x403902.1
push edi
push 0x6d65
push esi
call fcn.00402680
add esp, 0xc
jmp case.0x403902.1
push edi
push 0x6d66
push esi
call fcn.00402680
add esp, 0xc
jmp case.0x403902.1
mov ecx, dword [esi + 0x2b28]
push ebx
push ebx
push ebx
lea eax, [esi + 0x2b28]
push str.IsReplicationInstalled_d_IsDistributor_d_DistributionDB_s
push eax
call dword [ecx + 0x10]
mov dword [esi + 0xa0c], ebx
add esp, 0x14
mov eax, dword [ebp - 8]
test eax, eax
je 0x4039be
mov edx, dword [eax]
push eax
call dword [edx + 8]
mov eax, dword [ebp - 0x14]
test eax, eax
mov esi, dword [esi + 0xa0c]
je 0x4039d2
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret