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

Disassembly:
push ecx
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.0x540d26
jmp dword [eax*4 + 0x541040]
cmp ecx, 4
jne 0x540e07
lea eax, [esi + 0x15c]
call fcn.005407b0
movzx edx, word [esi + 0x40]
movzx eax, ax
movzx ecx, dx
cmp eax, ecx
je 0x540df5
test dx, dx
jne 0x540d63
cmp eax, 0xffff
je 0x540df5
push ecx
push eax
push str.Received_ACK_for_block__d__expecting__d_n
push edi
call fcn.005301c0
inc dword [esi + 0x18]
mov eax, dword [esi + 0x18]
add esp, 0x10
cmp eax, dword [esi + 0x20]
jle 0x540d9c
movzx ecx, word [esi + 0x40]
push ecx
push str.tftp_tx:_giving_up_waiting_for_block__d_ack
push edi
call fcn.00530250
add esp, 0xc
mov ebx, 0x37
pop edi
mov eax, ebx
pop ebx
pop ecx
ret
mov edx, dword [esi + 0x148]
mov ecx, dword [esi + 0x150]
push edx
mov edx, dword [esi + 0x160]
lea eax, [esi + 0xc8]
push eax
mov eax, dword [esi + 0x14]
push 0
add ecx, 4
push ecx
push edx
push eax
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jge 0x540def
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [esi + 0x10]
push eax
push ecx
call fcn.00536130
push eax
push 0x5709f4
push edi
call fcn.00530250
add esp, 0x14
mov ebx, 0x37
pop edi
mov eax, ebx
pop ebx
pop ecx
ret
lea edx, [esi + 0x38]
push edx
call fcn.0055bc1a
add esp, 4
inc word [esi + 0x40]
jmp 0x540e10
mov eax, 1
mov word [esi + 0x40], ax
mov dword [esi + 0x18], ebx
lea ebx, [esi + 0x160]
mov eax, 3
mov ecx, ebx
call fcn.00540760
mov ax, word [esi + 0x40]
mov ecx, ebx
call fcn.00540780
cmp word [esi + 0x40], 1
jbe 0x540e49
mov ecx, dword [esi + 0x150]
cmp ecx, dword [esi + 0x154]
jl 0x54101c
mov edx, dword [ebx]
mov eax, dword [esi + 0x10]
mov dword [esi + 0x150], 0
mov ecx, dword [eax]
add edx, 4
mov dword [ecx + 0x114], edx
jmp 0x540e70
mov eax, dword [esi + 0x154]
sub eax, dword [esi + 0x150]
mov ecx, dword [esi + 0x10]
lea edx, [esp + 8]
push edx
push eax
push ecx
call fcn.00550b40
add esp, 0xc
test eax, eax
jne 0x541039
mov ecx, dword [esp + 8]
add dword [esi + 0x150], ecx
mov edx, dword [esi + 0x10]
mov eax, dword [edx]
add dword [eax + 0x114], ecx
mov eax, dword [esi + 0x150]
cmp eax, dword [esi + 0x154]
jge 0x540ec0
cmp dword [esp + 8], 0
jne 0x540e70
mov ecx, dword [esi + 0x148]
push ecx
mov ecx, dword [ebx]
lea edx, [esi + 0xc8]
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 0x540f0d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
mov eax, dword [esi + 0x10]
push eax
call fcn.00536130
push eax
push 0x5709f4
push edi
call fcn.00530250
add esp, 0x14
pop edi
mov eax, 0x37
pop ebx
pop ecx
ret
mov eax, dword [esi + 0x150]
cdq
add dword [edi + 0x78], eax
adc dword [edi + 0x7c], edx
mov ecx, dword [edi + 0x7c]
mov edx, dword [edi + 0x78]
push ecx
push edx
push edi
call fcn.00538d70
add esp, 0xc
pop edi
xor eax, eax
pop ebx
pop ecx
ret
inc dword [esi + 0x18]
mov eax, dword [esi + 0x18]
push eax
movzx eax, word [esi + 0x40]
inc eax
and eax, 0xffff
push eax
push str.Timeout_waiting_for_block__d_ACK.__Retries___d_n
push edi
call fcn.005301c0
mov ecx, dword [esi + 0x18]
add esp, 0x10
cmp ecx, dword [esi + 0x20]
jle 0x540f6c
pop edi
mov dword [esi + 8], 0xffffff9d
mov dword [esi], 3
xor eax, eax
pop ebx
pop ecx
ret
mov edx, dword [esi + 0x148]
mov ecx, dword [esi + 0x150]
push edx
mov edx, dword [esi + 0x160]
lea eax, [esi + 0xc8]
push eax
mov eax, dword [esi + 0x14]
push 0
add ecx, 4
push ecx
push edx
push eax
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jge 0x540fc3
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [esi + 0x10]
push eax
push ecx
call fcn.00536130
push eax
push 0x5709f4
push edi
call fcn.00530250
add esp, 0x14
pop edi
mov eax, 0x37
pop ebx
pop ecx
ret
mov edx, dword [edi + 0x7c]
mov eax, dword [edi + 0x78]
push edx
push eax
push edi
call fcn.00538d70
add esp, 0xc
pop edi
xor eax, eax
pop ebx
pop ecx
ret
lea edi, [esi + 0x160]
mov eax, 5
mov ecx, edi
mov dword [esi], 3
call fcn.00540760
mov ax, word [esi + 0x40]
mov ecx, edi
call fcn.00540780
mov ecx, dword [esi + 0x148]
mov eax, dword [edi]
push ecx
mov ecx, dword [esi + 0x14]
lea edx, [esi + 0xc8]
push edx
push 0
push 4
push eax
push ecx
call dword [sym.imp.WS2_32.dll_sendto]
pop edi
mov dword [esi], 3
xor eax, eax
pop ebx
pop ecx
ret
push ecx
push str.tftp_tx:_internal_error__event:__i
push edi
call fcn.00530250
add esp, 0xc
xor eax, eax
pop edi
pop ebx
pop ecx
ret