Function at 0x477e2c
Capabilities:
Reference sql statements
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x5f4
mov eax, dword [0x5385d0]
xor eax, esp
mov dword [esp + 0x5f0], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
xor esi, esi
cmp eax, esi
push edi
mov dword [esp + 0x3c], eax
mov dword [esp + 0x38], ecx
mov dword [esp + 0x18], esi
je 0x4785e9
cmp ebx, esi
je 0x4785e9
mov eax, dword [ebx + 0x14]
call fcn.004536ec
xor eax, eax
mov word [esp + 0x58], si
lea edi, [esp + 0x5a]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 0x3ff
stosw word es:[edi], ax
lea eax, [esp + 0x1fd]
push esi
push eax
mov byte [esp + 0x204], 0
call fcn.004b7880
add esp, 0xc
push 0x7f
lea eax, [esp + 0x7d]
push esi
push eax
mov byte [esp + 0x84], 0
call fcn.004b7880
add esp, 0xc
push 0xff
lea eax, [esp + 0xfd]
push esi
push eax
mov byte [esp + 0x104], 0
call fcn.004b7880
add esp, 0xc
mov dword [esp + 0x1c], esi
call fcn.00479d51
call fcn.00479d78
cmp dword [ebx + 0x2f94], esi
jne 0x477efd
mov eax, dword [ebx + 0x14]
call fcn.00483f18
mov dword [ebx + 0x14], esi
push esi
call fcn.00479049
test eax, eax
mov eax, dword [ebx + 0x14]
pop ecx
je 0x477f29
call fcn.004536ec
test eax, eax
je 0x4785e9
push dword [ebx + 0x14]
call fcn.00452f92
pop ecx
mov dword [ebx + 0x14], esi
jmp 0x4785e9
call fcn.004536ec
test eax, eax
jne 0x477f49
push esi
call fcn.0045412c
mov dword [ebx + 0x14], eax
xor eax, eax
inc eax
pop ecx
mov dword [ebx + 0x2f94], eax
mov dword [esp + 0x1c], eax
mov ecx, dword [ebx + 0x14]
cmp ecx, esi
jne 0x477f60
push str.:5:Need_to_handle_TAMS_II_SA7_login_failure_
call fcn.00418e96
pop ecx
jmp 0x4785e9
call fcn.004a6f2e
push 0xc02
lea eax, [esp + 0x5c]
push str..ServerPAULA.c
push eax
call fcn.004a77ec
push ecx
lea esi, [esp + 0x68]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004a5bcf
mov dword [esp + 0x20], eax
mov byte [esp + 0x23], 1
mov eax, dword [esp + 0x20]
mov dword [esp + 0x1c], eax
shr eax, 0x10
add esp, 0x10
inc al
cmp al, 0xc
mov byte [esp + 0xe], al
jbe 0x477fb4
inc word [esp + 0xc]
mov byte [esp + 0xe], 1
mov esi, str.SALES_YEAR_MONTH_ACCOUNTING_DAY_GROSS_CASH_SALES_GROSS_CHARGE_SALES_NET_SALES_RETURNS_RETURNS_COST_MISCELLANEOUS_ADJUSTMENTS_INVOICE_COUNT_VOID_AMOUNT_VOID_COUNT_RECEIVED_ON_ACCOUNT_ROA_DISCOUNT_TAKEN_JOURNAL_ENTRIES_SALES_COST_FREIGHT_CHARGES
push 0x2c
mov edx, esi
call fcn.0047ee53
pop ecx
mov ecx, dword [ebx + 0x14]
inc eax
mov dword [esp + 0x40], eax
call fcn.0045440b
and dword [esp + 0x20], 0
cmp dword [0x53979c], 0
mov dword [esp + 0x14], eax
je 0x478020
push dword [esp + 0x14]
movzx ecx, byte [esp + 0x13]
mov eax, dword [0x53979c]
push ecx
movzx ecx, byte [esp + 0x16]
inc dword [0x53979c]
push ecx
movzx ecx, word [esp + 0x18]
push ecx
movzx ecx, byte [esp + 0x22]
push 1
push ecx
movzx ecx, word [esp + 0x28]
push ecx
push esi
push eax
push str.SA7_DBG__d:_SET_ROWCOUNT_1_SELECT__s_FROM_STORE_DAILY_SALES_WHERE__SALES_YEAR_MONTH_04d__02d__02d_OR_SALES_YEAR_MONTH_04d__02d__02d__AND_LOC_d_ORDER_BY_SALES_YEAR_MONTH_DESC__ACCOUNTING_DAY_DESC
call fcn.0041936e
add esp, 0x28
push dword [esp + 0x14]
movzx edi, byte [esp + 0x13]
movzx eax, byte [esp + 0x12]
movzx ecx, word [esp + 0x10]
movzx edx, word [esp + 0x14]
push edi
push eax
movzx eax, byte [esp + 0x1e]
push ecx
push 1
push eax
push edx
push esi
push str.SET_ROWCOUNT_1_SELECT__s_FROM_STORE_DAILY_SALES_WHERE__SALES_YEAR_MONTH_04d__02d__02d_OR_SALES_YEAR_MONTH_04d__02d__02d__AND_LOC_d_ORDER_BY_SALES_YEAR_MONTH_DESC__ACCOUNTING_DAY_DESC
push dword [ebx + 0x14]
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x5c], edx
call fcn.00453375
add esp, 0x28
test eax, eax
je 0x478414
push dword [esp + 0x40]
lea eax, [esp + 0x1fc]
push 9
push 0x3ff
push eax
push dword [ebx + 0x14]
call fcn.00453475
add esp, 0x14
test eax, eax
mov esi, ebx
je 0x4780c1
lea eax, [esp + 0x1f8]
call fcn.00477ca3
test eax, eax
mov dword [esp + 0xc], eax
jne 0x4780cc
lea eax, [esp + 0x1f8]
push eax
push str.:5:RefreshSales___EAP:_Sales_line___s__is_invalid.
lea eax, [esp + 0x100]
push 0x100
push eax
call fcn.00480225
add esp, 0x10
jmp 0x4780cc
xor eax, eax
call fcn.00477ca3
mov dword [esp + 0xc], eax
cmp dword [0x53979c], 0
je 0x4780f6
mov eax, dword [0x53979c]
inc dword [0x53979c]
lea ecx, [esp + 0x1f8]
push ecx
push eax
push str.SA7_DBG__d:__s
call fcn.0041936e
add esp, 0xc
cmp dword [esp + 0xc], 0
jle 0x4782ed
mov edi, str.EOD_STARTED_DATE_NEW_DAY_STARTED_DATE_SALES_YEAR_MONTH_ACCT_DAY_STARTED_BY_IP_ADDRESS_STARTED_BY_EMPLOYEE_ID
push 0x2c
mov edx, edi
call fcn.0047ee53
mov esi, eax
inc esi
cmp dword [0x53979c], 0
pop ecx
je 0x47813a
push dword [esp + 0x14]
mov eax, dword [0x53979c]
inc dword [0x53979c]
push edi
push eax
push str.SA7_DBG__d:_SET_ROWCOUNT_1_SELECT__s_FROM_END_OF_DAY_MONITOR_WHERE_LOC_d_AND_EOD_STARTED_DATE_SELECT_MAX_EOD_STARTED_DATE__FROM_END_OF_DAY_MONITOR_
call fcn.0041936e
add esp, 0x10
push dword [esp + 0x14]
push edi
push str.SET_ROWCOUNT_1_SELECT__s_FROM_END_OF_DAY_MONITOR_WHERE_LOC_d_AND_EOD_STARTED_DATE_SELECT_MAX_EOD_STARTED_DATE__FROM_END_OF_DAY_MONITOR_
push dword [ebx + 0x14]
call fcn.00453375
add esp, 0x10
test eax, eax
je 0x4783ef
and word [esp + 0x24], 0
and word [esp + 0x48], 0
xor eax, eax
lea edi, [esp + 0x26]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
and dword [esp + 0x14], 0
stosw word es:[edi], ax
xor eax, eax
lea edi, [esp + 0x4a]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push esi
push 9
stosw word es:[edi], ax
push 0x3ff
lea eax, [esp + 0x204]
push eax
push dword [ebx + 0x14]
call fcn.00453475
add esp, 0x14
test eax, eax
je 0x478265
and dword [esp + 0x10], 0
lea eax, [esp + 0x1f8]
push eax
mov ecx, 0x80
lea eax, [esp + 0x7c]
call fcn.0047ebe1
cmp dword [0x53979c], 0
pop ecx
je 0x4781e7
mov eax, dword [0x53979c]
inc dword [0x53979c]
lea ecx, [esp + 0x1f8]
push ecx
push eax
push str.SA7_DBG__d:__s
call fcn.0041936e
add esp, 0xc
lea eax, [esp + 0x10]
lea ecx, [esp + 0x1f8]
call fcn.00480529
push eax
lea eax, [esp + 0x6c]
push eax
call fcn.004a65f8
mov esi, eax
lea edi, [esp + 0x2c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [esp + 0x18]
xor ecx, ecx
movsd dword es:[edi], dword [esi]
call fcn.00480529
push eax
lea eax, [esp + 0x74]
push eax
call fcn.004a65f8
mov esi, eax
lea edi, [esp + 0x58]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [esp + 0x20]
xor ecx, ecx
movsd dword es:[edi], dword [esi]
call fcn.00480529
lea eax, [esp + 0x20]
xor ecx, ecx
call fcn.00480529
push eax
call fcn.00440754
mov dword [esp + 0x28], eax
add esp, 0x14
lea eax, [esp + 0x10]
xor ecx, ecx
call fcn.00480529
lea eax, [esp + 0x10]
xor ecx, ecx
call fcn.00480529
push 0
sub esp, 0x10
lea esi, [esp + 0x38]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004a5c6f
add esp, 0x14
test eax, eax
jne 0x47832a
push eax
sub esp, 0x10
lea esi, [esp + 0x5c]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004a5c6f
add esp, 0x14
test eax, eax
jne 0x47832a
lea eax, [esp + 0x78]
push eax
sub esp, 0x10
lea esi, [esp + 0x5c]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004a69b7
add esp, 0x10
push eax
sub esp, 0x10
lea esi, [esp + 0x3c]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004a69b7
add esp, 0x10
push eax
push str.:7:RefreshSales___EAP:_Sales_CANNOT_be_posted:_stEODTime___s__stNewDayTime___s:__s
lea eax, [esp + 0x108]
push 0x100
push eax
call fcn.00480225
add esp, 0x18
cmp dword [esp + 0x1c], 0
jne 0x4785cf
push dword [ebx + 0x14]
call fcn.00452f92
and dword [ebx + 0x14], 0
pop ecx
lea eax, [esp + 0x78]
push eax
push str.:5:RefreshSales___EOP:_The_recycled_connection_failed._Trying_again_with_new_connection...___s
call fcn.00418e96
push dword [esp + 0x40]
push ebx
push dword [esp + 0x4c]
call fcn.00477e2c
add esp, 0x14
jmp 0x4785eb
mov eax, dword [esp + 0xc]
push 0xc7b
mov dword [esp + 0x24], eax
lea eax, [ebx + 0x4c]
push str..ServerPAULA.c
push eax
call fcn.004a77ec
movzx eax, word [esp + 0x34]
lea edi, [ebx + 0x5c]
lea esi, [esp + 0x30]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
shl eax, 4
lea edi, [eax + ebx + 0x2f9c]
lea esi, [esp + 0x30]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
push ecx
lea esi, [esp + 0x58]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004a5d92
add esp, 0x10
test eax, eax
jne 0x4783e5
sub esp, 0x10
mov edi, esp
lea esi, [esp + 0x34]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
sub esp, 0x10
lea esi, [esp + 0x68]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004a5f2c
add esp, 0x20
test eax, eax
jne 0x4783e5
and dword [esp + 0x18], eax
mov eax, dword [esp + 0x14]
cmp eax, dword [esp + 0xc]
jg 0x4783c6
cmp eax, 1
jne 0x47844e
cmp dword [esp + 0xc], 0x14
jle 0x47844e
push str.Yesterday_sales_catch_test.
lea eax, [esp + 0xfc]
push 0x100
push eax
call fcn.00480225
add esp, 0xc
jmp 0x4782ed
mov dword [esp + 0x18], 1
jmp 0x47844e
lea eax, [esp + 0x78]
push eax
push dword [esp + 0x18]
lea eax, [esp + 0x100]
push str.:7:RefreshSales___EAP:_ExecuteODBCFormat_LOC_d__FAILED:_EOD_cannot_be_determined:__s
push 0x100
push eax
call fcn.00480225
add esp, 0x14
jmp 0x47844e
lea eax, [esp + 0x78]
push eax
push dword [esp + 0x18]
movzx eax, byte [esp + 0x16]
push edi
push eax
push dword [esp + 0x54]
movzx eax, byte [esp + 0x26]
push 1
push eax
push dword [esp + 0x50]
lea eax, [esp + 0x118]
push str.:7:RefreshSales___EAP:_OUTER_ExecuteODBCFormat__SALES_YEAR_MONTH_04d__02d__02d_OR_SALES_YEAR_MONTH_04d__02d__02d__AND_LOC_d_FAILED:__s
push 0x100
push eax
call fcn.00480225
add esp, 0x2c
cmp dword [esp + 0x20], 0
jle 0x4782ed
xor edi, edi
inc edi
xor esi, esi
cmp dword [esp + 0x18], esi
mov dword [ebx + 0x2f90], edi
je 0x478502
cmp dword [ebx + 0x2f98], esi
jne 0x4785c4
cmp dword [ebx + 0x44], esi
je 0x4784df
cmp dword [ebx + 0x38], esi
je 0x4784df
mov ecx, ebx
call fcn.00479181
call fcn.00479175
test eax, eax
je 0x4784cd
mov eax, ebx
call fcn.00477c7f
mov ecx, ebx
call fcn.00479181
test eax, eax
jne 0x4784b7
lea eax, [esp + 0x78]
push eax
push str.:8:RefreshSales___Critical_Exception_:_PostSales___says_EOD_has_NOT_been_encountered__This_will_result_in_EOD_never_being_posted___s
call fcn.00418e96
pop ecx
pop ecx
push str.:0:FYI:_End_Of_Day_process_has_begun.__TAMS_II_
mov dword [ebx + 0x2f98], edi
call fcn.0041936e
pop ecx
jmp 0x4785c4
lea eax, [esp + 0x78]
push eax
push str.:5:RefreshSales___EAP:_End_of_Day_process_has_begun__but_the_initial_PostSalesResult___FAILED:_EOD_cannot_be_posted._Another_attempt_will_be_made:__s
call fcn.00418e96
pop ecx
jmp 0x4784c7
lea eax, [esp + 0x78]
push eax
push str.:2:RefreshSales___EAP:_EOD_has_been_detected_from_zero_sales.__This_may_happen_when_the_server_is_started_after_EOD.__EOD_has_been_ignored:__s
call fcn.0041936e
pop ecx
pop ecx
mov eax, ebx
call fcn.00477c7f
mov dword [ebx + 0x2f98], edi
jmp 0x4785c4
mov ecx, ebx
mov dword [ebx + 0x2f98], esi
call fcn.00479181
test eax, eax
je 0x4785c4
lea eax, [esp + 0x78]
push eax
push dword [ebx + 0x38]
call fcn.0044068d
pop ecx
push eax
push str.:9:RefreshSales___Critical_Exception_:_PostSales___says_EOD_has_been_encountered__This_should_never_happen._NetSales___s:__s
call fcn.00418e96
movzx eax, word [0x63f160]
add esp, 0xc
push dword [0x63f164]
push eax
movzx eax, word [0x63f15c]
push eax
push dword [0x63c14c]
movzx eax, word [0x639192]
push eax
movzx eax, word [0x63c1a2]
push eax
push dword [0x639188]
push dword [0x63c198]
push dword [0x639184]
push dword [0x63c194]
push dword [0x639178]
call fcn.0044068d
pop ecx
push eax
push dword [0x63c188]
call fcn.0044068d
pop ecx
push eax
push dword [0x63c0d0]
push dword [0x63f0e0]
push esi
sub esp, 0x10
mov esi, 0x639130
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004a6475
add esp, 0x14
push eax
push str.:9:RefreshSales___DEBUG:_SnapShot_at__s:_bIsTAMSii_d__d__tNetSales_s__s__iNumInvoices_d__d__iNumVoids_d__d__wDay_d__d:_STATICS:_dwTimeLastParse_d__wLastDayParsed_d__wLastDayEOD_d__iNumTimesInitTried_d
call fcn.00418e96
add esp, 0x40
xor esi, esi
xor eax, eax
mov dword [0x53979c], esi
inc eax
jmp 0x4785eb
lea eax, [esp + 0x78]
push eax
lea eax, [esp + 0xfc]
push eax
push str.:5:FYI:_TAMSii_SA7_FAILED:__s:__s
call fcn.00418e96
add esp, 0xc
xor eax, eax
mov ecx, dword [esp + 0x5fc]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004b7140
mov esp, ebp
pop ebp
ret