18 Commits

Author SHA1 Message Date
Peter Matula
5281b06dc8
Retdec is a library now (#779)
* llvmir-emul: do not include llvm/Support/PluginLoader.h

This must not be included in a library.

* bin2llvmirtool: simplify

* llvmir2hlltool: do not include llvm/Support/PluginLoader.h

It is not needed and it is dangerous because it contains "load" option which can be included only once.

* bin2llvmir/providers/config: use params output file to generate config

* config/parameters: add more params

* bin2llvmir: add config-generator pass

* retdec/retdec: add super ugly decompilation API

* stacofin: stricter signature filtering

This is still very shitty. A better solution would be using some metadata in signature files - not the current signature-file-path-based filtering.

* progress: all test from "integration.ack" work

* progress

* progress

* do not manually create passes in code, use just the pass list

* create LlvmIr2Hll pass in llvmir2hll lib

* progress

* add decompiler-config.json

* aggregate LLVM passes

* add -k option

* bin2llvmir/config: fix Config::empty()

* bin2llvmir/unreahable_funcs: use params to disable opt

* retdec-decompiler: add more command line options

* progress

* all regression tests pass

* src/configtool: remove, not needed anymore

* config: remove isFromIda flag

* config: remove unused exceptions

* configL fix exceptions

* config: remove frontend version entry

* config: remove some duplicate values

* config: refactor

* config: refactor

* bin2llvmir: fix #301, fix #750, proper removal of artificial undef functions

* deps/llvm: update ref to fix gcc 10 compilation error

* deps/llvm: enable exeptions and RTTI

* progress

* remove debug msgs

* tests/debugformat_tests: fix compilation

* replace retdec-decompiler.py with retdec-decompiler

* retdec-decompiler: return decompilation error code

* tests/bin2llvmir/unreachable_funcs: fix JSON configs

* progress

* llvmir2hll: remove code specific for Python output HLL

* llvmir2hll: fix JSON output generation

* progress

* progress

* progress

* remove bin2llvmirtool and llvmir2hlltool

* refactor

* tests/bin2llvmir/x87_fpu: fix compilation

* unpackertool: do not build unpaker plugins separatelly

* scripts: return retdec-fileinfo.py back, some reg tests need it

* bin2llvmir: fix doxygen warnings

* set CMAKE_POSITION_INDEPENDENT_CODE and propagate it to deps

* Win: macOS: link llvmir2hll to decompiler target

* bin2llvmir/lti: fix pat filtering on windows

* retdec-decompiler: increase windows stack size

Co-authored-by: Peter Kubov <peter.kubov@avast.com>
2020-06-05 07:42:46 +02:00
Petr Zemek
09fde139ad scripts: Make CmdRunner.run_cmd() class method.
This allows us to replace

    CmdRunner().run_cmd()

with

    CmdRunner.run_cmd()

We could go even further and make it a regular function instead of a class
method.
2019-02-07 11:57:54 +01:00
Petr Zemek
9f80cde919 scripts: Move imports to the top and order them.
To adhere to our code conventions.

This also fixes the following flake8 warnings:

    E402 module level import not at top of file
2019-02-07 09:16:25 +01:00
Petr Zemek
1153e5fc62 scripts: Add missing whitespace around arithmetic operators.
This fixes the following two flake8 warnings:

    retdec-signature-from-library-creator.py:131:43: E226 missing whitespace around arithmetic operator
    retdec-tests-runner.py:108:59: E226 missing whitespace around arithmetic operator
2019-02-07 08:58:43 +01:00
Petr Zemek
4c5d350650
Merge pull request #484 from astrelsky/master
Added option -l --list to retdec-bin2pat.
2019-02-07 08:42:13 +01:00
astrelsky
94fdc3e972 Added option -l --list to retdec-bin2pat.
The added option -l --list is being used to pass the list of objects
from retdec-signature-from-library-creator.py as a text file.
Resolves #472
2019-02-06 10:24:40 -05:00
Petr Zemek
657e07f529 scripts: Remove unused imports. 2019-02-06 09:57:16 +01:00
Petr Zemek
c9673dbb22 scripts: Add a check that scripts are run from an installation directory.
This helps to assist our users when they try to run the scripts from the
'retdec/scripts' directory instead of from an installed RetDec (#418).
2018-10-19 07:09:17 +02:00
Peter Matula
f8d595316e scripts: add Python version checks - at least Python 3.4 is required.
If version < 3.4 print error and die. Related to
https://github.com/avast-tl/retdec-idaplugin/issues/32 and other
instances when users tried to run RetDec scripts with old Python.
2018-09-03 13:50:48 +02:00
Petr Zemek
b9d4ef2d16 scripts: Unify hashbangs at the beginning of scripts.
We should be consistent (other hashbangs do not contain a space after #!).
2018-08-31 10:25:28 +02:00
Peter Matula
58b54ba385 scripts: run all commands through utils.CmdRunner, not subprocess.call 2018-08-03 10:51:21 +02:00
Peter Matula
890eb66ed9 retdec-utils.py: remove Utils class, leave only standalone functions. 2018-08-02 16:57:20 +02:00
Peter Matula
f5f182648b retdec-signature-from-library-creator.py: append pattern files to list
before, files were not appended, the list was recreated each time with
only a single file.
2018-08-01 13:30:53 +02:00
Peter Matula
89c2c13b5d scripts: refactor. 2018-07-24 15:50:41 +02:00
Peter Matula
3e7c60c5cd scripts: make pythons scripts runnable in python3.4 2018-07-20 14:35:47 +02:00
Peter Matula
0e346740c3 scripts: refactor. 2018-07-19 15:03:26 +02:00
Peter Matula
18a3757bf8 scripts: force unbuffered stdout. 2018-07-19 11:54:40 +02:00
Peter Matula
ce163a6a54 use '-' instead of '_' in retdec's python script names 2018-07-18 12:05:32 +02:00