uroboros-diversification/src/analysis/reassemble_symbol_get.py
def gotexternals(self):
        """
        Replace external symbols in .got
        """
        with open('gotglobals.info') as f:
            def mapper(l):
                items = l.split()
                return (int(items[0], 16), items[1].split('@')[0])
            syms = sorted(map(mapper, f), key=lambda e: e[0])
        gotsec = self.sec['.got']
        datatype = '.long ' if ELF_utils.elf_32() else '.quad '
        skiplen = 3 if ELF_utils.elf_32() else 7
        syms = filter(lambda s: gotsec.sec_begin_addr <= s[0] < gotsec.sec_begin_addr + gotsec.sec_size, syms)
        for s in syms:
            off = s[0] - gotsec.sec_begin_addr
            self.got_list[off] = ('S_' + dec_hex(s[0]) + ': ', datatype + s[1])
            self.got_list[off+1:off+1+skiplen] = [('', '')] * skiplen

        Replace external symbols in .got
        
Replace external symbols in .got
Replace external symbols in . got
def gotexternals(self):
        with open('gotglobals.info') as f:
            def mapper(l):
                items = l.split()
                return (int(items[0], 16), items[1].split('@')[0])
            syms = sorted(map(mapper, f), key=lambda e: e[0])
        gotsec = self.sec['.got']
        datatype = '.long ' if ELF_utils.elf_32() else '.quad '
        skiplen = 3 if ELF_utils.elf_32() else 7
        syms = filter(lambda s: gotsec.sec_begin_addr <= s[0] < gotsec.sec_begin_addr + gotsec.sec_size, syms)
        for s in syms:
            off = s[0] - gotsec.sec_begin_addr
            self.got_list[off] = ('S_' + dec_hex(s[0]) + ': ', datatype + s[1])
            self.got_list[off+1:off+1+skiplen] = [('', '')] * skiplen
def gotexternals ( self ) : with open ( 'gotglobals.info' ) as f : def mapper ( l ) : items = l . split ( ) return ( int ( items [ 0 ] , 16 ) , items [ 1 ] . split ( '@' ) [ 0 ] ) syms = sorted ( map ( mapper , f ) , key = lambda e : e [ 0 ] ) gotsec = self . sec [ '.got' ] datatype = '.long ' if ELF_utils . elf_32 ( ) else '.quad ' skiplen = 3 if ELF_utils . elf_32 ( ) else 7 syms = filter ( lambda s : gotsec . sec_begin_addr <= s [ 0 ] < gotsec . sec_begin_addr + gotsec . sec_size , syms ) for s in syms : off = s [ 0 ] - gotsec . sec_begin_addr self . got_list [ off ] = ( 'S_' + dec_hex ( s [ 0 ] ) + ': ' , datatype + s [ 1 ] ) self . got_list [ off + 1 : off + 1 + skiplen ] = [ ( '' , '' ) ] * skiplen
Replace external symbols in .got
Replace external symbols in . got
"""
        Replace external symbols in .got
        """
self