rendered paste body.text:1043EA80 ; =============== S U B R O U T I N E =======================================
.text:1043EA80
.text:1043EA80
.text:1043EA80 sub_1043EA80 proc near ; CODE XREF: sub_1043F460+2Bj
.text:1043EA80 ; sub_1043F820+28p
.text:1043EA80
.text:1043EA80 arg_0 = dword ptr 4
.text:1043EA80
.text:1043EA80 push ebx
.text:1043EA81 push esi
.text:1043EA82 mov esi, eax
.text:1043EA84 mov eax, [esi+10h]
.text:1043EA87 mov ebx, [eax]
.text:1043EA89 mov eax, [esp+8+arg_0]
.text:1043EA8D add eax, 0FFFFFFFDh
.text:1043EA90 cmp eax, 4 ; switch 5 cases
.text:1043EA93 push edi
.text:1043EA94 ja loc_1043ED06 ; default
.text:1043EA94 ; jumptable 1043EA9A case 1
.text:1043EA9A jmp ds:off_1043ED24[eax*4] ; switch jump
.text:1043EAA1
.text:1043EAA1 loc_1043EAA1: ; DATA XREF: .text:off_1043ED24o
.text:1043EAA1 lea eax, [esi+15Ch] ; jumptable 1043EA9A case 0
.text:1043EAA7 call sub_1043E780
.text:1043EAAC movzx ecx, word ptr [esi+40h]
.text:1043EAB0 add ecx, 1
.text:1043EAB3 movzx eax, ax
.text:1043EAB6 and ecx, 0FFFFh
.text:1043EABC cmp ecx, eax
.text:1043EABE jz short loc_1043EB04
.text:1043EAC0 push eax
.text:1043EAC1 push offset aReceivedUnexpe ; "Received unexpected DATA packet block %"...
.text:1043EAC6 push ebx
.text:1043EAC7 call sub_104331F0
.text:1043EACC add dword ptr [esi+18h], 1
.text:1043EAD0 mov eax, [esi+18h]
.text:1043EAD3 add esp, 0Ch
.text:1043EAD6 cmp eax, [esi+20h]
.text:1043EAD9 jle loc_1043ED00
.text:1043EADF movzx edx, word ptr [esi+40h]
.text:1043EAE3 add edx, 1
.text:1043EAE6 and edx, 0FFFFh
.text:1043EAEC push edx
.text:1043EAED push offset aTftp_rxGivingU ; "tftp_rx: giving up waiting for block %d"...
.text:1043EAF2 push ebx
.text:1043EAF3 call sub_10433280
.text:1043EAF8 add esp, 0Ch
.text:1043EAFB pop edi
.text:1043EAFC pop esi
.text:1043EAFD mov eax, 47h
.text:1043EB02 pop ebx
.text:1043EB03 retn
.text:1043EB04 ; ---------------------------------------------------------------------------
.text:1043EB04
.text:1043EB04 loc_1043EB04: ; CODE XREF: sub_1043EA80+3Ej
.text:1043EB04 mov [esi+40h], ax
.text:1043EB08 lea edi, [esi+160h]
.text:1043EB0E mov eax, 4
.text:1043EB13 mov ecx, edi
.text:1043EB15 mov dword ptr [esi+18h], 0
.text:1043EB1C call sub_1043E750
.text:1043EB21 mov ax, [esi+40h]
.text:1043EB25 mov ecx, edi
.text:1043EB27 call sub_1043E760
.text:1043EB2C mov eax, [esi+148h]
.text:1043EB32 mov edx, [edi]
.text:1043EB34 push eax ; tolen
.text:1043EB35 mov eax, [esi+14h]
.text:1043EB38 lea ecx, [esi+0C8h]
.text:1043EB3E push ecx ; to
.text:1043EB3F push 0 ; flags
.text:1043EB41 push 4 ; len
.text:1043EB43 push edx ; buf
.text:1043EB44 push eax ; s
.text:1043EB45 call ds:sendto
.text:1043EB4B test eax, eax
.text:1043EB4D jge short loc_1043EB77
.text:1043EB4F call ds:__imp_WSAGetLastError
.text:1043EB55 mov ecx, [esi+10h]
.text:1043EB58 push eax
.text:1043EB59 push ecx
.text:1043EB5A call sub_1044F4B0
.text:1043EB5F push eax
.text:1043EB60 push offset aS_21 ; "%s"
.text:1043EB65 push ebx
.text:1043EB66 call sub_10433280
.text:1043EB6B add esp, 14h
.text:1043EB6E pop edi
.text:1043EB6F pop esi
.text:1043EB70 mov eax, 37h
.text:1043EB75 pop ebx
.text:1043EB76 retn
.text:1043EB77 ; ---------------------------------------------------------------------------
.text:1043EB77
.text:1043EB77 loc_1043EB77: ; CODE XREF: sub_1043EA80+CDj
.text:1043EB77 mov edx, [esi+154h]
.text:1043EB7D xor eax, eax
.text:1043EB7F add edx, 4
.text:1043EB82 cmp [esi+14Ch], edx
.text:1043EB88 setl al
.text:1043EB8B add esi, 38h
.text:1043EB8E push esi ; Time
.text:1043EB8F lea eax, [eax+eax+1]
.text:1043EB93 mov [esi-38h], eax
.text:1043EB96 call __time64
.text:1043EB9B add esp, 4
.text:1043EB9E pop edi
.text:1043EB9F pop esi
.text:1043EBA0 xor eax, eax
.text:1043EBA2 pop ebx
.text:1043EBA3 retn
.text:1043EBA4 ; ---------------------------------------------------------------------------
.text:1043EBA4
.text:1043EBA4 loc_1043EBA4: ; CODE XREF: sub_1043EA80+1Aj
.text:1043EBA4 ; DATA XREF: .text:off_1043ED24o
.text:1043EBA4 lea edi, [esi+160h] ; jumptable 1043EA9A case 3
.text:1043EBAA mov eax, 4
.text:1043EBAF mov ecx, edi
.text:1043EBB1 mov word ptr [esi+40h], 0
.text:1043EBB7 mov dword ptr [esi+18h], 0
.text:1043EBBE call sub_1043E750
.text:1043EBC3 mov ax, [esi+40h]
.text:1043EBC7 mov ecx, edi
.text:1043EBC9 call sub_1043E760
.text:1043EBCE mov ecx, [esi+148h]
.text:1043EBD4 mov eax, [edi]
.text:1043EBD6 push ecx ; tolen
.text:1043EBD7 mov ecx, [esi+14h]
.text:1043EBDA lea edx, [esi+0C8h]
.text:1043EBE0 push edx ; to
.text:1043EBE1 push 0 ; flags
.text:1043EBE3 push 4 ; len
.text:1043EBE5 push eax ; buf
.text:1043EBE6 push ecx ; s
.text:1043EBE7 call ds:sendto
.text:1043EBED test eax, eax
.text:1043EBEF jge short loc_1043EC19
.text:1043EBF1 call ds:__imp_WSAGetLastError
.text:1043EBF7 mov edx, [esi+10h]
.text:1043EBFA push eax
.text:1043EBFB push edx
.text:1043EBFC call sub_1044F4B0
.text:1043EC01 push eax
.text:1043EC02 push offset aS_21 ; "%s"
.text:1043EC07 push ebx
.text:1043EC08 call sub_10433280
.text:1043EC0D add esp, 14h
.text:1043EC10 pop edi
.text:1043EC11 pop esi
.text:1043EC12 mov eax, 37h
.text:1043EC17 pop ebx
.text:1043EC18 retn
.text:1043EC19 ; ---------------------------------------------------------------------------
.text:1043EC19
.text:1043EC19 loc_1043EC19: ; CODE XREF: sub_1043EA80+16Fj
.text:1043EC19 mov dword ptr [esi], 1
.text:1043EC1F add esi, 38h
.text:1043EC22 push esi ; Time
.text:1043EC23 call __time64
.text:1043EC28 add esp, 4
.text:1043EC2B pop edi
.text:1043EC2C pop esi
.text:1043EC2D xor eax, eax
.text:1043EC2F pop ebx
.text:1043EC30 retn
.text:1043EC31 ; ---------------------------------------------------------------------------
.text:1043EC31
.text:1043EC31 loc_1043EC31: ; CODE XREF: sub_1043EA80+1Aj
.text:1043EC31 ; DATA XREF: .text:off_1043ED24o
.text:1043EC31 add dword ptr [esi+18h], 1 ; jumptable 1043EA9A case 4
.text:1043EC35 mov eax, [esi+18h]
.text:1043EC38 push eax
.text:1043EC39 movzx eax, word ptr [esi+40h]
.text:1043EC3D add eax, 1
.text:1043EC40 and eax, 0FFFFh
.text:1043EC45 push eax
.text:1043EC46 push offset aTimeoutWaiting ; "Timeout waiting for block %d ACK. Retr"...
.text:1043EC4B push ebx
.text:1043EC4C call sub_104331F0
.text:1043EC51 mov ecx, [esi+18h]
.text:1043EC54 add esp, 10h
.text:1043EC57 cmp ecx, [esi+20h]
.text:1043EC5A jle short loc_1043EC6F
.text:1043EC5C pop edi
.text:1043EC5D mov dword ptr [esi+8], 0FFFFFF9Dh
.text:1043EC64 mov dword ptr [esi], 3
.text:1043EC6A pop esi
.text:1043EC6B xor eax, eax
.text:1043EC6D pop ebx
.text:1043EC6E retn
.text:1043EC6F ; ---------------------------------------------------------------------------
.text:1043EC6F
.text:1043EC6F loc_1043EC6F: ; CODE XREF: sub_1043EA80+1DAj
.text:1043EC6F mov edx, [esi+148h]
.text:1043EC75 mov ecx, [esi+160h]
.text:1043EC7B push edx ; tolen
.text:1043EC7C mov edx, [esi+14h]
.text:1043EC7F lea eax, [esi+0C8h]
.text:1043EC85 push eax ; to
.text:1043EC86 push 0 ; flags
.text:1043EC88 push 4 ; len
.text:1043EC8A push ecx ; buf
.text:1043EC8B push edx ; s
.text:1043EC8C call ds:sendto
.text:1043EC92 test eax, eax
.text:1043EC94 jge short loc_1043ED00
.text:1043EC96 call ds:__imp_WSAGetLastError
.text:1043EC9C push eax
.text:1043EC9D mov eax, [esi+10h]
.text:1043ECA0 push eax
.text:1043ECA1 call sub_1044F4B0
.text:1043ECA6 push eax
.text:1043ECA7 push offset aS_21 ; "%s"
.text:1043ECAC push ebx
.text:1043ECAD call sub_10433280
.text:1043ECB2 add esp, 14h
.text:1043ECB5 pop edi
.text:1043ECB6 pop esi
.text:1043ECB7 mov eax, 37h
.text:1043ECBC pop ebx
.text:1043ECBD retn
.text:1043ECBE ; ---------------------------------------------------------------------------
.text:1043ECBE
.text:1043ECBE loc_1043ECBE: ; CODE XREF: sub_1043EA80+1Aj
.text:1043ECBE ; DATA XREF: .text:off_1043ED24o
.text:1043ECBE lea edi, [esi+160h] ; jumptable 1043EA9A case 2
.text:1043ECC4 mov eax, 5
.text:1043ECC9 mov ecx, edi
.text:1043ECCB call sub_1043E750
.text:1043ECD0 mov ax, [esi+40h]
.text:1043ECD4 mov ecx, edi
.text:1043ECD6 call sub_1043E760
.text:1043ECDB mov ecx, [esi+148h]
.text:1043ECE1 mov eax, [edi]
.text:1043ECE3 push ecx ; tolen
.text:1043ECE4 mov ecx, [esi+14h]
.text:1043ECE7 lea edx, [esi+0C8h]
.text:1043ECED push edx ; to
.text:1043ECEE push 0 ; flags
.text:1043ECF0 push 4 ; len
.text:1043ECF2 push eax ; buf
.text:1043ECF3 push ecx ; s
.text:1043ECF4 call ds:sendto
.text:1043ECFA mov dword ptr [esi], 3
.text:1043ED00
.text:1043ED00 loc_1043ED00: ; CODE XREF: sub_1043EA80+59j
.text:1043ED00 ; sub_1043EA80+214j
.text:1043ED00 pop edi
.text:1043ED01 pop esi
.text:1043ED02 xor eax, eax
.text:1043ED04 pop ebx
.text:1043ED05 retn
.text:1043ED06 ; ---------------------------------------------------------------------------
.text:1043ED06
.text:1043ED06 loc_1043ED06: ; CODE XREF: sub_1043EA80+14j
.text:1043ED06 ; sub_1043EA80+1Aj
.text:1043ED06 ; DATA XREF: ...
.text:1043ED06 push offset aTftp_rxInterna ; default
.text:1043ED06 ; jumptable 1043EA9A case 1
.text:1043ED0B push offset aS_21 ; "%s"
.text:1043ED10 push ebx
.text:1043ED11 call sub_10433280
.text:1043ED16 add esp, 0Ch
.text:1043ED19 pop edi
.text:1043ED1A pop esi
.text:1043ED1B mov eax, 47h
.text:1043ED20 pop ebx
.text:1043ED21 retn
.text:1043ED21 sub_1043EA80 endp
.text:1043ED21
.text:1043ED21 ; ---------------------------------------------------------------------------
.text:1043ED22 align 4
.text:1043ED24 off_1043ED24 dd offset loc_1043EAA1 ; DATA XREF: sub_1043EA80+1Ar
.text:1043ED24 dd offset loc_1043ED06 ; jump table for switch statement
.text:1043ED24 dd offset loc_1043ECBE
.text:1043ED24 dd offset loc_1043EBA4
.text:1043ED24 dd offset loc_1043EC31
.text:1043ED38 align 10h
.text:1043ED40