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

Disassembly:
push ebp
mov ebp, esp
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
push edi
mov eax, dword [esi + 0x10]
mov edi, dword [eax]
mov eax, dword [ebp + 0xc]
lea ecx, [eax - 4]
cmp ecx, 3
ja case.default.0x509c0f
jmp dword [ecx*4 + 0x509ebc]
cmp eax, 4
jne 0x509cf7
mov ecx, dword [esi + 0x15c]
movzx eax, byte [ecx + 2]
shl ax, 8
movzx edx, ax
movzx eax, byte [ecx + 3]
or edx, eax
movzx eax, word [esi + 0x40]
mov ecx, eax
cmp edx, ecx
je 0x509ce5
test ax, ax
jne 0x509c55
cmp edx, 0xffff
je 0x509ce5
push ecx
push edx
push str.Received_ACK_for_block__d__expecting__d_n
push edi
call fcn.004ec8e0
inc dword [esi + 0x18]
add esp, 0x10
mov eax, dword [esi + 0x18]
cmp eax, dword [esi + 0x20]
jle 0x509c8f
movzx eax, word [esi + 0x40]
push eax
push str.tftp_tx:_giving_up_waiting_for_block__d_ack
push edi
call fcn.004ec7d0
add esp, 0xc
mov ebx, 0x37
mov eax, ebx
pop edi
pop esi
pop ebx
pop ebp
ret
push dword [esi + 0x148]
lea eax, [esi + 0xc8]
push eax
mov eax, dword [esi + 0x150]
push 0
add eax, 4
push eax
push dword [esi + 0x160]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jns 0x509cde
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [esi + 0x10]
call fcn.004f82a0
push eax
push 0x60f31c
push edi
call fcn.004ec7d0
add esp, 0x14
mov ebx, 0x37
pop edi
pop esi
mov eax, ebx
pop ebx
pop ebp
ret
lea eax, [esi + 0x38]
push eax
call fcn.004dc0e5
add esp, 4
inc word [esi + 0x40]
jmp 0x509d00
mov eax, 1
mov word [esi + 0x40], ax
mov dword [esi + 0x18], ebx
mov eax, dword [esi + 0x160]
mov byte [eax], bl
mov eax, dword [esi + 0x160]
mov byte [eax + 1], 3
movzx edx, word [esi + 0x40]
mov eax, dword [esi + 0x160]
mov ecx, edx
shr ecx, 8
mov byte [eax + 2], cl
mov eax, dword [esi + 0x160]
mov byte [eax + 3], dl
cmp word [esi + 0x40], 1
jbe 0x509d49
mov eax, dword [esi + 0x150]
cmp eax, dword [esi + 0x154]
jl 0x509e96
lea ebx, [esi + 0x150]
push ebx
push dword [esi + 0x154]
push dword [esi + 0x10]
call fcn.004f2d50
add esp, 0xc
test eax, eax
jne 0x509eb4
push dword [esi + 0x148]
lea eax, [esi + 0xc8]
push eax
mov eax, dword [ebx]
push 0
add eax, 4
push eax
push dword [esi + 0x160]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
js 0x509e1b
mov eax, dword [ebx]
cdq
add dword [edi + 0x40], eax
adc dword [edi + 0x44], edx
push dword [edi + 0x44]
push dword [edi + 0x40]
push edi
call fcn.004f4960
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
pop ebp
ret
movzx eax, word [esi + 0x40]
inc dword [esi + 0x18]
inc eax
push dword [esi + 0x18]
and eax, 0xffff
push eax
push str.Timeout_waiting_for_block__d_ACK.__Retries___d_n
push edi
call fcn.004ec8e0
mov eax, dword [esi + 0x18]
add esp, 0x10
cmp eax, dword [esi + 0x20]
jle 0x509def
pop edi
mov dword [esi + 8], 0xffffff9d
xor eax, eax
mov dword [esi], 3
pop esi
pop ebx
pop ebp
ret
push dword [esi + 0x148]
lea eax, [esi + 0xc8]
push eax
mov eax, dword [esi + 0x150]
push 0
add eax, 4
push eax
push dword [esi + 0x160]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jns 0x509d9e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [esi + 0x10]
call fcn.004f82a0
push eax
push 0x60f31c
push edi
call fcn.004ec7d0
add esp, 0x14
mov eax, 0x37
pop edi
pop esi
pop ebx
pop ebp
ret
mov dword [esi], 3
mov eax, dword [esi + 0x160]
mov byte [eax], bl
mov eax, dword [esi + 0x160]
mov byte [eax + 1], 5
movzx edx, word [esi + 0x40]
mov eax, dword [esi + 0x160]
mov ecx, edx
shr ecx, 8
mov byte [eax + 2], cl
mov eax, dword [esi + 0x160]
mov byte [eax + 3], dl
lea eax, [esi + 0xc8]
push dword [esi + 0x148]
push eax
push 0
push 4
push dword [esi + 0x160]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
pop edi
mov dword [esi], 3
xor eax, eax
pop esi
pop ebx
pop ebp
ret
push eax
push str.tftp_tx:_internal_error__event:__i
push edi
call fcn.004ec7d0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
pop ebp
ret