rendered paste body.text:1043ED40 ; =============== S U B R O U T I N E =======================================
.text:1043ED40
.text:1043ED40
.text:1043ED40 sub_1043ED40 proc near ; CODE XREF: sub_1043F420+30p
.text:1043ED40 ; sub_1043F820+35p
.text:1043ED40 mov eax, [esi+10h]
.text:1043ED43 push ebx
.text:1043ED44 push ebp
.text:1043ED45 push edi
.text:1043ED46 mov edi, [eax]
.text:1043ED48 lea eax, [ecx-4]
.text:1043ED4B xor ebx, ebx
.text:1043ED4D cmp eax, 3 ; switch 4 cases
.text:1043ED50 ja loc_1043F00C ; default
.text:1043ED56 jmp ds:off_1043F024[eax*4] ; switch jump
.text:1043ED5D
.text:1043ED5D loc_1043ED5D: ; DATA XREF: .text:off_1043F024o
.text:1043ED5D cmp ecx, 4 ; jumptable 1043ED56 cases 0,2
.text:1043ED60 jnz loc_1043EE3C
.text:1043ED66 lea eax, [esi+15Ch]
.text:1043ED6C call sub_1043E780
.text:1043ED71 movzx edx, word ptr [esi+40h]
.text:1043ED75 movzx eax, ax
.text:1043ED78 movzx ecx, dx
.text:1043ED7B cmp eax, ecx
.text:1043ED7D jz loc_1043EE25
.text:1043ED83 cmp dx, bx
.text:1043ED86 jnz short loc_1043ED93
.text:1043ED88 cmp eax, 0FFFFh
.text:1043ED8D jz loc_1043EE25
.text:1043ED93
.text:1043ED93 loc_1043ED93: ; CODE XREF: sub_1043ED40+46j
.text:1043ED93 push ecx
.text:1043ED94 push eax
.text:1043ED95 push offset aReceivedAckFor ; "Received ACK for block %d, expecting %d"...
.text:1043ED9A push edi
.text:1043ED9B call sub_104331F0
.text:1043EDA0 add dword ptr [esi+18h], 1
.text:1043EDA4 mov eax, [esi+18h]
.text:1043EDA7 add esp, 10h
.text:1043EDAA cmp eax, [esi+20h]
.text:1043EDAD jle short loc_1043EDCD
.text:1043EDAF movzx ecx, word ptr [esi+40h]
.text:1043EDB3 push ecx
.text:1043EDB4 push offset aTftp_txGivingU ; "tftp_tx: giving up waiting for block %d"...
.text:1043EDB9 push edi
.text:1043EDBA call sub_10433280
.text:1043EDBF add esp, 0Ch
.text:1043EDC2 pop edi
.text:1043EDC3 mov ebx, 37h
.text:1043EDC8 pop ebp
.text:1043EDC9 mov eax, ebx
.text:1043EDCB pop ebx
.text:1043EDCC retn
.text:1043EDCD ; ---------------------------------------------------------------------------
.text:1043EDCD
.text:1043EDCD loc_1043EDCD: ; CODE XREF: sub_1043ED40+6Dj
.text:1043EDCD mov edx, [esi+148h]
.text:1043EDD3 mov ecx, [esi+150h]
.text:1043EDD9 push edx ; tolen
.text:1043EDDA lea eax, [esi+0C8h]
.text:1043EDE0 push eax ; to
.text:1043EDE1 mov eax, [esi+14h]
.text:1043EDE4 push ebx ; flags
.text:1043EDE5 add ecx, 4
.text:1043EDE8 push ecx ; len
.text:1043EDE9 lea edx, [esi+160h]
.text:1043EDEF push edx ; buf
.text:1043EDF0 push eax ; s
.text:1043EDF1 call ds:sendto
.text:1043EDF7 test eax, eax
.text:1043EDF9 jge short loc_1043EE1F
.text:1043EDFB call ds:__imp_WSAGetLastError
.text:1043EE01 mov ecx, [esi+10h]
.text:1043EE04 push eax
.text:1043EE05 push ecx
.text:1043EE06 call sub_1044F4B0
.text:1043EE0B push eax
.text:1043EE0C push offset aS_21 ; "%s"
.text:1043EE11 push edi
.text:1043EE12 call sub_10433280
.text:1043EE17 add esp, 14h
.text:1043EE1A mov ebx, 37h
.text:1043EE1F
.text:1043EE1F loc_1043EE1F: ; CODE XREF: sub_1043ED40+B9j
.text:1043EE1F pop edi
.text:1043EE20 pop ebp
.text:1043EE21 mov eax, ebx
.text:1043EE23 pop ebx
.text:1043EE24 retn
.text:1043EE25 ; ---------------------------------------------------------------------------
.text:1043EE25
.text:1043EE25 loc_1043EE25: ; CODE XREF: sub_1043ED40+3Dj
.text:1043EE25 ; sub_1043ED40+4Dj
.text:1043EE25 lea edx, [esi+38h]
.text:1043EE28 push edx ; Time
.text:1043EE29 call __time64
.text:1043EE2E mov ebp, 1
.text:1043EE33 add esp, 4
.text:1043EE36 add [esi+40h], bp
.text:1043EE3A jmp short loc_1043EE45
.text:1043EE3C ; ---------------------------------------------------------------------------
.text:1043EE3C
.text:1043EE3C loc_1043EE3C: ; CODE XREF: sub_1043ED40+20j
.text:1043EE3C mov ebp, 1
.text:1043EE41 mov [esi+40h], bp
.text:1043EE45
.text:1043EE45 loc_1043EE45: ; CODE XREF: sub_1043ED40+FAj
.text:1043EE45 mov [esi+18h], ebx
.text:1043EE48 lea ebx, [esi+160h]
.text:1043EE4E mov eax, 3
.text:1043EE53 mov ecx, ebx
.text:1043EE55 call sub_1043E750
.text:1043EE5A mov ax, [esi+40h]
.text:1043EE5E mov ecx, ebx
.text:1043EE60 call sub_1043E760
.text:1043EE65 cmp [esi+40h], bp
.text:1043EE69 jbe short loc_1043EE7D
.text:1043EE6B mov eax, [esi+150h]
.text:1043EE71 cmp eax, [esi+154h]
.text:1043EE77 jl loc_1043F000
.text:1043EE7D
.text:1043EE7D loc_1043EE7D: ; CODE XREF: sub_1043ED40+129j
.text:1043EE7D mov ecx, [esi+154h]
.text:1043EE83 mov edx, [esi+10h]
.text:1043EE86 lea ebp, [esi+150h]
.text:1043EE8C push ebp
.text:1043EE8D push ecx
.text:1043EE8E push edx
.text:1043EE8F call sub_1042F2A0
.text:1043EE94 add esp, 0Ch
.text:1043EE97 test eax, eax
.text:1043EE99 jnz loc_1043F01D
.text:1043EE9F mov eax, [esi+148h]
.text:1043EEA5 mov edx, [ebp+0]
.text:1043EEA8 push eax ; tolen
.text:1043EEA9 mov eax, [ebx]
.text:1043EEAB lea ecx, [esi+0C8h]
.text:1043EEB1 push ecx ; to
.text:1043EEB2 mov ecx, [esi+14h]
.text:1043EEB5 push 0 ; flags
.text:1043EEB7 add edx, 4
.text:1043EEBA push edx ; len
.text:1043EEBB push eax ; buf
.text:1043EEBC push ecx ; s
.text:1043EEBD call ds:sendto
.text:1043EEC3 test eax, eax
.text:1043EEC5 jge short loc_1043EEEF
.text:1043EEC7 call ds:__imp_WSAGetLastError
.text:1043EECD mov edx, [esi+10h]
.text:1043EED0 push eax
.text:1043EED1 push edx
.text:1043EED2 call sub_1044F4B0
.text:1043EED7 push eax
.text:1043EED8 push offset aS_21 ; "%s"
.text:1043EEDD push edi
.text:1043EEDE call sub_10433280
.text:1043EEE3 add esp, 14h
.text:1043EEE6 pop edi
.text:1043EEE7 pop ebp
.text:1043EEE8 mov eax, 37h
.text:1043EEED pop ebx
.text:1043EEEE retn
.text:1043EEEF ; ---------------------------------------------------------------------------
.text:1043EEEF
.text:1043EEEF loc_1043EEEF: ; CODE XREF: sub_1043ED40+185j
.text:1043EEEF mov eax, [ebp+0]
.text:1043EEF2 cdq
.text:1043EEF3 add [edi+40h], eax
.text:1043EEF6 mov ecx, [edi+40h]
.text:1043EEF9 adc [edi+44h], edx
.text:1043EEFC mov eax, [edi+44h]
.text:1043EEFF push eax
.text:1043EF00 push ecx
.text:1043EF01 push edi
.text:1043EF02 call sub_10438C80
.text:1043EF07 add esp, 0Ch
.text:1043EF0A pop edi
.text:1043EF0B pop ebp
.text:1043EF0C xor eax, eax
.text:1043EF0E pop ebx
.text:1043EF0F retn
.text:1043EF10 ; ---------------------------------------------------------------------------
.text:1043EF10
.text:1043EF10 loc_1043EF10: ; CODE XREF: sub_1043ED40+16j
.text:1043EF10 ; DATA XREF: .text:off_1043F024o
.text:1043EF10 movzx edx, word ptr [esi+40h] ; jumptable 1043ED56 case 3
.text:1043EF14 mov ebp, 1
.text:1043EF19 add [esi+18h], ebp
.text:1043EF1C mov eax, [esi+18h]
.text:1043EF1F push eax
.text:1043EF20 add edx, ebp
.text:1043EF22 and edx, 0FFFFh
.text:1043EF28 push edx
.text:1043EF29 push offset aTimeoutWaiting ; "Timeout waiting for block %d ACK. Retr"...
.text:1043EF2E push edi
.text:1043EF2F call sub_104331F0
.text:1043EF34 mov eax, [esi+18h]
.text:1043EF37 add esp, 10h
.text:1043EF3A cmp eax, [esi+20h]
.text:1043EF3D jle short loc_1043EF52
.text:1043EF3F pop edi
.text:1043EF40 pop ebp
.text:1043EF41 mov dword ptr [esi+8], 0FFFFFF9Dh
.text:1043EF48 mov dword ptr [esi], 3
.text:1043EF4E xor eax, eax
.text:1043EF50 pop ebx
.text:1043EF51 retn
.text:1043EF52 ; ---------------------------------------------------------------------------
.text:1043EF52
.text:1043EF52 loc_1043EF52: ; CODE XREF: sub_1043ED40+1FDj
.text:1043EF52 mov ecx, [esi+148h]
.text:1043EF58 mov eax, [esi+150h]
.text:1043EF5E push ecx ; tolen
.text:1043EF5F mov ecx, [esi+160h]
.text:1043EF65 lea edx, [esi+0C8h]
.text:1043EF6B push edx ; to
.text:1043EF6C mov edx, [esi+14h]
.text:1043EF6F push ebx ; flags
.text:1043EF70 add eax, 4
.text:1043EF73 push eax ; len
.text:1043EF74 push ecx ; buf
.text:1043EF75 push edx ; s
.text:1043EF76 call ds:sendto
.text:1043EF7C test eax, eax
.text:1043EF7E jge short loc_1043EFA8
.text:1043EF80 call ds:__imp_WSAGetLastError
.text:1043EF86 push eax
.text:1043EF87 mov eax, [esi+10h]
.text:1043EF8A push eax
.text:1043EF8B call sub_1044F4B0
.text:1043EF90 push eax
.text:1043EF91 push offset aS_21 ; "%s"
.text:1043EF96 push edi
.text:1043EF97 call sub_10433280
.text:1043EF9C add esp, 14h
.text:1043EF9F pop edi
.text:1043EFA0 pop ebp
.text:1043EFA1 mov eax, 37h
.text:1043EFA6 pop ebx
.text:1043EFA7 retn
.text:1043EFA8 ; ---------------------------------------------------------------------------
.text:1043EFA8
.text:1043EFA8 loc_1043EFA8: ; CODE XREF: sub_1043ED40+23Ej
.text:1043EFA8 mov ecx, [edi+44h]
.text:1043EFAB mov edx, [edi+40h]
.text:1043EFAE push ecx
.text:1043EFAF push edx
.text:1043EFB0 push edi
.text:1043EFB1 call sub_10438C80
.text:1043EFB6 add esp, 0Ch
.text:1043EFB9 pop edi
.text:1043EFBA pop ebp
.text:1043EFBB xor eax, eax
.text:1043EFBD pop ebx
.text:1043EFBE retn
.text:1043EFBF ; ---------------------------------------------------------------------------
.text:1043EFBF
.text:1043EFBF loc_1043EFBF: ; CODE XREF: sub_1043ED40+16j
.text:1043EFBF ; DATA XREF: .text:off_1043F024o
.text:1043EFBF lea edi, [esi+160h] ; jumptable 1043ED56 case 1
.text:1043EFC5 mov eax, 5
.text:1043EFCA mov ecx, edi
.text:1043EFCC mov dword ptr [esi], 3
.text:1043EFD2 call sub_1043E750
.text:1043EFD7 mov ax, [esi+40h]
.text:1043EFDB mov ecx, edi
.text:1043EFDD call sub_1043E760
.text:1043EFE2 mov eax, [esi+148h]
.text:1043EFE8 mov edx, [edi]
.text:1043EFEA push eax ; tolen
.text:1043EFEB mov eax, [esi+14h]
.text:1043EFEE lea ecx, [esi+0C8h]
.text:1043EFF4 push ecx ; to
.text:1043EFF5 push ebx ; flags
.text:1043EFF6 push 4 ; len
.text:1043EFF8 push edx ; buf
.text:1043EFF9 push eax ; s
.text:1043EFFA call ds:sendto
.text:1043F000
.text:1043F000 loc_1043F000: ; CODE XREF: sub_1043ED40+137j
.text:1043F000 pop edi
.text:1043F001 pop ebp
.text:1043F002 mov dword ptr [esi], 3
.text:1043F008 xor eax, eax
.text:1043F00A pop ebx
.text:1043F00B retn
.text:1043F00C ; ---------------------------------------------------------------------------
.text:1043F00C
.text:1043F00C loc_1043F00C: ; CODE XREF: sub_1043ED40+10j
.text:1043F00C push ecx ; default
.text:1043F00D push offset aTftp_txInterna ; "tftp_tx: internal error, event: %i"
.text:1043F012 push edi
.text:1043F013 call sub_10433280
.text:1043F018 add esp, 0Ch
.text:1043F01B xor eax, eax
.text:1043F01D
.text:1043F01D loc_1043F01D: ; CODE XREF: sub_1043ED40+159j
.text:1043F01D pop edi
.text:1043F01E pop ebp
.text:1043F01F pop ebx
.text:1043F020 retn
.text:1043F020 sub_1043ED40 endp
.text:1043F020
.text:1043F020 ; ---------------------------------------------------------------------------
.text:1043F021 align 4
.text:1043F024 off_1043F024 dd offset loc_1043ED5D ; DATA XREF: sub_1043ED40+16r
.text:1043F024 dd offset loc_1043EFBF ; jump table for switch statement
.text:1043F024 dd offset loc_1043ED5D
.text:1043F024 dd offset loc_1043EF10
.text:1043F034 align 10h
.text:1043F040
.text:1043F040 loc_1043F040: ; CODE XREF: .text:1043F2E8j
.text:1043F040 ; .text:1043FEBAj
.text:1043F040 cmp eax, 0FFFFFF9Ch
.text:1043F043 jz short loc_1043F097
.text:1043F045 add eax, 63h
.text:1043F048 cmp eax, 6Ah ; switch 107 cases
.text:1043F04B ja short loc_1043F091 ; default
.text:1043F04B ; jumptable 1043F054 cases 2-98
.text:1043F04D movzx eax, ds:byte_1043F0C4[eax]
.text:1043F054 jmp ds:off_1043F09C[eax*4] ; switch jump
.text:1043F05B
.text:1043F05B loc_1043F05B: ; DATA XREF: .text:off_1043F09Co
.text:1043F05B mov eax, 44h ; jumptable 1043F054 case 100
.text:1043F060 retn
.text:1043F061 ; ---------------------------------------------------------------------------
.text:1043F061
.text:1043F061 loc_1043F061: ; CODE XREF: .text:1043F054j
.text:1043F061 ; DATA XREF: .text:off_1043F09Co
.text:1043F061 mov eax, 45h ; jumptable 1043F054 case 101
.text:1043F066 retn
.text:1043F067 ; ---------------------------------------------------------------------------
.text:1043F067
.text:1043F067 loc_1043F067: ; CODE XREF: .text:1043F054j
.text:1043F067 ; DATA XREF: .text:off_1043F09Co
.text:1043F067 mov eax, 46h ; jumptable 1043F054 case 102
.text:1043F06C retn
.text:1043F06D ; ---------------------------------------------------------------------------
.text:1043F06D
.text:1043F06D loc_1043F06D: ; CODE XREF: .text:1043F054j
.text:1043F06D ; DATA XREF: .text:off_1043F09Co
.text:1043F06D mov eax, 47h ; jumptable 1043F054 cases 99,103
.text:1043F072 retn
.text:1043F073 ; ---------------------------------------------------------------------------
.text:1043F073
.text:1043F073 loc_1043F073: ; CODE XREF: .text:1043F054j
.text:1043F073 ; DATA XREF: .text:off_1043F09Co
.text:1043F073 mov eax, 48h ; jumptable 1043F054 case 104
.text:1043F078 retn
.text:1043F079 ; ---------------------------------------------------------------------------
.text:1043F079
.text:1043F079 loc_1043F079: ; CODE XREF: .text:1043F054j
.text:1043F079 ; DATA XREF: .text:off_1043F09Co
.text:1043F079 mov eax, 49h ; jumptable 1043F054 case 105
.text:1043F07E retn
.text:1043F07F ; ---------------------------------------------------------------------------
.text:1043F07F
.text:1043F07F loc_1043F07F: ; CODE XREF: .text:1043F054j
.text:1043F07F ; DATA XREF: .text:off_1043F09Co
.text:1043F07F mov eax, 4Ah ; jumptable 1043F054 case 106
.text:1043F084 retn
.text:1043F085 ; ---------------------------------------------------------------------------
.text:1043F085
.text:1043F085 loc_1043F085: ; CODE XREF: .text:1043F054j
.text:1043F085 ; DATA XREF: .text:off_1043F09Co
.text:1043F085 mov eax, 1Ch ; jumptable 1043F054 case 0
.text:1043F08A retn
.text:1043F08B ; ---------------------------------------------------------------------------
.text:1043F08B
.text:1043F08B loc_1043F08B: ; CODE XREF: .text:1043F054j
.text:1043F08B ; DATA XREF: .text:off_1043F09Co
.text:1043F08B mov eax, 7 ; jumptable 1043F054 case 1
.text:1043F090 retn
.text:1043F091 ; ---------------------------------------------------------------------------
.text:1043F091
.text:1043F091 loc_1043F091: ; CODE XREF: .text:1043F04Bj
.text:1043F091 ; .text:1043F054j
.text:1043F091 ; DATA XREF: ...
.text:1043F091 mov eax, 2Ah ; default
.text:1043F091 ; jumptable 1043F054 cases 2-98
.text:1043F096 retn
.text:1043F097 ; ---------------------------------------------------------------------------
.text:1043F097
.text:1043F097 loc_1043F097: ; CODE XREF: .text:1043F043j
.text:1043F097 xor eax, eax
.text:1043F099 retn
.text:1043F099 ; ---------------------------------------------------------------------------
.text:1043F09A align 4
.text:1043F09C off_1043F09C dd offset loc_1043F085, offset loc_1043F08B, offset loc_1043F06D
.text:1043F09C ; DATA XREF: .text:1043F054r
.text:1043F09C dd offset loc_1043F05B, offset loc_1043F061, offset loc_1043F067 ; jump table for switch statement
.text:1043F09C dd offset loc_1043F073, offset loc_1043F079, offset loc_1043F07F
.text:1043F09C dd offset loc_1043F091
.text:1043F0C4 byte_1043F0C4 db 0, 1, 9, 9 ; DATA XREF: .text:1043F04Dr
.text:1043F0C4 db 9, 9, 9, 9 ; indirect table for switch statement
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 9
.text:1043F0C4 db 9, 9, 9, 2
.text:1043F0C4 db 3, 4, 5, 2
.text:1043F0C4 db 6, 7, 8
.text:1043F12F align 10h
.text:1043F130 mov eax, [esp+4]
.text:1043F134 push esi
.text:1043F135 mov esi, [eax+368h]
.text:1043F13B test esi, esi
.text:1043F13D jz short loc_1043F161
.text:1043F13F mov ecx, [esi+15Ch]
.text:1043F145 push ecx