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

Disassembly:
sub rsp, 0x38
sub edx, 3
mov rax, qword [rcx + 0x10]
mov qword [rsp + 0x48], rbx
mov qword [rsp + 0x50], rsi
mov qword [rsp + 0x58], rdi
mov rdi, qword [rax]
mov rbx, rcx
je 0x49f37a
sub edx, 2
je 0x49f30a
dec edx
je 0x49f289
dec edx
je 0x49f1da
lea r8, str.tftp_rx:_internal_error
lea rdx, [0x005754ec]
mov rcx, rdi
call fcn.00496db0
mov eax, 0x47
mov rdi, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x48]
add rsp, 0x38
ret
movzx r8d, word [rcx + 0x48]
inc dword [rcx + 0x20]
mov r9d, dword [rcx + 0x20]
lea rdx, str.Timeout_waiting_for_block__d_ACK.__Retries___d_n
inc r8d
mov rcx, rdi
call fcn.00496cb0
mov r11d, dword [rbx + 0x28]
cmp dword [rbx + 0x20], r11d
jle 0x49f217
mov r8d, 3
mov dword [rbx + 8], 0xffffff9d
mov dword [rbx], r8d
jmp 0x49f48e
mov eax, dword [rbx + 0x150]
mov rdx, qword [rbx + 0x170]
lea rcx, [rbx + 0xd0]
xor r9d, r9d
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbx + 0x18]
lea r8d, [r9 + 4]
call qword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jns 0x49f48e
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, qword [rbx + 0x10]
mov edx, eax
call fcn.0048a2b0
lea rdx, [0x005754ec]
mov rcx, rdi
mov r8, rax
call fcn.00496db0
mov eax, reloc.WS2_32.dll_getservbyname
mov rdi, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x48]
add rsp, 0x38
ret
mov word [rcx + 0x48], 0
mov dword [rcx + 0x20], 0
mov rax, qword [rcx + 0x170]
mov byte [rax], 0
mov rax, qword [rcx + 0x170]
xor r9d, r9d
mov byte [rax + 1], 4
movzx edx, word [rcx + 0x48]
mov rax, qword [rbx + 0x170]
movzx ecx, dx
lea r8d, [r9 + 4]
shr cx, 8
mov byte [rax + 2], cl
mov rax, qword [rbx + 0x170]
lea rcx, [rbx + 0xd0]
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]
test eax, eax
js 0x49f24d
mov edx, 1
jmp 0x49f482
mov rax, qword [rcx + 0x170]
xor r9d, r9d
mov byte [rax], 0
mov rax, qword [rcx + 0x170]
lea r8d, [r9 + 4]
mov byte [rax + 1], 5
movzx edx, word [rcx + 0x48]
mov rax, qword [rbx + 0x170]
movzx ecx, dx
shr cx, 8
mov byte [rax + 2], cl
mov rax, qword [rbx + 0x170]
lea rcx, [rbx + 0xd0]
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 r8d, 3
mov dword [rbx], r8d
jmp 0x49f48e
mov rcx, qword [rcx + 0x168]
movzx eax, byte [rcx + 2]
shl ax, 8
movzx esi, ax
movzx eax, byte [rcx + 3]
or esi, eax
movzx eax, word [rbx + 0x48]
inc eax
cmp eax, esi
je 0x49f3e9
lea rdx, str.Received_unexpected_DATA_packet_block__d_n
mov r8d, esi
mov rcx, rdi
call fcn.00496cb0
inc dword [rbx + 0x20]
mov eax, dword [rbx + 0x20]
cmp eax, dword [rbx + 0x28]
jle 0x49f3e9
movzx r8d, word [rbx + 0x48]
lea rdx, str.tftp_rx:_giving_up_waiting_for_block__d
mov rcx, rdi
inc r8d
call fcn.00496db0
mov eax, 0x47
mov rdi, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x48]
add rsp, 0x38
ret
mov word [rbx + 0x48], si
mov dword [rbx + 0x20], 0
mov rax, qword [rbx + 0x170]
mov byte [rax], 0
mov rax, qword [rbx + 0x170]
xor r9d, r9d
mov byte [rax + 1], 4
movzx edx, word [rbx + 0x48]
mov rax, qword [rbx + 0x170]
movzx ecx, dx
lea r8d, [r9 + 4]
shr cx, 8
mov byte [rax + 2], cl
mov rax, qword [rbx + 0x170]
lea rcx, [rbx + 0xd0]
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]
test eax, eax
js 0x49f24d
movsxd rcx, dword [rbx + 0x15c]
movsxd rax, dword [rbx + 0x154]
mov edx, 1
add rcx, 4
mov r8d, 3
cmp rax, rcx
cmovl edx, r8d
lea rcx, [rbx + 0x40]
mov dword [rbx], edx
call qword [sym.imp.msvcrt.dll_time]
mov rdi, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x48]
xor eax, eax
add rsp, 0x38
ret