64 Commits

Author SHA1 Message Date
Peter Matula
7f807bdc20 cmake/deps.cmake: replace INTERNAL with STRING in set()
INTERNAL implies FORCE and therefore rewrites user's variables. These variables were not meant to be changed by the user, but in some cases, if the users knows what they are doing, they could do so.
2020-08-05 10:11:57 +02:00
Matula Peter
183747b4f0 cmake/deps: update yaramod reference 2020-07-30 13:48:23 +02:00
Peter Kubov
b59f811f23
Provide unified logging interface (#816)
* retdec::io: new logging interface

Provides new logging interface that is ment to unify output that
is produced in each part of RetDec decompiler.

The interface is designed to provide eazy management
of logging into files/tty.

Currently each module od decompiler manages logging on its own.
This is not sustainable state as change to logging interface
is rather difficult.

* Use retdec::io interface for logging

* Get rid of llvm-support module

This module is now obsolete as all logging mechanisms
have been transferred to retdec::io module.

* Provide option [-s|--silent]

Provides new option [-s|--silent] for retdec-decompiler executable.
This option will force retdec not to output anything on stdout.

* retdec/config: provide option to specify Log/Error files

Provides way to specify Log/Error files to RetDec.
This is useful for RetDec plugins that might this way
control decompilation output.

* Create loggers from user configuration

* Fix validators error messages

Fixes bug provided by fbbff343.

* Change Log functions to return new object

Provides change to log interface. Before this commit
logging was done on global objects. Now the logging
should be made on temporary objects that are returned
from special functions.

The reason for this is for usage of colors on output.
When temporary object is destructed default color is
printed on required interface.

* Change namespace Log to class Log

This way we can avoid not intentional usage of the
Log interface.

All functions of Log are ment to be used like:

Log::info()
Log::debug()
Log::error()

* Provide missing doxygen

* Fix missing cassert header

Fixes dc5791724.

* Enable ANSI colors on Windows

Starting Windows aniversary update Windows terminals provide
supprot for ANSI colors. This, however, needs to be enabled
manually.

More about this can be found here:
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences?redirectedfrom=MSDN

* utils/io/logger: don't print colors to not supported terminals

* Use macro OS_WINDOWS instead of __has_include

Provides substitution of __has_include macro to OS_WINDOWS defined
in utils/os.h. The reason for this is to maintain a level of
consistency in RetDec source code base.

* Add a CHANGELOG entry for #791
2020-07-23 09:29:10 +02:00
Matula Peter
e24b7b86d9 deps/eigen: do not install the target.
Use it directly where needed.
2020-07-21 14:18:15 +02:00
Matula Peter
cd4a8c491b deps/whereami: remove target for this module
Add its source and header directly to its only user. This is uglier, but much simpler than dealing with targets, exports, installs, etc. This will never be used outside of utils library.
2020-07-21 12:35:24 +02:00
Matula Peter
675cbd8916 cmake/deps: remove Eigen entries 2020-07-21 11:51:42 +02:00
Matula Peter
6745288227 deps/openssl: remove, require it as a prerequisite.
Also refactor (i.e. remove) RetDec's Crypto library.
2020-07-14 17:40:27 +02:00
Peter Matula
9ee4783ab3 deps/yaramod: propagate CMAKE_CXX_FLAGS_DEBUG 2020-06-12 14:29:47 +02:00
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
JurajHolub
2183f846ae
Extension of bin2llvmir with optimization of X87 FPU stack. (#715)
* capstone2llvmir/x86: Add support of x87 FISTPP instruction and unit tests of new supported instruction.

* capstone2llvmir/x86: Add support of x87 FCMOVEcc instructions and unit test of new supported instructions.

* capstone2llvmir/x86: Add support of x87 FPREM instructions and unit test of new supported instructions.

* capstone2llvmir/x86: Add tests for x87 FPREM instructions.

* capstone2llvmir/x86: Add support of x87 F2XM1, FYL2X, FYL2xP1 instructions and unit test of new supported instructions.

* capstone2llvmir/x86: Add support of x87 FFREE instructions and unit test of new supported instructions.

* capstone2llvmir/x86: Add support of x87 FNSTCW instructions and unit test of new supported instructions.

* bin2llvmir/optimizations/x87_fpu: Add test for x87 fpu analysis and fix register indexing bug.

* bin2llvmir/optimizations/x87_fpu: Fix test for x87 fpu analysis.

* capstone2llvmir/x86.cpp: remove extra new lines

* capstone2llvmir/x86_impl.h: remove extra newline & indent

* capstone2llvmir/x86: Fix indention of new tests + comments.

* bin2llvmir/optimizations/x87_fpu: Create tests for different calling conventions and different architectures of x86.

Tests for architectures x86-16, x86-32, x86-64.
Tests for calling conventions cdecl, pascal, fastcall, stdcall, thiscall.

* capstone2llvmir/x86: Unit tests and translation of all FPU capstone instruction to llvmir.

FBLD, FBSTP, FNCLEX, FLDCW, FLDENV, FRSTOR, FNSAVE, FNSTENV, FNSTCW, FXSAVE, FXSAVE64, FXRSTOR, FXRSTOR64, FPTAN, FPATAN, FSCALE, FXTRACT, FXAM.

* capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.

* config: Include "watcom" calling convention.

* bin2llvmir/optimizations/x87_fpu: Tests for x87 FPU analyze.

Tests for calling conventions:
- x86-16: cdecl, pascal, fastcall, watcom, unknown
- x86-32: cdecl, stdcall, pascal, fastcall, thiscall, watcom, unknown
- x86-64

* bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for functions with floating point return value (definitions and calls).

Analyzed calling conventions:
- x86-16: cdecl, pascal, fastcall, watcom, unknown
- x86-32: cdecl, stdcall, pascal, fastcall, thiscall, watcom, unknown
- x86-64

* bin2llvmir/optimizations/x87_fpu: Tests for FPU register stack usage with branches and loops.

* bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for nested blocks (branches, loops).

* bin2llvmir/optimizations/x87_fpu: Fix nested blocks analyze tests.

* bin2llvmir/optimizations/x87_fpu: Implement linear equation solver of basic block TOP tracking. Include OpenCV lib.

* bin2llvmir/optimizations/x87_fpu: FPU TOP optimization implemented for simple and nested BasicBlocks, floating-point return values of functions.

TODO: Import OpenCV library to Cmake build. Implement special calling conventions for 32bit architecture.

* capstone2llvmir/x86: Add support of x87 FPREM instructions and unit test of new supported instructions.

* capstone2llvmir/x86: Add support of x87 FNSTCW instructions and unit test of new supported instructions.

* capstone2llvmir/x86_impl.h: remove extra newline & indent

* capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.

* deps/eigen: Include third party library Eigen to cmake of project. Library is used to math computation with matricies for X86 FPU analyze optimization.

* bin2llvmir/optimization/x87_fpu: Rewrite optimization with new Eigen library. Use matrix implementation of SVD from eigen library.

* tests/bin2llvmir: Refactor CMakeLists.txt

* bin2llvmir/optimization/x87_fpu: Fix bux for X86-16bit calling convention. Optimization now validate value of FPU top at the end of every terminating block and detects unsupported states.

* bin2llvmir/optimizations/x87_fpu: Fix and improve FPU stack optimization testss

* bin2llvmir/optimizations/x87_fpu: Fix major bug of overdetermined linear equation solver and minor bugs of final llvm ir generating.

* capstone2llvmir/x86: Add support of x87 FPREM instructions and unit test of new supported instructions.

* capstone2llvmir/x86: Add support of x87 FNSTCW instructions and unit test of new supported instructions.

* bin2llvmir/optimizations/x87_fpu: Add test for x87 fpu analysis and fix register indexing bug.

* bin2llvmir/optimizations/x87_fpu: Fix test for x87 fpu analysis.

* capstone2llvmir/x86_impl.h: remove extra newline & indent

* bin2llvmir/optimizations/x87_fpu: Create tests for different calling conventions and different architectures of x86.

Tests for architectures x86-16, x86-32, x86-64.
Tests for calling conventions cdecl, pascal, fastcall, stdcall, thiscall.

* capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.

* capstone2llvmir/x86: Add support of x87 FPREM instructions and unit test of new supported instructions.

* capstone2llvmir/x86_impl.h: remove extra newline & indent

* capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.

* bin2llvmir/optimizations/x87_fpu: Tests for x87 FPU analyze.

Tests for calling conventions:
- x86-16: cdecl, pascal, fastcall, watcom, unknown
- x86-32: cdecl, stdcall, pascal, fastcall, thiscall, watcom, unknown
- x86-64

* bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for functions with floating point return value (definitions and calls).

Analyzed calling conventions:
- x86-16: cdecl, pascal, fastcall, watcom, unknown
- x86-32: cdecl, stdcall, pascal, fastcall, thiscall, watcom, unknown
- x86-64

* bin2llvmir/optimizations/x87_fpu: Tests for FPU register stack usage with branches and loops.

* bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for nested blocks (branches, loops).

* bin2llvmir/optimizations/x87_fpu: Fix nested blocks analyze tests.

* bin2llvmir/optimizations/x87_fpu: Implement linear equation solver of basic block TOP tracking. Include OpenCV lib.

* bin2llvmir/optimizations/x87_fpu: FPU TOP optimization implemented for simple and nested BasicBlocks, floating-point return values of functions.

TODO: Import OpenCV library to Cmake build. Implement special calling conventions for 32bit architecture.

* deps/eigen: Include third party library Eigen to cmake of project. Library is used to math computation with matricies for X86 FPU analyze optimization.

* bin2llvmir/optimization/x87_fpu: Rewrite optimization with new Eigen library. Use matrix implementation of SVD from eigen library.

* tests/bin2llvmir: Refactor CMakeLists.txt

* bin2llvmir/optimization/x87_fpu: Fix bux for X86-16bit calling convention. Optimization now validate value of FPU top at the end of every terminating block and detects unsupported states.

* bin2llvmir/optimizations/x87_fpu: Fix and improve FPU stack optimization testss

* bin2llvmir/optimizations/x87_fpu: Fix major bug of overdetermined linear equation solver and minor bugs of final llvm ir generating.

* capstone2llvmir/x86: Add support of x87 FPREM instructions and unit test of new supported instructions.

* capstone2llvmir/x86: Add support of x87 FNSTCW instructions and unit test of new supported instructions.

* bin2llvmir/optimizations/x87_fpu: Add test for x87 fpu analysis and fix register indexing bug.

* bin2llvmir/optimizations/x87_fpu: Fix test for x87 fpu analysis.

* capstone2llvmir/x86_impl.h: remove extra newline & indent

* bin2llvmir/optimizations/x87_fpu: Create tests for different calling conventions and different architectures of x86.

Tests for architectures x86-16, x86-32, x86-64.
Tests for calling conventions cdecl, pascal, fastcall, stdcall, thiscall.

* capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.

* capstone2llvmir/x86: Add support of x87 FPREM instructions and unit test of new supported instructions.

* bin2llvmir/optimizations/x87_fpu: Tests for x87 FPU analyze.

Tests for calling conventions:
- x86-16: cdecl, pascal, fastcall, watcom, unknown
- x86-32: cdecl, stdcall, pascal, fastcall, thiscall, watcom, unknown
- x86-64

* bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for functions with floating point return value (definitions and calls).

Analyzed calling conventions:
- x86-16: cdecl, pascal, fastcall, watcom, unknown
- x86-32: cdecl, stdcall, pascal, fastcall, thiscall, watcom, unknown
- x86-64

* bin2llvmir/optimizations/x87_fpu: Tests for FPU register stack usage with branches and loops.

* bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for nested blocks (branches, loops).

* bin2llvmir/optimizations/x87_fpu: Fix nested blocks analyze tests.

* bin2llvmir/optimizations/x87_fpu: Implement linear equation solver of basic block TOP tracking. Include OpenCV lib.

* bin2llvmir/optimizations/x87_fpu: FPU TOP optimization implemented for simple and nested BasicBlocks, floating-point return values of functions.

TODO: Import OpenCV library to Cmake build. Implement special calling conventions for 32bit architecture.

* capstone2llvmir/x86: Add support of x87 FPREM instructions and unit test of new supported instructions.

* capstone2llvmir/x86_impl.h: remove extra newline & indent

* capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.

* deps/eigen: Include third party library Eigen to cmake of project. Library is used to math computation with matricies for X86 FPU analyze optimization.

* bin2llvmir/optimization/x87_fpu: Rewrite optimization with new Eigen library. Use matrix implementation of SVD from eigen library.

* tests/bin2llvmir: Refactor CMakeLists.txt

* bin2llvmir/optimization/x87_fpu: Fix bux for X86-16bit calling convention. Optimization now validate value of FPU top at the end of every terminating block and detects unsupported states.

* bin2llvmir/optimizations/x87_fpu: Fix and improve FPU stack optimization testss

* bin2llvmir/optimizations/x87_fpu: Fix major bug of overdetermined linear equation solver and minor bugs of final llvm ir generating.

* capstone2llvmir/x86_impl.h: remove extra newline & indent

* bin2llvmir/optimizations/x87_fpu: Create tests for different calling conventions and different architectures of x86.

Tests for architectures x86-16, x86-32, x86-64.
Tests for calling conventions cdecl, pascal, fastcall, stdcall, thiscall.

* capstone2llvmir/x86: Add support of x87 FPREM instructions and unit test of new supported instructions.

* capstone2llvmir/x86_impl.h: remove extra newline & indent

* bin2llvmir/optimization/x87_fpu: Fix bux for X86-16bit calling convention. Optimization now validate value of FPU top at the end of every terminating block and detects unsupported states.

* bin2llvmir/optimizations/x87_fpu: Fix and improve FPU stack optimization testss

* src/capstone2llvmir/x86: Fix and remove duplicities caused by my incorrect merge commit

* src/bin2llvmir/x87_fpu: Fix bug - remove forgotten declaration.

* src/bin2llvmir/x87_fpu: Fix bug - make analyze more accurate: fix some bugs when TOP is changed but not stored etc.

* tests/bin2llvmir/optimizations/x87_fpu: Rewrite actual and include new tests - fix bugs revealed by integration tests analyze.

* src/bin2llvmir/optimizations/x87_fpu: Fix bugs revealed by integration testing and improve performance of this optimization.

* src/capstoce2llvmir/x86: Fix merge conflict.

* deps/eigen: Remove Eigen library from deps and moves it into external libs.

* tests/bin2llvmir/optimizations/x87_fpu: Remove tests to 16bit architecture because this feature has depreaced due to unacceptable performance lack.

* src/bin2llvmir/optimizations/x87_fpu: Improve and optimize performance of algorithm. Replace SVD decomposition for QR decomosition due to performance increase. Fix includes for eigen library that is now external project. Optimize matrix rank calculation.

* bin2llvmir/optimization/x87_fpu: Set max performance ceil.

* Add External Eigen to cmake/deps.

* deps/eigen: Update CMake build.

* deps/eigen: Update CMake build.

* bin2llvmir/x87_fpu: Update analyze and tests -> remove FPU TAGS because RetDec do not use them anymore.

* deps/eigen: Fix eigen INTERFACE_INCLUDE_DIRECTORIES which was prefixed in the build directory.

Co-authored-by: Peter Matula <peter.matula@avast.com>
2020-05-28 14:31:04 +02:00
Peter Matula
80bbf2ae2f
Update Yara to 4.0.1 (#769)
* yara: update to v4.0.1, fix #758, fix #283.

Yaracpp needed some work, because YARA interface changed. Also, I simplified and refactored Yaracpp a bit.

* yara_patterns/tools/pe/x86/packers: modify eziriz_dotnet_reactor_62_or_newer rule

Looks like the new YARA 4.0.1 ends dotnet user strings only with "\x00" instead of "\x00\x00" as before.

* yaracpp: fix doxygen comment

* yaracpp: fix doxygen warning

* deps/yara: better (more general) patching
2020-05-21 14:29:55 +02:00
Peter Matula
61c4947ef5 deps/llvm: update ref to fix gcc 10 compilation error 2020-05-18 19:28:34 +02:00
Peter Matula
a728ec2d33 cmake/deps.cmake: update LLVM to the latest commit.
fix https://github.com/avast/retdec/issues/744
2020-04-27 18:02:03 +02:00
Peter Matula
b69ff6313e Merge branch 'master' into optimizations 2020-04-07 00:22:33 +02:00
Peter Matula
db2abb22fc cmake/options: enablr retdectool only if RETDEC_DEV_TOOLS set 2020-04-06 19:35:58 +02:00
Peter Matula
e36e7094c8 CMakeLists.txt: install BUILD-ID file containing git commit and date
Using GetGitRevisionDescription.cmake to get the git commit.
See https://github.com/rpavlik/cmake-modules
2020-04-06 19:02:20 +02:00
Peter Matula
8fea90b2f7
New build system (#730)
* something working

* progress

* progress

* progress

* cmake: fix common and add ctypes

* src/serdes: new build system

* new build system for pdbparser

* new build system for yaracpp

* new build system for crypto component

* new build system for config

* refactor cmake for retdec-configtool

* new build system for idr2pat

* new build system for ar-extractor and its LLVM dependency

* refactor the new build system

* new build for ar-extractortool

* new build system for macho-extractor and macho-extractortool

* new build for ctypesparser, demangler, and demanglertool

* new build for llvm-support and llvmir-emul

* new build for capstone2llvmir and capstone2llvmirtool

* new build for fileformat, loader, cpdetect, fileinfo

* new build for most remaining modules

* cmake/options.cmake: fix debugformat enable settings

* some build system fixes

* cmake/options.cmake: make RETDEC_ENABLE_ALL into option

this allows us to set it to ODD and build only documentation

* tests: new build system for unit tests

* pelib: fix doxygen comment

* retdec/retdec: remove unused include of llvm-support/diagnostics.h

* fileformat: do not include openssl in headers

* cmake: make install paths relative.

When they are absolute, then all the paths in instaled cmake scripts are absolute - install dir could not be moved.

* deps/yara: refactor cmake to properly install libs

* deps/yara: small cosmetic changes

* deps/llvm: refactor cmake to properly install libs

* deps/capstone: refactor cmake to properly install libs

* deps: refactor cmake files

* deps: refactor cmake files

* deps/yaramod: refactor cmake to properly install libs

* CMakeLists.txt: fix files installation

* config/retdec-config-config.cmake: fix required component order

Looks like this may matter (on some machines or cmake version).

* deps/llvm: fix include installation

* fileformat/cmake: do not use openssl-crypto

For some reasons, this can cause linking problems on some machines.

* deps/yaramod: fix link library order

* deps/googletests: fix target link library order

* rtti-finder: make deps PUBLIC.

I have no idea why it doesn't work with PRIVATE.

* deps/yaramod: fix formatting

* cmake: more refactorization...

1. Protect against including the same target file multiple times. It looks like this was not a problem, but who knows.
2. Use find_package() instead of find_dependency(). It looks like the later does not work correctly for components on some CMake versions.

* cmake: do not create version files for all components

Only the main RetDec version file is needed.

* cmake: propagate current project version to package config files

It is used to find the same version retdec components.

* CMakeLists.txt: replace AnyNewerVersion -> ExactVersion in compatibility settings

Since we probably will make breaking changes, make retdec installation compatible only with the same version.

* cmake: remove all COMPONENT options, these are not really needed

* cmake: move dependency finders inside double target protection conditions

* cmake: prefix all deps targets with retdec::deps::

* fileinfo: add openssl-crypto dep

* Revert "fileinfo: add openssl-crypto dep"

This reverts commit e1645d7fd5e81d1606c96752da3ac633c38a63e1.

* remove RETDEC_FORCE_OPENSSL_BUILD option, always build OpenSSL

* cmake: refactorization

* deps/whereami: fix include paths

* deps/tinyxml+whereami: fix included dirs

* deps/yaramod: fix pog_fmt lib installation

* deps/whereami: properly install target, not as part of utils.

Previous version should work, but there is a CMake bug in older versions which screws it up on Windows and macOS.

* crypto: link retdec::deps::openssl-crypto as PUBLIC

* bin2llvmir/providers/debugformat: fix segfault

Co-authored-by: Peter Matula <imatula@fit.vutbr.cz>
2020-04-05 16:50:56 +02:00
Peter Matula
308cea60c1 cmake/deps.cmake: make all variables INTERNAL.
They cannot be changed by the user, and the FORCE is implied - i.e. their value in cache is set even if they are already in cache -> value change in the file will affect build.
2020-03-23 21:44:39 +01:00
Peter Matula
9280a7558f cmake: add RETDEC_MSVC_STATIC_RUNTIME optioni
Default = OFF, if ON whole RetDec is build against windows static
runtime libs.
2020-03-23 10:01:03 +01:00
Matula Peter
c30c33ef15 cmake/options.cmake: fix, add RETDEC_ENABLE_RETDECTOOL option 2020-01-31 14:42:31 +01:00
Matula Peter
415bf17005 support: move info about support pkg from python script to deps.cmake
This is a variable info about RetDec dependency, so move it to other deps.
2020-01-29 15:17:51 +01:00
Matula Peter
cb019aa1f5 deps: move deps' URL and hashes to separate cmake file. 2020-01-27 10:13:41 +01:00
Matula Peter
65b8503f33 deps/libdwarf+src/dwarfparser: remove, not needed anymore. 2020-01-17 22:30:47 +01:00
Matula Peter
ce7adce42c deps/pelib: move from external deps directly to retdec sources. 2020-01-15 14:41:24 +01:00
Matula Peter
470cbc153c retdec: completely replace jsoncpp with rapidjson.
We had both of these JSON libs as deps. Since it is critical to parse LTI files as fast as possible, we need rapidjson. Therefore, in order to minimize RetDec deps, we completely replace jsoncpp with rapidjson.
2020-01-15 13:20:35 +01:00
Matula Peter
eaf4c5d42c deps/yaracpp: move yaracpp to retdec repository, add YARA dependency. 2020-01-08 12:33:01 +01:00
Peter Matula
e74bf6b201 create new serialization/deserialization library 2019-11-07 16:34:50 +01:00
Peter Matula
d3aed7ec20 Create a new library named common containing addresses and ranges
This library will contain all the object common to several RetDec components.
2019-11-06 16:24:24 +01:00
Peter Matula
4b47a1d9dc add retdec library and retdectool executable 2019-11-06 14:03:49 +01:00
Peter Matula
2de2d5cffb
cmake: added options to build only specific targets. (#670)
* cmake: added options to build only specific targets.

fix #510

* cmake: add options.cmake file.

I forgot to add this file in the previous commit.
2019-10-18 14:22:40 +02:00
Peter Matula
301f4e6470
Support refactoring (#518)
* cmake/install-share.py: update reference to a new support package.

* support: add signsrch signatures and ordinals.

* support: refactoring.

* support: more refactoring.

* support: add a new yara compilation script.

* support: implement the new YRA compilation script.

* support/yara_patterns/tools/macho: make rule names unique.

* support: refactor YARA rules management.

* Revert "support/yara_patterns/tools/macho: make rule names unique."

This reverts commit 3dee41c6b526bfee7fc3054190f20d0fec2778c3.

* deps/yaracpp: allow usage of a local YaraCpp directory.

* cpdetect/compiler_detector: use namespaces for YARA rules.

This prevents YARA errors caused by YARA rule ID conflicts.

* travis+appveyor: no not compile YARA rules in CI services.

* CMakeLists.txt: do not compile YARA rules by default.

This is just to check this option in TeamCity service. This commit will
be reverted later.

* Revert "CMakeLists.txt: do not compile YARA rules by default."

This reverts commit 260c9319b4ec2fa8443dafd383cc5704053b5d1d.

* CHANGELOG.md: https://github.com/avast-tl/retdec-support/issues/3 entry

Fix https://github.com/avast-tl/retdec-support/issues/3
2019-03-18 10:08:11 +01:00
Peter Matula
4782b5b809 cmake/install-share.py: update support package's sha256 checksum. 2019-03-05 16:55:15 +01:00
Peter Matula
3edc8d0fc4 cmake/install-share.py: update reference to the new support package. 2019-03-03 23:36:50 +01:00
Peter Matula
3669523ba0 cmake/utils.cmake: fix #477, fix behaviour of check_if_variable_changed().
Not it correctly deals with comparisons of undefined values, empty strings, and non-empty strings.
2019-01-30 10:33:08 +01:00
Petr Zemek
f7ee475082 cmake: Improve the heading of utils.cmake.
The heading looks a bit nicer with the newly inserted empty comment.
2019-01-28 14:20:02 +01:00
Petr Zemek
ae46982733 Unify indentation in C++ and CMake code.
Generally, we use tabs for indentation in C++ and CMake code, so we should be consistent.
2019-01-28 14:12:27 +01:00
Peter Matula
e1e29f909b deps/pelib: make it possible to use local PeLib dir as external project. 2019-01-25 13:41:18 +01:00
Petr Zemek
dc45b4cb7d cmake: Add missing quotes around PYTHON_EXECUTABLE (#441).
This fixes installation of RetDec when the path to Python contains spaces (e.g.
when Python is in "Program Files (x86)" on Windows).
2018-12-17 14:24:29 +01:00
Petr Zemek
732d80a6c8 scripts: Add a missing newline after script descriptions.
For consistency.
2018-08-31 10:25:28 +02:00
Petr Zemek
c7dbcd5814 cmake: Print the reason when the extraction of our support archive fails.
Without this, we would not know the exact reason why the extraction failed.
2018-08-01 11:53:23 +02:00
Petr Zemek
4516398389 cmake: Print the reason when the computation of SHA-256 hash of our support archive fails.
Without this, we would not know the exact reason why the computation failed.
2018-08-01 11:52:47 +02:00
Petr Zemek
cea6c38d47 cmake: Fix a typo in an info message in install-share.py.
"Verfifying" -> "Verifying"
2018-08-01 11:51:35 +02:00
Petr Zemek
07ba3cf6bf cmake: Print the reason when the download of our support package fails.
Without this, we would not know the exact reason why the download failed.
2018-08-01 11:49:10 +02:00
Petr Zemek
21b8e40100 cmake: Fix a typo in an info message in install-share.py.
"versions" -> "version"
2018-08-01 11:46:04 +02:00
Peter Matula
89c2c13b5d scripts: refactor. 2018-07-24 15:50:41 +02:00
Peter Matula
10b9043783 remove bash '.sh' scripts, only python '.py' variants are left. 2018-07-24 10:50:37 +02:00
Peter Matula
463c3f2855 cmake: use find_package() to find Python >= 3.4. 2018-07-23 14:36:03 +02:00
Peter Matula
0938102924 cmake/install-share.py: refactor code and its usage in CMake. 2018-07-18 15:27:50 +02:00
Michael Kösel
4de4f4984d [WIP] Convert Bash scripts to Python #147 (#338)
* Convert most Bash scripts to Python

* Port cmake/install-share to python

* Some cleanup

* Replaced install-share in cmake file with fully working python version

* Attemp to fix compile error

* Fix compile for older python version

* Try calling python 3 instead

* Make install-share.py executable
Compilable decompiler version

* Decompiler script now runs successfully until unpacking

* Running until calling bin2llvmir now

* [skip ci] Integrate @silverbacknet changes + some fixes

* [skip ci] Use CmdRunner.run_cmd everywhere in retdec_decompiler
Small fixes and cleanup
Early out if an error occurs

* [skip ci] Latest fixes
add retdec_tests_runner.py

* [skip ci] Check that options are correct + cleanup and fixes

* [skip ci] Fixed various errors

* Try to fix running install-share script

* Should now work on every os

* Fix compile error

* Convert compile-yara to python

* [skip ci] Make test runner more portable

* [skip ci] Use correct code style

* [skip ci] Decompiler script now runs successfully

* Now generates the same output as the bash script

* Try fixing Travis on macOS

* Upgrade python instead

* Test scripts in travis

* Fix build

* Fix path

* Update build
Small cleanup

* Fix error in decompiler script

* Try to debug failure reason
Fix test runner
Use Python 3.5 on ubuntu

* Use newer Python version and fix some errors

* [skip ci] Little cleanup to make the code more clear
Don't parse_args twice

* [skip ci] First version of reimplementing logging

* [skip ci] Some fixes and cleanup

* [skip ci] Print memory usage, print output from unpacker, match code convention and some other fixes

* [skip ci] Fix crash when using cleanup option; fix crash when using color ida

* [skip ci] Fix --backend-aggressive-opts argument

* [skip ci] Fix error when file arch is followed by a comment

* [skip ci] Match Bash script more closely

* [skip ci] Fix a few comments

* [skip ci] Add some comments

* [skip ci] Add early type_extractor/gen_cstdlib_and_linux_jsons.py and type_extractor/gen_windows_and_windrivers_jsons.py version

* Try Unit tests

* Try to fix test

* Use absolute path instead

* [skip ci] Add check for python scripts

* scripts/retdec_decompiler.py: use output if specified via -o option
2018-07-12 16:36:16 +02:00
Petr Zemek
60fdb6f717 cmake: Fix inconsistent indentation if install-share.sh.
There was a space followed by a tab.
2018-05-19 20:10:53 +02:00