in _pcap.py the sendpacket function is defined as below:
def sendpacket(self, buf) -> int:
"""Send a raw network packet on the interface."""
if _pcap.sendpacket(self.__pcap, buf, len(buf)) == -1:
raise OSError(self.geterr())
return len(buf)
when i try to send a packet, i receive the following error:
Traceback (most recent call last):
File ".\sig.py", line 50, in <module>
for ip in spoofer:
File "C:\Users\<redacted>\Desktop\sig\sig\spoofer.py", line 78, in __next__
self.pc.sendpacket(self.arp_poison_victim)
File "C:\Program Files (x86)\Python38-32\lib\site-packages\pcap\_pcap.py", line 312, in sendpacket
if _pcap.sendpacket(self.__pcap, buf, len(buf)) == -1:
ctypes.ArgumentError: argument 2: <class 'TypeError'>: expected LP_c_ubyte instance instead of bytes
The following fix will resolve the error:
def sendpacket(self, buf) -> int:
"""Send a raw network packet on the interface."""
if _pcap.sendpacket(self.__pcap, ct.cast(ct.c_char_p(buf), ct.POINTER(ct.c_ubyte)), len(buf)) == -1:
raise OSError(self.geterr())
return len(buf)
in _pcap.py the sendpacket function is defined as below:
when i try to send a packet, i receive the following error:
The following fix will resolve the error:
can you fix it in your source?