Это мой код в сокетах
def send_request(self, query_opcode, extras = b''):
TargetAddress = encode_bytes(*[(int(n)) for n in self.address.split('.')])
TargetPort = encode_bytes(self.port & 0xFF, self.port >> 8 & 0xFF)
PacketBody = b'SAMP' \
+ TargetAddress \
+ TargetPort \
+ query_opcode \
+ extras
self.socket.sendto(PacketBody, (self.address, self.port))
И я хочу передать его scapy, но PacketBody не отправляется
Код Scapy:
def send_request(self, query_opcode, extras = b''):
TargetAddress = encode_bytes(*[(int(n)) for n in self.address.split('.')])
TargetPort = encode_bytes(self.port & 0xFF, self.port >> 8 & 0xFF)
PacketBody = b'SAMP' \
+ TargetAddress \
+ TargetPort \
+ query_opcode \
+ extras
PacketAddress = IP(dst = self.address, src = random.choice(AddressList))
PacketProtocol = UDP(sport = self.port, dport = self.port)
PacketFull = PacketAddress/PacketProtocol/PacketBody
send(PacketFull, verbose = False)