You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be possible to naively implement arbitrary (text) protocols using badtouch, using functions similar to the socket functions provided by pwntools.
This allows more creative solutions for #58, eg by talking to an smtpd.
sock_connect(host, port, {fam='ipv4', timeout=3, ssl=true, ssl_verify=false, newline="\r\n"}), create a connection
sock_send(sock, data), send data
sock_recv(sock), receive up to 4096 bytes
sock_sendline(sock, line), send a line, automatically adds a newline
sock_recvline(sock), receive a line, strips newline
sock_recvall(sock), receive until EOF
sock_recvline_contains(sock, needle), receive lines until one contains at least one needle, then return that line (supports string and list of strings)
sock_recvline_regex(sock, regex), receive lines until one matches the regex, then return that line
sock_recvn(sock, n), receive exactly n bytes
sock_recvuntil(sock, delim), receive until a sequence of bytes is found, then return all data including the sequence (supports string and list of strings)
sock_sendafter(sock, delim, data), shorthand for sock_recvuntil(sock, delim) and sock_send(sock, data)
sock_unrecv(sock, data), put data back into the buffered reader
sock_newline(sock, "\r\n"), update the newline
The text was updated successfully, but these errors were encountered:
It should be possible to naively implement arbitrary (text) protocols using badtouch, using functions similar to the socket functions provided by pwntools.
This allows more creative solutions for #58, eg by talking to an smtpd.
sock_connect(host, port, {fam='ipv4', timeout=3, ssl=true, ssl_verify=false, newline="\r\n"})
, create a connectionsock_send(sock, data)
, send datasock_recv(sock)
, receive up to 4096 bytessock_sendline(sock, line)
, send a line, automatically adds a newlinesock_recvline(sock)
, receive a line, strips newlinesock_recvall(sock)
, receive until EOFsock_recvline_contains(sock, needle)
, receive lines until one contains at least one needle, then return that line (supports string and list of strings)sock_recvline_regex(sock, regex)
, receive lines until one matches the regex, then return that linesock_recvn(sock, n)
, receive exactly n bytessock_recvuntil(sock, delim)
, receive until a sequence of bytes is found, then return all data including the sequence (supports string and list of strings)sock_sendafter(sock, delim, data)
, shorthand forsock_recvuntil(sock, delim)
andsock_send(sock, data)
sock_unrecv(sock, data)
, put data back into the buffered readersock_newline(sock, "\r\n")
, update the newlineThe text was updated successfully, but these errors were encountered: