(ar_path: str)
return {
            'arch': arch_name,
            'platform': os_name,
            }
Get basic information of the archive file.
Get basic information of the archive file.
Get basic information of the archive file .
def get_basic_info(ar_path: str) -> Dict[str,str]:
    """
    Get basic information of the archive file.
    """

    with tempfile.TemporaryDirectory() as tempdirname:
        cwd = os.getcwd()
        os.chdir(tempdirname)
        subprocess.call(["ar", "x", ar_path])

        # Load arch and OS information from the first .o file
        o_files = [ f for f in os.listdir(".") if f.endswith(".o") ]
        if o_files:
            proj = angr.Project(o_files[0], auto_load_libs=False)
            arch_name = proj.arch.name.lower()
            os_name = proj.simos.name.lower()

        os.chdir(cwd)

    return {
            'arch': arch_name,
            'platform': os_name,
            }
def get_basic_info ( ar_path : str ) -> Dict [ str , str ] : with tempfile . TemporaryDirectory ( ) as tempdirname : cwd = os . getcwd ( ) os . chdir ( tempdirname ) subprocess . call ( [ "ar" , "x" , ar_path ] ) # Load arch and OS information from the first .o file o_files = [ f for f in os . listdir ( "." ) if f . endswith ( ".o" ) ] if o_files : proj = angr . Project ( o_files [ 0 ] , auto_load_libs = False ) arch_name = proj . arch . name . lower ( ) os_name = proj . simos . name . lower ( ) os . chdir ( cwd ) return { 'arch' : arch_name , 'platform' : os_name , }