uroboros-diversification/src/analysis/reassemble_symbol_get.py
def adjust_globallabel(self, g_bss, instr_list):
        """
        Add labels for global external variables (e.g. stderr)
        :param g_bss: list of global .bss symbols (address, name)
        :param instr_list: instruction list
        """
        # g_bss = filter(lambda e: '@' in e[1], g_bss)
        g_bss = filter(lambda e: int(e[0], 16) != 0, g_bss)
        gbss_hs = {'S_0x' + e[0].lstrip('0'): e[1].split('@')[0] if '@' in e[1] else e[1] for e in g_bss}
        labels = gbss_hs.keys()
        def mapper(l):
            # if '.word' in l: return l
            r = next((lab for lab in labels if lab in l), None)
            if r is not None: return l.replace(r, gbss_hs[r], 1)
            return l
        return map(mapper, instr_list)

        Add labels for global external variables (e.g. stderr)
        :param g_bss: list of global .bss symbols (address, name)
        :param instr_list: instruction list
        
Add labels for global external variables
Add labels for global external variables
def adjust_globallabel(self, g_bss, instr_list):
        g_bss = filter(lambda e: int(e[0], 16) != 0, g_bss)
        gbss_hs = {'S_0x' + e[0].lstrip('0'): e[1].split('@')[0] if '@' in e[1] else e[1] for e in g_bss}
        labels = gbss_hs.keys()
        def mapper(l):
            r = next((lab for lab in labels if lab in l), None)
            if r is not None: return l.replace(r, gbss_hs[r], 1)
            return l
        return map(mapper, instr_list)
def adjust_globallabel ( self , g_bss , instr_list ) : g_bss = filter ( lambda e : int ( e [ 0 ] , 16 ) != 0 , g_bss ) gbss_hs = { 'S_0x' + e [ 0 ] . lstrip ( '0' ) : e [ 1 ] . split ( '@' ) [ 0 ] if '@' in e [ 1 ] else e [ 1 ] for e in g_bss } labels = gbss_hs . keys ( ) def mapper ( l ) : r = next ( ( lab for lab in labels if lab in l ) , None ) if r is not None : return l . replace ( r , gbss_hs [ r ] , 1 ) return l return map ( mapper , instr_list )
Add labels for global external variables (e.g.
Add labels for global external variables ( e . g .
"""
        Add labels for global external variables (e.g. stderr)
        :param g_bss: list of global .bss symbols (address, name)
        :param instr_list: instruction list
        """ # g_bss = filter(lambda e: '@' in e[1], g_bss) # if '.word' in l: return l
self
g_bss
list of global .bss symbols (address, name)
list of global . bss symbols ( address name )
instr_list
None