How would I send hex data in a packet? I’m trying to copy a packet exactly by using the hex instead of ASCII. All I’m looking for is what the sendto argument would be if, say, the hex I needed to send was 00AD12.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
structto convert between bytes (typically expressed in hexadecimal fashion) and numbers:If you have a hex string and want to convert it to bytes, use
binascii.unhexlify: