uroboros-diversification/src/analysis/reassemble_symbol_get.py
def traverse64(self, l, startaddr):
        """
        Traverse data section, find pointers using 64bit alignment and substitute them with labels
        :param l: .byte declaration list
        :param startaddr: section start address
        """
        i = 0
        holei = 0
        while holei < len(self.exclude) and startaddr > self.exclude[holei][1]: holei += 1
        while i < len(l) - 7:
            val = int(''.join(map(lambda e: e[1][8:10], reversed(l[i:i+8]))), 16)
            s = self.check_sec(val)
            if s is not None:
                if self.assumption_two:
                    self.in_jmptable = False
                else:
                    if s.sec_name == '.plt' and val in self.plt_symbols:
                        l[i] = (l[i][0], '.quad ' + self.plt_symbols[val])
                        l[i+1:i+8] = [('', '')] * 7
                    else:
                        self.data_labels.insert(0, (s.sec_name, val))
                        l[i] = (l[i][0], '.quad S_0x%X' % val)
                        l[i+1:i+8] = [('', '')] * 7
            else:
                if self.check_text(val):
                    c = bbn_byloc(val, self.begin_addrs) if self.assumption_three else True
                    if c or (not c and self.check_jmptable(l[i][0], val)):
                        if c and self.check_jmptable_1(l[i][0]):
                            self.in_jmptable = True
                            self.cur_func_name = self.fn_byloc(val)
                        else: self.in_jmptable = False
                        self.text_labels.insert(0, val)
                        l[i] = (l[i][0], '.quad S_0x%X' % val)
                        l[i+1:i+8] = [('', '')] * 7
                    else: self.in_jmptable = False
                else: self.in_jmptable = False
            if holei < len(self.exclude) and self.exclude[holei][0] <= startaddr + i + 8 <= self.exclude[holei][1]:
                i = self.exclude[holei][1] - startaddr
                i += 8 - i % 8
                holei += 1
            else: i += 8

        Traverse data section, find pointers using 64bit alignment and substitute them with labels
        :param l: .byte declaration list
        :param startaddr: section start address
        
Traverse data section, find pointers using 64bit alignment and substitute them with labels
Traverse data section find pointers using 64bit alignment and substitute them with labels
def traverse64(self, l, startaddr):
        i = 0
        holei = 0
        while holei < len(self.exclude) and startaddr > self.exclude[holei][1]: holei += 1
        while i < len(l) - 7:
            val = int(''.join(map(lambda e: e[1][8:10], reversed(l[i:i+8]))), 16)
            s = self.check_sec(val)
            if s is not None:
                if self.assumption_two:
                    self.in_jmptable = False
                else:
                    if s.sec_name == '.plt' and val in self.plt_symbols:
                        l[i] = (l[i][0], '.quad ' + self.plt_symbols[val])
                        l[i+1:i+8] = [('', '')] * 7
                    else:
                        self.data_labels.insert(0, (s.sec_name, val))
                        l[i] = (l[i][0], '.quad S_0x%X' % val)
                        l[i+1:i+8] = [('', '')] * 7
            else:
                if self.check_text(val):
                    c = bbn_byloc(val, self.begin_addrs) if self.assumption_three else True
                    if c or (not c and self.check_jmptable(l[i][0], val)):
                        if c and self.check_jmptable_1(l[i][0]):
                            self.in_jmptable = True
                            self.cur_func_name = self.fn_byloc(val)
                        else: self.in_jmptable = False
                        self.text_labels.insert(0, val)
                        l[i] = (l[i][0], '.quad S_0x%X' % val)
                        l[i+1:i+8] = [('', '')] * 7
                    else: self.in_jmptable = False
                else: self.in_jmptable = False
            if holei < len(self.exclude) and self.exclude[holei][0] <= startaddr + i + 8 <= self.exclude[holei][1]:
                i = self.exclude[holei][1] - startaddr
                i += 8 - i % 8
                holei += 1
            else: i += 8
def traverse64 ( self , l , startaddr ) : i = 0 holei = 0 while holei < len ( self . exclude ) and startaddr > self . exclude [ holei ] [ 1 ] : holei += 1 while i < len ( l ) - 7 : val = int ( '' . join ( map ( lambda e : e [ 1 ] [ 8 : 10 ] , reversed ( l [ i : i + 8 ] ) ) ) , 16 ) s = self . check_sec ( val ) if s is not None : if self . assumption_two : self . in_jmptable = False else : if s . sec_name == '.plt' and val in self . plt_symbols : l [ i ] = ( l [ i ] [ 0 ] , '.quad ' + self . plt_symbols [ val ] ) l [ i + 1 : i + 8 ] = [ ( '' , '' ) ] * 7 else : self . data_labels . insert ( 0 , ( s . sec_name , val ) ) l [ i ] = ( l [ i ] [ 0 ] , '.quad S_0x%X' % val ) l [ i + 1 : i + 8 ] = [ ( '' , '' ) ] * 7 else : if self . check_text ( val ) : c = bbn_byloc ( val , self . begin_addrs ) if self . assumption_three else True if c or ( not c and self . check_jmptable ( l [ i ] [ 0 ] , val ) ) : if c and self . check_jmptable_1 ( l [ i ] [ 0 ] ) : self . in_jmptable = True self . cur_func_name = self . fn_byloc ( val ) else : self . in_jmptable = False self . text_labels . insert ( 0 , val ) l [ i ] = ( l [ i ] [ 0 ] , '.quad S_0x%X' % val ) l [ i + 1 : i + 8 ] = [ ( '' , '' ) ] * 7 else : self . in_jmptable = False else : self . in_jmptable = False if holei < len ( self . exclude ) and self . exclude [ holei ] [ 0 ] <= startaddr + i + 8 <= self . exclude [ holei ] [ 1 ] : i = self . exclude [ holei ] [ 1 ] - startaddr i += 8 - i % 8 holei += 1 else : i += 8
Traverse data section, find pointers using 64bit alignment and substitute them with labels
Traverse data section find pointers using 64bit alignment and substitute them with labels
"""
        Traverse data section, find pointers using 64bit alignment and substitute them with labels
        :param l: .byte declaration list
        :param startaddr: section start address
        """
self
l
.byte declaration list
. byte declaration list
startaddr
section start address
section start address