예제 #1
0
    def splitAligned(field, useSemantic=True, doInternalSlick=False):
        """Split the specified field according to the variations of message bytes.
        Relies on a sequence alignment algorithm.

        The following example is an anti-regression test
        for issue https://github.com/netzob/netzob/issues/13 reported by Sergej

        >>> from netzob.all import *
        >>> message1 = TypeConverter.convert("01010600823d16c1040000000000000000000000000000000000000000238b34d4c400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501017401013d070100238b34d4c40c05466c616d653c084d53465420352e30370b010f03062c2e2f1f21f92b2b02dc00ff00000000000000000000", HexaString, Raw)
        >>> message2 = TypeConverter.convert("02010600823d16c10000000000000000c0a80103c0a801010000000000238b34d4c400000000000000000000646f6d65782e6e70732e6564750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501023604c0a80101330400000dec0104ffffff000f000304c0a801010604c0a80101ff000000000000000000000000000000000000000000000000", HexaString, Raw)
        >>> messages = [RawMessage(message1), RawMessage(message2)]
        >>> symbol = Symbol(messages=messages)
        >>> Format.splitAligned(symbol, doInternalSlick=True)
        >>> print(len(symbol.getCells()))
        2

        """
        if field is None:
            raise TypeError("Field cannot be None")

        fs = FieldSplitAligned(doInternalSlick=doInternalSlick)
        fs.execute(field, useSemantic)
예제 #2
0
    def splitAligned(field, useSemantic=True, doInternalSlick=False):
        """Split the specified field according to the variations of message bytes.
        Relies on a sequence alignment algorithm.

        The following example is an anti-regression test
        for issue https://github.com/netzob/netzob/issues/13 reported by Sergej

        >>> from netzob.all import *
        >>> message1 = TypeConverter.convert("01010600823d16c1040000000000000000000000000000000000000000238b34d4c400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501017401013d070100238b34d4c40c05466c616d653c084d53465420352e30370b010f03062c2e2f1f21f92b2b02dc00ff00000000000000000000", HexaString, Raw)
        >>> message2 = TypeConverter.convert("02010600823d16c10000000000000000c0a80103c0a801010000000000238b34d4c400000000000000000000646f6d65782e6e70732e6564750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501023604c0a80101330400000dec0104ffffff000f000304c0a801010604c0a80101ff000000000000000000000000000000000000000000000000", HexaString, Raw)
        >>> messages = [RawMessage(message1), RawMessage(message2)]
        >>> symbol = Symbol(messages=messages)
        >>> Format.splitAligned(symbol, doInternalSlick=True)
        >>> print(len(symbol.getCells()))
        2

        """
        if field is None:
            raise TypeError("Field cannot be None")

        fs = FieldSplitAligned(doInternalSlick=doInternalSlick)
        fs.execute(field, useSemantic)
예제 #3
0
    def splitAligned(field, useSemantic=True, doInternalSlick=False):
        if field is None:
            raise TypeError("Field cannot be None")

        fs = FieldSplitAligned(doInternalSlick=doInternalSlick)
        fs.execute(field, useSemantic)
예제 #4
0
 def symbol_split_align(self, sid):
     symbol = self.get_symbol(sid)
     FieldSplitAligned(doInternalSlick=True).execute(symbol, True)