Skip to content

Instantly share code, notes, and snippets.

View zoriankazinski's full-sized avatar

zorian kazinski zoriankazinski

View GitHub Profile
import socket
import ctypes
import ctypes.util
SO_ATTACH_FILTER = 26
class BpfInsn(ctypes.Structure):
# https://unix.superglobalmegacorp.com/BSD4.4/newsrc/net/bpf.h.html - bpf_insn
# The instruction data structure.
def _masquerade(self,origin):
self.__class__ = type(origin.__class__.__name__,(self.__class__,origin.__class__),{})
self.__dict__ = origin.__dict__