Function at 0x40a973
Capabilities:
Send data
Send data on socket

Disassembly:
mov eax, dword [esi + 0x10]
push ebx
push edi
mov edi, dword [eax]
lea eax, [ecx - 4]
xor ebx, ebx
cmp eax, 3
ja case.default.0x40a7a5
jmp dword [eax*4 + 0x40aa94]
cmp ecx, 4
jne 0x40a88b
mov eax, dword [esi + 0x14c]
mov dx, word [esi + 0x30]
xor ecx, ecx
mov ch, byte [eax + 2]
mov cl, byte [eax + 3]
mov eax, ecx
movzx ecx, dx
cmp eax, ecx
je 0x40a879
test dx, dx
jne 0x40a7e4
cmp eax, 0xffff
je 0x40a879
push ecx
push eax
push str.Received_ACK_for_block__d__expecting__d_n
push edi
call fcn.004033d0
mov edx, dword [esi + 0x18]
mov ecx, dword [esi + 0x20]
add esp, 0x10
inc edx
mov eax, edx
cmp eax, ecx
mov dword [esi + 0x18], edx
jle 0x40a821
movzx edx, word [esi + 0x30]
push edx
push str.tftp_tx:_giving_up_waiting_for_block__d_ack
push edi
call fcn.00403490
add esp, 0xc
mov ebx, 0x37
pop edi
mov eax, ebx
pop ebx
ret
mov eax, dword [esi + 0x138]
mov edx, dword [esi + 0x140]
push eax
lea ecx, [esi + 0xb8]
push ecx
mov ecx, dword [esi + 0x14]
push 0
add edx, 4
push edx
lea eax, [esi + 0x150]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jge 0x40a874
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [esi + 0x10]
push eax
push edx
call fcn.00418c70
push eax
push 0x432684
push edi
call fcn.00403490
add esp, 0x14
mov ebx, 0x37
pop edi
mov eax, ebx
pop ebx
ret
lea eax, [esi + 0x2c]
push eax
call fcn.00427684
add esp, 4
inc word [esi + 0x30]
jmp 0x40a891
mov word [esi + 0x30], 1
mov dword [esi + 0x18], 0
mov ecx, dword [esi + 0x150]
mov byte [ecx], 0
mov edx, dword [esi + 0x150]
mov byte [edx + 1], 3
mov ax, word [esi + 0x30]
mov ecx, dword [esi + 0x150]
mov byte [ecx + 2], ah
mov edx, dword [esi + 0x150]
mov byte [edx + 3], al
cmp word [esi + 0x30], 1
jbe 0x40a8da
mov eax, dword [esi + 0x140]
cmp eax, dword [esi + 0x144]
jl 0x40a9aa
mov ecx, dword [esi + 0x144]
mov edx, dword [esi + 0x10]
lea ebx, [esi + 0x140]
push ebx
push ecx
push edx
call fcn.004024f0
add esp, 0xc
test eax, eax
jne 0x40aa8f
mov eax, dword [esi + 0x138]
mov edx, dword [ebx]
push eax
mov eax, dword [esi + 0x150]
lea ecx, [esi + 0xb8]
push ecx
mov ecx, dword [esi + 0x14]
push 0
add edx, 4
push edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jge 0x40a94e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [esi + 0x10]
push eax
push edx
call fcn.00418c70
push eax
push 0x432684
push edi
call fcn.00403490
add esp, 0x14
pop edi
mov eax, 0x37
pop ebx
ret
mov eax, dword [ebx]
mov ecx, dword [edi + 0x40]
mov ebx, dword [edi + 0x44]
cdq
add ecx, eax
adc ebx, edx
mov eax, ebx
push eax
push ecx
push edi
mov dword [edi + 0x40], ecx
mov dword [edi + 0x44], ebx
call fcn.00416e20
add esp, 0xc
pop edi
xor eax, eax
pop ebx
ret
mov edx, dword [esi + 0x18]
inc edx
mov eax, edx
mov dword [esi + 0x18], edx
xor edx, edx
mov dx, word [esi + 0x30]
push eax
inc edx
and edx, 0xffff
push edx
push str.Timeout_waiting_for_block__d_ACK.__Retries___d_n
push edi
call fcn.004033d0
mov eax, dword [esi + 0x18]
mov ecx, dword [esi + 0x20]
add esp, 0x10
cmp eax, ecx
jle 0x40a9b5
mov dword [esi + 8], 0xffffff9d
pop edi
mov dword [esi], 3
xor eax, eax
pop ebx
ret
mov ecx, dword [esi + 0x138]
mov eax, dword [esi + 0x140]
push ecx
mov ecx, dword [esi + 0x150]
lea edx, [esi + 0xb8]
push edx
mov edx, dword [esi + 0x14]
push 0
add eax, 4
push eax
push ecx
push edx
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jge 0x40aa0b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
mov eax, dword [esi + 0x10]
push eax
call fcn.00418c70
push eax
push 0x432684
push edi
call fcn.00403490
add esp, 0x14
pop edi
mov eax, 0x37
pop ebx
ret
mov ecx, dword [edi + 0x44]
mov edx, dword [edi + 0x40]
push ecx
push edx
push edi
call fcn.00416e20
add esp, 0xc
pop edi
xor eax, eax
pop ebx
ret
mov dword [esi], 3
mov eax, dword [esi + 0x150]
mov byte [eax], 0
mov ecx, dword [esi + 0x150]
mov byte [ecx + 1], 5
mov ax, word [esi + 0x30]
mov edx, dword [esi + 0x150]
mov byte [edx + 2], ah
mov ecx, dword [esi + 0x150]
mov byte [ecx + 3], al
mov edx, dword [esi + 0x138]
mov ecx, dword [esi + 0x150]
push edx
mov edx, dword [esi + 0x14]
lea eax, [esi + 0xb8]
push eax
push 0
push 4
push ecx
push edx
call dword [sym.imp.WS2_32.dll_sendto]
pop edi
mov dword [esi], 3
xor eax, eax
pop ebx
ret
push ecx
push str.tftp_tx:_internal_error__event:__i
push edi
call fcn.00403490
add esp, 0xc
xor eax, eax
pop edi
pop ebx
ret