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

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
push rdi
sub rsp, 0x30
mov rax, qword [rcx + 0x10]
mov rbx, rcx
xor esi, esi
mov ecx, edx
mov rdi, qword [rax]
sub ecx, 4
je 0x14004799a
sub ecx, 1
je 0x14004791a
sub ecx, 1
je 0x14004799a
cmp ecx, 1
mov rcx, rdi
je 0x140047861
mov r8d, edx
lea rdx, str.tftp_tx:_internal_error__event:__i
call fcn.1400274f0
xor eax, eax
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
add rsp, 0x30
pop rdi
ret
movzx eax, word [rbx + 0x48]
lea rdx, str.Timeout_waiting_for_block__d_ACK.__Retries___d_n
inc dword [rbx + 0x20]
inc eax
mov r9d, dword [rbx + 0x20]
movzx r8d, ax
call fcn.1400275b0
mov eax, dword [rbx + 0x28]
cmp dword [rbx + 0x20], eax
jle 0x1400478a5
mov dword [rbx + 8], 0xffffff9d
xor eax, eax
mov dword [rbx], 3
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
add rsp, 0x30
pop rdi
ret
mov eax, dword [rbx + 0x150]
lea rcx, [rbx + 0xd0]
mov r8d, dword [rbx + 0x158]
xor r9d, r9d
mov rdx, qword [rbx + 0x170]
add r8d, 4
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbx + 0x18]
call qword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jns 0x140047b63
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, qword [rbx + 0x10]
mov edx, eax
call fcn.1400196c0
mov r8, rax
lea rdx, [0x1400584c8]
mov rcx, rdi
call fcn.1400274f0
mov eax, gethostname
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
add rsp, 0x30
pop rdi
ret
mov dword [rbx], 3
xor r9d, r9d
mov rax, qword [rbx + 0x170]
lea r8d, [r9 + 4]
mov byte [rax], sil
mov rax, qword [rbx + 0x170]
mov byte [rax + 1], 5
movzx edx, word [rbx + 0x48]
mov rax, qword [rbx + 0x170]
movzx ecx, dx
shr cx, 8
mov byte [rax + 2], cl
lea rcx, [rbx + 0xd0]
mov rax, qword [rbx + 0x170]
mov byte [rax + 3], dl
mov eax, dword [rbx + 0x150]
mov rdx, qword [rbx + 0x170]
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbx + 0x18]
call qword [sym.imp.WS2_32.dll_sendto]
mov dword [rbx], 3
xor eax, eax
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
add rsp, 0x30
pop rdi
ret
cmp edx, 4
jne 0x140047aa5
mov rcx, qword [rbx + 0x168]
movzx r9d, word [rbx + 0x48]
movzx eax, byte [rcx + 2]
shl ax, 8
movzx r8d, ax
movzx eax, byte [rcx + 3]
or r8d, eax
cmp r8d, r9d
je 0x140047a96
test r9w, r9w
jne 0x1400479de
cmp r8d, 0xffff
je 0x140047a96
lea rdx, str.Received_ACK_for_block__d__expecting__d_n
mov rcx, rdi
call fcn.1400275b0
inc dword [rbx + 0x20]
mov eax, dword [rbx + 0x20]
cmp eax, dword [rbx + 0x28]
jle 0x140047a23
movzx r8d, word [rbx + 0x48]
lea rdx, str.tftp_tx:_giving_up_waiting_for_block__d_ack
mov rcx, rdi
call fcn.1400274f0
mov esi, gethostname
mov eax, esi
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
add rsp, 0x30
pop rdi
ret
mov eax, dword [rbx + 0x150]
lea rcx, [rbx + 0xd0]
mov r8d, dword [rbx + 0x158]
xor r9d, r9d
mov rdx, qword [rbx + 0x170]
add r8d, 4
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbx + 0x18]
call qword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jns 0x140047a84
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, qword [rbx + 0x10]
mov edx, eax
call fcn.1400196c0
mov r8, rax
lea rdx, [0x1400584c8]
mov rcx, rdi
call fcn.1400274f0
mov esi, gethostname
mov eax, esi
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
add rsp, 0x30
pop rdi
ret
lea rcx, [rbx + 0x40]
call sub.api_ms_win_crt_time_l1_1_0.dll__time64
inc word [rbx + 0x48]
jmp 0x140047aae
mov eax, 1
mov word [rbx + 0x48], ax
mov dword [rbx + 0x20], esi
mov rax, qword [rbx + 0x170]
mov byte [rax], sil
mov rax, qword [rbx + 0x170]
mov byte [rax + 1], 3
movzx edx, word [rbx + 0x48]
mov rax, qword [rbx + 0x170]
movzx ecx, dx
shr cx, 8
mov byte [rax + 2], cl
mov rax, qword [rbx + 0x170]
mov byte [rax + 3], dl
cmp word [rbx + 0x48], 1
jbe 0x140047afe
mov eax, dword [rbx + 0x15c]
cmp dword [rbx + 0x158], eax
jl 0x140047982
mov edx, dword [rbx + 0x15c]
lea r8, [rbx + 0x158]
mov rcx, qword [rbx + 0x10]
call fcn.1400301b0
test eax, eax
jne 0x140047b74
mov eax, dword [rbx + 0x150]
lea rcx, [rbx + 0xd0]
mov r8d, dword [rbx + 0x158]
xor r9d, r9d
mov rdx, qword [rbx + 0x170]
add r8d, 4
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbx + 0x18]
call qword [sym.imp.WS2_32.dll_sendto]
test eax, eax
js 0x1400478e2
movsxd rax, dword [rbx + 0x158]
add qword [rdi + 0xb8], rax
mov rdx, qword [rdi + 0xb8]
mov rcx, rdi
call fcn.140031de0
xor eax, eax
mov rbx, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
add rsp, 0x30
pop rdi
ret