mirror of
https://github.com/lifting-bits/mcsema
synced 2026-06-08 15:31:09 +00:00
2d55d02cc3
* API improvements. Must be used with the api_improvements branch of both Remill and McSema fixes for x86 and running the lifted code with klee * Update dockerfile to clone anvill * update remill commit id * Add python3 to dockerfile * update python3 * disable abi script * Updated cmake to find anvill * Update main.cpp * update find_package for anvill * WIP:updated prebuild cfg * update prebuild cfg files * enable abi build for testsuite * Fix memory leak * install missing package for testcases * frontend: Reflect cfg file changes in dyninst frontend. * frontend: Update local files copyrights to reflect overall change to agplv3. * fix failing testcases * update test cfgs * Fix test failure with local state pointer * set the flag to use local state_ptr in default mode Co-authored-by: kumarak <iit.akshay@gmail.com> Co-authored-by: Lukas Korencik <xkorenc1@fi.muni.cz>
57 lines
1.7 KiB
Python
57 lines
1.7 KiB
Python
# Copyright (c) 2020 Trail of Bits, Inc.
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU Affero General Public License as
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
# License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU Affero General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
import os
|
|
|
|
def strip_whole_config(filename):
|
|
if not filename.endswith(".config"):
|
|
return ""
|
|
filename = filename.rstrip(".config")
|
|
basename, ext = os.path.splitext(filename)
|
|
return basename
|
|
|
|
def get_binaries(directory):
|
|
result = set()
|
|
for f in os.listdir(directory):
|
|
filename = strip_whole_config(f)
|
|
if filename:
|
|
result.add(filename)
|
|
return result
|
|
|
|
def get_tags(config):
|
|
with open(config, 'r') as f:
|
|
line = f.readline().rstrip('\n')
|
|
tokens = line.split(' ')
|
|
if tokens[0] != 'TAGS:':
|
|
return []
|
|
return tokens[1:]
|
|
|
|
def get_bin2tags(directory):
|
|
result = {}
|
|
for f in os.listdir(directory):
|
|
filename = strip_whole_config(f)
|
|
if not filename:
|
|
continue
|
|
|
|
tags = get_tags(os.path.join(directory, f))
|
|
if filename not in result:
|
|
result[filename] = tags
|
|
else:
|
|
result[filename].append(tags)
|
|
return result
|
|
|
|
def get_cfg(directory, name):
|
|
return os.path.join(directory, name + '.cfg')
|