Files
lifting-bits-mcsema/tests/integration_tests/populate.py
T
Peter Goodman 2d55d02cc3 API improvements. Must be used with the api_improvements branches of Remill and Anvill (#666)
* 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>
2020-07-23 02:14:56 -04:00

67 lines
1.9 KiB
Python
Executable File

#!/usr/bin/env python3
# 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
import shutil
import stat
import colors
import util
tags_dir = "tags"
bin_dir = "bin"
def try_find(locations, basename):
for p in locations:
maybe = os.path.join(p, basename)
if os.path.isfile(maybe):
print(" > " + colors.green("Found " + maybe))
new_file = os.path.join(bin_dir, basename)
shutil.copyfile(maybe, new_file)
st = os.stat(new_file)
os.chmod(new_file, st.st_mode | stat.S_IEXEC)
return True
return False
def main():
# TODO: Make it portable
locations = [ "/usr/bin", "/bin"]
current = set()
# If `bin` does not exist create it first
if not os.path.isdir(bin_dir):
os.mkdir(bin_dir)
for f in os.listdir(bin_dir):
current.add(f)
for f in os.listdir(tags_dir):
basename = util.strip_whole_config(f)
if not basename:
continue
if basename in current:
print(" > " + basename + " is present in " + tags_dir)
continue
if not try_find(locations, basename):
print(" > " + colors.red(basename + " not found anywhere"))
if __name__ == '__main__':
main()