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

Disassembly:
push ebx
push esi
mov esi, ecx
push edi
push 3
pop ebx
mov eax, dword [esi + 0x10]
mov edi, dword [eax]
sub edx, ebx
je 0x5209b5
dec edx
dec edx
je 0x52095d
dec edx
je 0x5208f3
dec edx
je 0x520891
push str.tftp_rx:_internal_error
push 0x5949b0
push edi
call fcn.00510cc2
add esp, 0xc
push 0x47
jmp 0x520a69
inc dword [esi + 0x18]
movzx eax, word [esi + 0x40]
push dword [esi + 0x18]
inc eax
and eax, 0xffff
push eax
push str.Timeout_waiting_for_block__d_ACK.__Retries___d_n
push edi
call fcn.00510c4e
mov eax, dword [esi + 0x18]
add esp, 0x10
cmp eax, dword [esi + 0x20]
jle 0x5208c6
mov dword [esi + 8], 0xffffff9d
mov dword [esi], ebx
jmp 0x520a91
push dword [esi + 0x148]
lea eax, [esi + 0xc8]
push eax
push 0
push 4
push dword [esi + 0x160]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jns 0x520a91
jmp 0x520a48
xor eax, eax
xor ebx, ebx
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], 4
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 ebx
push 4
push dword [esi + 0x160]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
js 0x520a48
mov dword [esi], 1
jmp 0x520a86
mov eax, dword [esi + 0x160]
xor ebx, ebx
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 ebx
push 4
push dword [esi + 0x160]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
push 3
pop eax
mov dword [esi], eax
jmp 0x520a91
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]
inc eax
and eax, 0xffff
cmp eax, edx
je 0x5209ef
push eax
push edx
push str.Received_unexpected_DATA_packet_block__d__expecting_block__d_n
push edi
call fcn.00510c4e
add esp, 0x10
jmp 0x520a91
mov word [esi + 0x40], dx
xor ebx, ebx
mov dword [esi + 0x18], ebx
mov eax, dword [esi + 0x160]
mov byte [eax], bl
mov eax, dword [esi + 0x160]
mov byte [eax + 1], 4
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 ebx
push 4
push dword [esi + 0x160]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jns 0x520a6c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, dword [esi + 0x10]
mov edx, eax
call fcn.0052922c
push eax
push 0x5949b0
push edi
call fcn.00510cc2
add esp, 0xc
push 0x37
pop eax
jmp 0x520a93
mov eax, dword [esi + 0x154]
xor ecx, ecx
add eax, 4
inc ecx
cmp dword [esi + 0x14c], eax
push 3
pop eax
cmovl ecx, eax
mov dword [esi], ecx
lea eax, [esi + 0x38]
push eax
call dword [sym.imp.MSVCR120.dll__time64]
pop ecx
xor eax, eax
pop edi
pop esi
pop ebx
ret