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

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rbp
push rsi
push rdi
push r14
sub rsp, 0x1a0
mov rax, qword [0x1402d59c0]
xor rax, rsp
mov qword [rsp + 0x190], rax
mov r14, qword [rcx + 0x10]
lea rax, str.octet
xor edi, edi
lea rsi, str.netascii
mov rbx, rcx
cmp byte [r14 + 0x1301], dil
cmove rsi, rax
cmp edx, 7
ja case.0x140165ad7.1
lea r8, [0x140000000]
movsxd rax, edx
mov ecx, dword [r8 + rax*4 + 0x165ff8]
add rcx, r8
jmp rcx
inc dword [rbx + 0x20]
mov eax, dword [rbx + 0x20]
cmp eax, dword [rbx + 0x28]
jle 0x140165af8
mov dword [rbx + 8], 0xffffff9e
xor eax, eax
mov dword [rbx], 3
jmp 0x140165fce
mov rax, qword [rbx + 0x158]
cmp byte [r14 + 0x1306], dil
mov byte [rax], dil
mov rax, qword [rbx + 0x158]
je 0x140165b2d
mov byte [rax + 1], 2
mov rdx, qword [r14 + 0x1130]
cmp rdx, 0xffffffffffffffff
je 0x140165b31
mov rcx, r14
call fcn.140153070
jmp 0x140165b31
mov byte [rax + 1], 1
mov rax, qword [rbx + 0x10]
lea r8, [rsp + 0x40]
xor r9d, r9d
mov dword [rsp + 0x20], 4
xor edx, edx
mov rcx, qword [rax + 0x1180]
inc rcx
call fcn.140136a40
mov edi, eax
test eax, eax
jne 0x140165fce
movsxd rdx, dword [rbx + 0x144]
mov rbp, 0xffffffffffffffff
mov rax, rbp
inc rax
cmp byte [rsi + rax], 0
jne 0x140165b71
mov r9, qword [rsp + 0x40]
mov rcx, rdx
sub rcx, rax
mov rax, rbp
sub rcx, 4
nop dword [rax]
inc rax
cmp byte [r9 + rax], 0
jne 0x140165b90
cmp rax, rcx
jbe 0x140165bc3
lea rdx, str.TFTP_file_name_too_long
mov rcx, r14
call fcn.14013a4e0
mov rcx, qword [rsp + 0x40]
call qword [fcn.1401d1af0]
mov eax, 0x47
jmp 0x140165fce
mov rcx, qword [rbx + 0x158]
lea r8, str._s_c_s_c
mov qword [rsp + 0x30], 0
add rcx, 2
mov qword [rsp + 0x28], rsi
mov qword [rsp + 0x20], 0
call fcn.140138be0
mov rcx, rbp
inc rcx
cmp byte [rsi + rcx], 0
jne 0x140165bf4
mov rdx, qword [rsp + 0x40]
mov rax, rbp
cmp byte [rdx + rax + 1], 0
lea rax, [rax + 1]
jne 0x140165c05
lea rsi, [rax + 4]
add rsi, rcx
cmp byte [r14 + 0xa94], 0
jne 0x140165f17
cmp byte [r14 + 0x1306], 0
je 0x140165c53
mov r9, qword [r14 + 0x1130]
cmp r9, rbp
je 0x140165c53
lea r8, str._lld
mov edx, 0x40
lea rcx, [rsp + 0x50]
call fcn.140138be0
jmp 0x140165c5d
mov eax, 0x30
mov word [rsp + 0x50], ax
movsxd rax, dword [rbx + 0x144]
lea r8, [rsi + 6]
cmp r8, rax
jbe 0x140165cb0
mov r9d, dword [rbx + 0x148]
lea r8, [0x14029df1c]
mov edx, 0x40
lea rcx, [rsp + 0x50]
call fcn.140138be0
mov r9d, dword [rbx + 0x24]
lea r8, [0x14029df1c]
mov edx, 0x40
lea rcx, [rsp + 0x50]
call fcn.140138be0
lea rdx, str.TFTP_buffer_too_small_for_options
jmp 0x140165ba6
mov rdx, qword [rbx + 0x158]
lea rcx, str.tsize
add rdx, rsi
movzx eax, byte [rcx]
lea rcx, [rcx + 1]
mov byte [rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x140165cc1
mov rsi, r8
lea rcx, [rsp + 0x50]
mov rax, rbp
nop dword [rax]
cmp byte [rcx + rax + 1], 0
lea rax, [rax + 1]
jne 0x140165ce0
lea rcx, [rax + 1]
movsxd rax, dword [rbx + 0x144]
add rcx, rsi
cmp rcx, rax
jbe 0x140165d05
mov edi, 0x47
jmp 0x140165d51
mov rdx, qword [rbx + 0x158]
lea rcx, [rsp + 0x50]
add rdx, rsi
nop dword [rax]
nop dword [rax + rax]
movzx eax, byte [rcx]
lea rcx, [rcx + 1]
mov byte [rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x140165d20
lea rcx, [rsp + 0x50]
mov rax, rbp
nop dword [rax]
inc rax
cmp byte [rcx + rax], 0
jne 0x140165d40
inc rsi
add rsi, rax
xor edi, edi
mov r9d, dword [rbx + 0x148]
lea r8, [0x14029df1c]
mov edx, 0x40
lea rcx, [rsp + 0x50]
call fcn.140138be0
test edi, edi
jne 0x140165e31
movsxd rax, dword [rbx + 0x144]
lea r8, [rsi + 8]
cmp r8, rax
jbe 0x140165d8d
mov edi, 0x47
jmp 0x140165db6
mov rdx, qword [rbx + 0x158]
lea rcx, str.blksize
add rdx, rsi
nop
movzx eax, byte [rcx]
lea rcx, [rcx + 1]
mov byte [rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x140165da0
mov rsi, r8
xor edi, edi
test edi, edi
jne 0x140165e31
lea rcx, [rsp + 0x50]
mov rax, rbp
cmp byte [rcx + rax + 1], 0
lea rax, [rax + 1]
jne 0x140165dc2
lea rcx, [rax + 1]
movsxd rax, dword [rbx + 0x144]
add rcx, rsi
cmp rcx, rax
jbe 0x140165de7
mov edi, 0x47
jmp 0x140165e31
mov rdx, qword [rbx + 0x158]
lea rcx, [rsp + 0x50]
add rdx, rsi
nop word [rax + rax]
movzx eax, byte [rcx]
lea rcx, [rcx + 1]
mov byte [rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x140165e00
lea rcx, [rsp + 0x50]
mov rax, rbp
nop dword [rax]
inc rax
cmp byte [rcx + rax], 0
jne 0x140165e20
inc rsi
add rsi, rax
xor edi, edi
mov r9d, dword [rbx + 0x24]
lea r8, [0x14029df1c]
mov edx, 0x40
lea rcx, [rsp + 0x50]
call fcn.140138be0
test edi, edi
jne 0x140165f0b
movsxd rax, dword [rbx + 0x144]
lea r8, [rsi + 8]
cmp r8, rax
ja 0x140165f0b
mov rdx, qword [rbx + 0x158]
lea rcx, str.timeout
add rdx, rsi
nop dword [rax + rax]
movzx eax, byte [rcx]
lea rcx, [rcx + 1]
mov byte [rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x140165e80
mov rsi, r8
lea rcx, [rsp + 0x50]
mov rax, rbp
nop dword [rax]
cmp byte [rcx + rax + 1], 0
lea rax, [rax + 1]
jne 0x140165ea0
lea rcx, [rax + 1]
movsxd rax, dword [rbx + 0x144]
add rcx, rsi
cmp rcx, rax
jbe 0x140165ec5
mov edi, 0x47
jmp 0x140165f07
mov rdx, qword [rbx + 0x158]
lea rcx, [rsp + 0x50]
add rdx, rsi
nop dword [rax]
nop dword [rax + rax]
movzx eax, byte [rcx]
lea rcx, [rcx + 1]
mov byte [rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x140165ee0
lea rax, [rsp + 0x50]
inc rbp
cmp byte [rax + rbp], 0
jne 0x140165ef6
inc rsi
add rsi, rbp
xor edi, edi
test edi, edi
je 0x140165f17
lea rdx, str.TFTP_buffer_too_small_for_options
jmp 0x140165ba6
mov rax, qword [r14 + 0x20]
xor r9d, r9d
mov rcx, qword [rbx + 0x18]
mov r8d, esi
mov rax, qword [rax + 0x38]
lea rdx, [rax + 0x10]
mov eax, dword [rax + 0xc]
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rdx
mov rdx, qword [rbx + 0x158]
call qword [sym.imp.WS2_32.dll_sendto]
movsxd rcx, eax
cmp rcx, rsi
je 0x140165f7b
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r8d, 0x100
lea rdx, [rsp + 0x90]
mov ecx, eax
call fcn.14015f6f0
mov r8, rax
lea rdx, [0x14029e04c]
mov rcx, r14
call fcn.14013a4e0
mov rcx, qword [rsp + 0x40]
call qword [fcn.1401d1af0]
jmp 0x140165fcc
mov rcx, rbx
cmp byte [r14 + 0x1306], dil
je 0x140165fac
call fcn.1401651e0
mov edi, eax
jmp 0x140165fcc
mov rcx, rbx
call fcn.1401651e0
mov edi, eax
jmp 0x140165fcc
mov rcx, rbx
call fcn.140165190
mov edi, eax
jmp 0x140165fcc
mov dword [rbx], 3
jmp 0x140165fcc
lea rdx, str.tftp_send_first:_internal_error
mov rcx, r14
call fcn.14013a4e0
mov eax, edi
mov rcx, qword [rsp + 0x190]
xor rcx, rsp
call fcn.1401ca4f0
lea r11, [rsp + 0x1a0]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop rdi
pop rsi
ret
sub rsp, 0x28
mov r8d, dword [rcx]
mov r9, qword [rcx + 0x10]
test r8d, r8d
je 0x140166187
sub r8d, 1
je 0x14016617e
sub r8d, 1
je 0x140166175
lea rdx, [0x14029e04c]
mov rcx, r9
cmp r8d, 1
je 0x140166162
lea r8, str.Internal_state_machine_error
call fcn.14013a4e0
mov eax, 0x47
add rsp, 0x28
ret
lea r8, str.TFTP_finished
call fcn.14013a5d0
xor eax, eax
add rsp, 0x28
ret
add rsp, 0x28
jmp fcn.1401662d0
add rsp, 0x28
jmp fcn.140165730
add rsp, 0x28
jmp 0x140165a70