uroboros-diversification/src/disasm/pic_process.py
def info_collect(f):
    """
    Retrieve info about .got.plt section
    :param f: path to target executable
    """
    info = check_output("readelf -S " + f + " | awk '$2==\".got.plt\" {print $2,$4,$5,$6}'", shell=True).strip()
    with open('gotplt.info', 'w') as f: f.write(info)
    def mapper(l):
        items = l.split()
        # name ;  begin addr; ... ; size
        return (items[0], (int(items[1], 16), int(items[3], 16)))
    return dict(map(mapper, info.split('\n')))

    Retrieve info about .got.plt section
    :param f: path to target executable
    
Retrieve info about .got.plt section
Retrieve info about . got . plt section
def info_collect(f):
    info = check_output("readelf -S " + f + " | awk '$2==\".got.plt\" {print $2,$4,$5,$6}'", shell=True).strip()
    with open('gotplt.info', 'w') as f: f.write(info)
    def mapper(l):
        items = l.split()
        return (items[0], (int(items[1], 16), int(items[3], 16)))
    return dict(map(mapper, info.split('\n')))
def info_collect ( f ) : info = check_output ( "readelf -S " + f + " | awk '$2==\".got.plt\" {print $2,$4,$5,$6}'" , shell = True ) . strip ( ) with open ( 'gotplt.info' , 'w' ) as f : f . write ( info ) def mapper ( l ) : items = l . split ( ) return ( items [ 0 ] , ( int ( items [ 1 ] , 16 ) , int ( items [ 3 ] , 16 ) ) ) return dict ( map ( mapper , info . split ( '\n' ) ) )
Retrieve info about .got.plt section
Retrieve info about . got . plt section
"""
    Retrieve info about .got.plt section
    :param f: path to target executable
    """ # name ;  begin addr; ... ; size
f
path to target executable
path to target executable