def PORT(port): from convertoffset import decimaltohex db = [] fixmesempai = re.findall('..?', decimaltohex(str(port))) for x in fixmesempai: if len(x) == 1: x = "0" + x db.append(x) return "\\x" + "\\x".join(db)
def PORT( port): from convertoffset import decimaltohex db = [] fixmesempai = re.findall('..?', decimaltohex(str(port))) for x in fixmesempai: if len(x) == 1: x = "0"+x db.append(x) return "\\x"+"\\x".join(db)
def IP( ip): from convertoffset import decimaltohex #0x101017f : 127.1.1.1 ip = str(ip).split(".") db = [] db2 = [] for x in ip: db.append(decimaltohex( int(x))) for x in db: if len(x) == 1: x = "0"+x db2.append(x) return "\\x"+"\\x".join(db2)
def IP(ip): from convertoffset import decimaltohex #0x101017f : 127.1.1.1 ip = str(ip).split(".") db = [] db2 = [] for x in ip: db.append(decimaltohex(int(x))) for x in db: if len(x) == 1: x = "0" + x db2.append(x) return "\\x" + "\\x".join(db2)