diff --git a/.travis.yml b/.travis.yml index b991ba54..ccc0566b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,7 @@ script: - cd .. - rm -rf build # Run unit tests. - if [ "$TRAVIS_OS_NAME" = "osx" ]; then python3 retdec-install/bin/retdec-tests-runner.py ; fi + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then python3 retdec-install/bin/retdec-tests-runner.py ; fi # Run the decompilation script. - python3 retdec-install/bin/retdec-decompiler.py --help # Run a simple decompilation. diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f1730a7..d4c0cc5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ # dev +* New Feature: Added support for decompilation of 64-bit ARM binaries ([#268](https://github.com/avast/retdec/issues/268), [#533](https://github.com/avast/retdec/pull/533), [#550](https://github.com/avast/retdec/pull/550)). * New Feature: Added presentation of section and overlay entropy in `retdec-fileinfo` ([#502](https://github.com/avast/retdec/issues/502), [#507](https://github.com/avast/retdec/pull/507)). * New Feature: Added presentation of version info from PE file in `retdec-fileinfo` ([#408](https://github.com/avast/retdec/issues/408), [#519](https://github.com/avast/retdec/pull/519)). * New Feature: Added presentation of thread-local storage directory from PE file in `retdec-fileinfo` ([#417](https://github.com/avast/retdec/issues/417), [#523](https://github.com/avast/retdec/pull/523)). diff --git a/README.md b/README.md index aec5eab5..0ba673c1 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ You can pass the following additional parameters to `cmake`: * `-DRETDEC_COMPILE_YARA=OFF` to disable YARA rules compilation at installation step (enabled by default). * `-DCMAKE_BUILD_TYPE=Debug` to build with debugging information, which is useful during development. By default, the project is built in the `Release` mode. This has no effect on Windows, but the same thing can be achieved by running `cmake --build .` with the `--config Debug` parameter. * `-DCMAKE_PROGRAM_PATH=` to use Perl at `` (probably useful only on Windows). -* `-D_LOCAL_DIR=` where `` is from `{CAPSTONE, ELFIO, GOOGLETEST, JSONCPP, KEYSTONE, LIBDWARF, LLVM, PELIB, RAPIDJSON, TINYXML, YARACPP, YARAMOD}` (e.g. `-DCAPSTONE_LOCAL_DIR=`), to use the local repository clone at `` for RetDec dependency instead of downloading a fresh copy at build time. Multiple such options may be used at the same time. +* `-D_LOCAL_DIR=` where `` is from `{CAPSTONE, ELFIO, GOOGLETEST, JSONCPP, KEYSTONE, LIBDWARF, LLVM, PELIB, RAPIDJSON, TINYXML, YARACPP, YARAMOD}` (e.g. `-DCAPSTONE_LOCAL_DIR=`), to use the local repository clone at `` for RetDec dependency instead of downloading a fresh copy at build time. Multiple such options may be used at the same time. ## Build in Docker diff --git a/deps/capstone/CMakeLists.txt b/deps/capstone/CMakeLists.txt index 3efeb78d..465dc017 100644 --- a/deps/capstone/CMakeLists.txt +++ b/deps/capstone/CMakeLists.txt @@ -47,7 +47,7 @@ if(CAPSTONE_LOCAL_DIR) force_configure_step(capstone-project) else() message(STATUS "Capstone: using remote Capstone revision.") - + ExternalProject_Add(capstone-project URL https://github.com/avast/capstone/archive/27c713fe4f6eaf9721785932d850b6291a6073fe.zip URL_HASH SHA256=4d8d0461d7d5737893253698cd0b6d0d64545c1a74b166e8b1d823156a3109cb diff --git a/deps/googletest/CMakeLists.txt b/deps/googletest/CMakeLists.txt index 68f00d3b..7a2b8350 100644 --- a/deps/googletest/CMakeLists.txt +++ b/deps/googletest/CMakeLists.txt @@ -11,7 +11,7 @@ endif() if(GOOGLETEST_LOCAL_DIR) message(STATUS "Googletest: using local Googletest directory.") - + ExternalProject_Add(googletest DOWNLOAD_COMMAND "" SOURCE_DIR "${GOOGLETEST_LOCAL_DIR}" @@ -35,7 +35,7 @@ if(GOOGLETEST_LOCAL_DIR) force_configure_step(googletest) else() message(STATUS "Googletest: using remote Googletest revision.") - + ExternalProject_Add(googletest URL https://github.com/google/googletest/archive/83fa0cb17dad47a1d905526dcdddb5b96ed189d2.zip URL_HASH SHA256=3b7cf6bfd1fdec3204933b4c0419c010e89b2409dcd8cbc1ac6a78aab058e2b0 diff --git a/deps/jsoncpp/CMakeLists.txt b/deps/jsoncpp/CMakeLists.txt index ee564eaa..8b114175 100644 --- a/deps/jsoncpp/CMakeLists.txt +++ b/deps/jsoncpp/CMakeLists.txt @@ -9,7 +9,7 @@ endif() if(JSONCPP_LOCAL_DIR) message(STATUS "JsonCpp: using local JsonCpp directory.") - + ExternalProject_Add(jsoncpp-project DOWNLOAD_COMMAND "" SOURCE_DIR "${JSONCPP_LOCAL_DIR}" diff --git a/deps/llvm/CMakeLists.txt b/deps/llvm/CMakeLists.txt index 6852174b..cefdea67 100644 --- a/deps/llvm/CMakeLists.txt +++ b/deps/llvm/CMakeLists.txt @@ -29,7 +29,7 @@ include(ExternalProject) if(LLVM_LOCAL_DIR) message(STATUS "LLVM: using local LLVM directory.") - + ExternalProject_Add(llvm-project DOWNLOAD_COMMAND "" SOURCE_DIR "${LLVM_LOCAL_DIR}" @@ -38,27 +38,27 @@ if(LLVM_LOCAL_DIR) # This has no effect on Windows with MSVC, but is useful on Linux. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} - + # Force Python3. -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} - + # Targets to be build. -DLLVM_TARGETS_TO_BUILD=X86 - + # Our tools depending on LLVM require RTTI, so build LLVM with it. -DLLVM_REQUIRES_RTTI=YES - + # When building in the debug mode (=> assertions are enabled), we # have to build LLVM with assertions. This prevents link errors # when building the middle-end and back-end (see # https://github.com/oclint/oclint/issues/129). -DLLVM_ENABLE_ASSERTIONS=${IS_DEBUG_BUILD} - + # Disable the emission of warnings, which are useless since we do # not modify the LLVM sources (of course, except for a few # exceptions). -DLLVM_ENABLE_WARNINGS=NO - + # Disable the generation of targets for tests (we don't need them). -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF @@ -68,7 +68,7 @@ if(LLVM_LOCAL_DIR) -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_DOCS=OFF - + # Disable build of unnecessary LLVM parts. -DLLVM_BUILD_TOOLS=OFF -DLLVM_BUILD_UTILS=OFF @@ -81,16 +81,16 @@ if(LLVM_LOCAL_DIR) # We don't want this so that we don't have to link with tinfo. # It looks like terminal colors are working even without this. -DLLVM_ENABLE_TERMINFO=OFF - + # Necessary for builds with older MS Visual Studios (e.g. 2015). -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON - + # Force the use of the same compiler as used to build the top-level # project. Otherwise, the external project may pick up a different # compiler, which may result in link errors. "${CMAKE_C_COMPILER_OPTION}" "${CMAKE_CXX_COMPILER_OPTION}" - + # Disable the installation right after build (we want to install the # needed libraries and tools manually). INSTALL_COMMAND "" @@ -108,27 +108,27 @@ else() # This has no effect on Windows with MSVC, but is useful on Linux. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} - + # Force Python3. -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} - + # Targets to be build. -DLLVM_TARGETS_TO_BUILD=X86 - + # Our tools depending on LLVM require RTTI, so build LLVM with it. -DLLVM_REQUIRES_RTTI=YES - + # When building in the debug mode (=> assertions are enabled), we # have to build LLVM with assertions. This prevents link errors # when building the middle-end and back-end (see # https://github.com/oclint/oclint/issues/129). -DLLVM_ENABLE_ASSERTIONS=${IS_DEBUG_BUILD} - + # Disable the emission of warnings, which are useless since we do # not modify the LLVM sources (of course, except for a few # exceptions). -DLLVM_ENABLE_WARNINGS=NO - + # Disable the generation of targets for tests (we don't need them). -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_UTILS=OFF @@ -138,7 +138,7 @@ else() -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_DOCS=OFF - + # Disable build of unnecessary LLVM parts. -DLLVM_BUILD_TOOLS=OFF -DLLVM_BUILD_UTILS=OFF @@ -151,16 +151,16 @@ else() # We don't want this so that we don't have to link with tinfo. # It looks like terminal colors are working even without this. -DLLVM_ENABLE_TERMINFO=OFF - + # Necessary for builds with older MS Visual Studios (e.g. 2015). -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON - + # Force the use of the same compiler as used to build the top-level # project. Otherwise, the external project may pick up a different # compiler, which may result in link errors. "${CMAKE_C_COMPILER_OPTION}" "${CMAKE_CXX_COMPILER_OPTION}" - + # Disable the installation right after build (we want to install the # needed libraries and tools manually). INSTALL_COMMAND "" diff --git a/include/retdec/bin2llvmir/optimizations/param_return/data_entries.h b/include/retdec/bin2llvmir/optimizations/param_return/data_entries.h index 7f6a350b..3aa49d41 100644 --- a/include/retdec/bin2llvmir/optimizations/param_return/data_entries.h +++ b/include/retdec/bin2llvmir/optimizations/param_return/data_entries.h @@ -37,7 +37,6 @@ class ReturnEntry const std::vector& retStores() const; const std::vector& retValues() const; - protected: llvm::ReturnInst* _retInst = nullptr; diff --git a/include/retdec/bin2llvmir/providers/abi/x86.h b/include/retdec/bin2llvmir/providers/abi/x86.h index d9cd25bf..d4d60af4 100644 --- a/include/retdec/bin2llvmir/providers/abi/x86.h +++ b/include/retdec/bin2llvmir/providers/abi/x86.h @@ -30,7 +30,6 @@ class AbiX86 : public Abi public: virtual bool isNopInstruction(cs_insn* insn) override; - // Calling conventions. // private: diff --git a/include/retdec/bin2llvmir/providers/calling_convention/calling_convention.h b/include/retdec/bin2llvmir/providers/calling_convention/calling_convention.h index f0d03bff..c760b776 100644 --- a/include/retdec/bin2llvmir/providers/calling_convention/calling_convention.h +++ b/include/retdec/bin2llvmir/providers/calling_convention/calling_convention.h @@ -4,7 +4,6 @@ * @copyright (c) 2019 Avast Software, licensed under the MIT license */ - #ifndef RETDEC_BIN2LLVMIR_PROVIDERS_CALL_CONV_CALL_CONV_H #define RETDEC_BIN2LLVMIR_PROVIDERS_CALL_CONV_CALL_CONV_H diff --git a/src/bin2llvmir/optimizations/param_return/collector/collector.cpp b/src/bin2llvmir/optimizations/param_return/collector/collector.cpp index 87e2f836..d796a0bb 100644 --- a/src/bin2llvmir/optimizations/param_return/collector/collector.cpp +++ b/src/bin2llvmir/optimizations/param_return/collector/collector.cpp @@ -306,7 +306,6 @@ void Collector::collectStoresRecursively( seen[block] = values; } - bool Collector::collectStoresInInstructionBlock( Instruction* start, std::set& values, @@ -476,7 +475,6 @@ void Collector::collectCallSpecificTypes(CallEntry* ce) const return; } - if (!extractFormatString(ce)) { return; diff --git a/src/bin2llvmir/optimizations/param_return/filter/filter.cpp b/src/bin2llvmir/optimizations/param_return/filter/filter.cpp index 06b60ed7..a5cf4063 100644 --- a/src/bin2llvmir/optimizations/param_return/filter/filter.cpp +++ b/src/bin2llvmir/optimizations/param_return/filter/filter.cpp @@ -440,7 +440,6 @@ void Filter::filterArgsByKnownTypes(FilterableLayout& lay) const } } - if (!requiredStacks && stackOrd == OrderID::ORD_STACK) { requiredStacks = getNumberOfStacksForType(t); @@ -770,7 +769,6 @@ void Filter::filterRetsByKnownTypes(FilterableLayout& lay) const lay.knownTypes = {retType}; } - void Filter::leaveCommonArgs(std::vector& allArgs) const { leaveCommon(allArgs); @@ -1093,7 +1091,6 @@ std::vector Filter::createGroupedValues(const FilterableLayout& la } break; - default: continue; } diff --git a/src/bin2llvmir/providers/calling_convention/calling_convention.cpp b/src/bin2llvmir/providers/calling_convention/calling_convention.cpp index 951a3016..c472042d 100644 --- a/src/bin2llvmir/providers/calling_convention/calling_convention.cpp +++ b/src/bin2llvmir/providers/calling_convention/calling_convention.cpp @@ -4,7 +4,6 @@ * @copyright (c) 2019 Avast Software, licensed under the MIT license */ - #include "retdec/bin2llvmir/providers/abi/abi.h" #include "retdec/bin2llvmir/providers/calling_convention/calling_convention.h" #include "retdec/bin2llvmir/providers/calling_convention/arm/arm_conv.h" diff --git a/src/capstone2llvmir/arm64/arm64.cpp b/src/capstone2llvmir/arm64/arm64.cpp index 339bfde6..a1148027 100644 --- a/src/capstone2llvmir/arm64/arm64.cpp +++ b/src/capstone2llvmir/arm64/arm64.cpp @@ -699,7 +699,6 @@ llvm::Value* Capstone2LlvmIrTranslatorArm64_impl::loadRegister( return getCurrentPc(_insn); } - llvm::Type* rt = nullptr; try { @@ -783,9 +782,9 @@ llvm::Value* Capstone2LlvmIrTranslatorArm64_impl::loadOp( auto* val = llvm::ConstantFP::get(irb.getDoubleTy(), op.fp); return val; } - case ARM64_OP_INVALID: - case ARM64_OP_CIMM: - case ARM64_OP_PREFETCH: + case ARM64_OP_INVALID: + case ARM64_OP_CIMM: + case ARM64_OP_PREFETCH: case ARM64_OP_BARRIER: default: { @@ -857,18 +856,18 @@ llvm::Instruction* Capstone2LlvmIrTranslatorArm64_impl::storeOp( addr = irb.CreateIntToPtr(addr, pt); return irb.CreateStore(val, addr); } - case ARM64_OP_INVALID: - case ARM64_OP_IMM: + case ARM64_OP_INVALID: + case ARM64_OP_IMM: { // This is here because some operands that are for example in post-index addressing mode // will have the write flag set and generic functions try to write to IMM, which is not correct // Maybe solve this better? return nullptr; } - case ARM64_OP_FP: - case ARM64_OP_CIMM: - case ARM64_OP_PREFETCH: - case ARM64_OP_BARRIER: + case ARM64_OP_FP: + case ARM64_OP_CIMM: + case ARM64_OP_PREFETCH: + case ARM64_OP_BARRIER: default: { throw GenericError("storeOp(): unhandled operand type"); @@ -1844,7 +1843,7 @@ void Capstone2LlvmIrTranslatorArm64_impl::translateBr(cs_insn* i, cs_arm64* ai, void Capstone2LlvmIrTranslatorArm64_impl::translateB(cs_insn* i, cs_arm64* ai, llvm::IRBuilder<>& irb) { EXPECT_IS_UNARY(i, ai, irb); - + op0 = loadOpUnary(ai, irb); if (isCondIns(ai)) { @@ -1863,7 +1862,7 @@ void Capstone2LlvmIrTranslatorArm64_impl::translateB(cs_insn* i, cs_arm64* ai, l void Capstone2LlvmIrTranslatorArm64_impl::translateBl(cs_insn* i, cs_arm64* ai, llvm::IRBuilder<>& irb) { EXPECT_IS_UNARY(i, ai, irb); - + storeRegister(ARM64_REG_LR, getNextInsnAddress(i), irb); op0 = loadOpUnary(ai, irb); generateCallFunctionCall(irb, op0); @@ -2906,7 +2905,6 @@ void Capstone2LlvmIrTranslatorArm64_impl::translateMovi(cs_insn* i, cs_arm64* ai storeOp(ai->operands[0], op1, irb); } - /** * ARM64_INS_FMUL, ARM64_INS_FNMUL */ diff --git a/src/capstone2llvmir/arm64/arm64_impl.h b/src/capstone2llvmir/arm64/arm64_impl.h index ef740e6e..a3e3b38e 100644 --- a/src/capstone2llvmir/arm64/arm64_impl.h +++ b/src/capstone2llvmir/arm64/arm64_impl.h @@ -147,7 +147,7 @@ class Capstone2LlvmIrTranslatorArm64_impl : /** * @brief This functions will generate psuedo asm translation. - * Instructions that are not implemented fall back to this method which will + * Instructions that are not implemented fall back to this method which will * check there is need to generate conditional code and then generate given pseudo. */ void generatePseudoInstruction(cs_insn* i, cs_arm64* ai, llvm::IRBuilder<>& irb); diff --git a/src/capstone2llvmir/arm64/arm64_init.cpp b/src/capstone2llvmir/arm64/arm64_init.cpp index a3dc17e6..9c366391 100644 --- a/src/capstone2llvmir/arm64/arm64_init.cpp +++ b/src/capstone2llvmir/arm64/arm64_init.cpp @@ -630,7 +630,6 @@ void Capstone2LlvmIrTranslatorArm64_impl::initializeRegTypeMap() auto* f64 = llvm::Type::getDoubleTy(_module->getContext()); auto* f128 = llvm::Type::getFP128Ty(_module->getContext()); - std::map r2t = { // General purpose registers. @@ -1557,7 +1556,6 @@ void Capstone2LlvmIrTranslatorArm64_impl::initializeRegistersParentMapToOther( } } - void Capstone2LlvmIrTranslatorArm64_impl::initializeRegistersParentMap() { // Last element in vector is its own parent. diff --git a/src/capstone2llvmir/capstone2llvmir_impl.h b/src/capstone2llvmir/capstone2llvmir_impl.h index e06dab21..4e3a6255 100644 --- a/src/capstone2llvmir/capstone2llvmir_impl.h +++ b/src/capstone2llvmir/capstone2llvmir_impl.h @@ -476,7 +476,6 @@ class Capstone2LlvmIrTranslator_impl : virtual public Capstone2LlvmIrTranslator virtual uint8_t getOperandAccess(CInsnOp& op); virtual void translatePseudoAsmGeneric(cs_insn* i, CInsn* ci, llvm::IRBuilder<>& irb); - void throwUnexpectedOperands(cs_insn* i, const std::string comment = ""); void throwUnhandledInstructions(cs_insn* i, const std::string comment = ""); diff --git a/src/capstone2llvmir/x86/x86.cpp b/src/capstone2llvmir/x86/x86.cpp index ef29d057..ff031240 100644 --- a/src/capstone2llvmir/x86/x86.cpp +++ b/src/capstone2llvmir/x86/x86.cpp @@ -4427,7 +4427,6 @@ void Capstone2LlvmIrTranslatorX86_impl::translateFst(cs_insn* i, cs_x86* xi, llv storeOp(xi->operands[0], src, irb, eOpConv::FP_CAST); } - if (i->id == X86_INS_FSTP) { storeX87TagReg(irb, top, llvm::ConstantInt::get(irb.getIntNTy(2), 3)); // 0b11 diff --git a/src/capstone2llvmirtool/capstone2llvmir.cpp b/src/capstone2llvmirtool/capstone2llvmir.cpp index cc4b31d1..6ba1dc49 100644 --- a/src/capstone2llvmirtool/capstone2llvmir.cpp +++ b/src/capstone2llvmirtool/capstone2llvmir.cpp @@ -150,7 +150,6 @@ class ProgramOptions } } - void dump() { cout << endl; diff --git a/src/fileformat/file_format/file_format.cpp b/src/fileformat/file_format/file_format.cpp index bbdde9bc..23d8d5d2 100644 --- a/src/fileformat/file_format/file_format.cpp +++ b/src/fileformat/file_format/file_format.cpp @@ -1569,7 +1569,6 @@ const TlsInfo* FileFormat::getTlsInfo() const return tlsInfo; } - /** * Get information about ELF core file * @return Pointer to ELF core info of @c nullptr if file has no certificates diff --git a/src/fileformat/file_format/pe/pe_format.cpp b/src/fileformat/file_format/pe/pe_format.cpp index f648a7fd..fab62d34 100644 --- a/src/fileformat/file_format/pe/pe_format.cpp +++ b/src/fileformat/file_format/pe/pe_format.cpp @@ -30,7 +30,6 @@ #include "retdec/fileformat/utils/file_io.h" #include "retdec/crypto/crypto.h" - using namespace retdec::utils; using namespace PeLib; @@ -739,7 +738,6 @@ void PeFormat::loadVisualBasicHeader() visualBasicInfo.setLanguageDLLPrimaryLCID(vbh.LCID1); visualBasicInfo.setLanguageDLLSecondaryLCID(vbh.LCID2); - if (getOffsetFromAddress(vbProjectInfoOffset, vbh.projectInfoAddr)) { parseVisualBasicProjectInfo(vbProjectInfoOffset); diff --git a/src/fileformat/types/resource_table/bitmap_image.cpp b/src/fileformat/types/resource_table/bitmap_image.cpp index f128ba8e..beea049f 100644 --- a/src/fileformat/types/resource_table/bitmap_image.cpp +++ b/src/fileformat/types/resource_table/bitmap_image.cpp @@ -607,7 +607,6 @@ bool BitmapImage::reduce8x8() } } - /* crop to 8x8 */ image.resize(8); for (auto &row : image) @@ -711,6 +710,5 @@ void BitmapImage::greyScale() } } - } // namespace fileformat } // namespace retdec diff --git a/src/fileformat/types/resource_table/resource_icon.cpp b/src/fileformat/types/resource_table/resource_icon.cpp index 705dd87a..bde8361b 100644 --- a/src/fileformat/types/resource_table/resource_icon.cpp +++ b/src/fileformat/types/resource_table/resource_icon.cpp @@ -187,7 +187,6 @@ bool ResourceIcon::hasLoadedProperties() const return loadedProperties; } - /** * A method which indicates whether color count of an icon is valid. * @return @c `true` if it is, otherwise `false` diff --git a/src/fileformat/types/resource_table/resource_icon_group.cpp b/src/fileformat/types/resource_table/resource_icon_group.cpp index ef508d0f..6e2be569 100644 --- a/src/fileformat/types/resource_table/resource_icon_group.cpp +++ b/src/fileformat/types/resource_table/resource_icon_group.cpp @@ -7,7 +7,6 @@ #include "retdec/fileformat/types/resource_table/resource_icon.h" #include "retdec/fileformat/types/resource_table/resource_icon_group.h" - namespace { // Icon priority list diff --git a/src/fileformat/types/resource_table/resource_table.cpp b/src/fileformat/types/resource_table/resource_table.cpp index fbea87d4..27960cd0 100644 --- a/src/fileformat/types/resource_table/resource_table.cpp +++ b/src/fileformat/types/resource_table/resource_table.cpp @@ -68,12 +68,9 @@ struct VersionInfoHeader } // anonymous namespace - namespace retdec { namespace fileformat { - - /** * Constructor */ diff --git a/src/fileformat/types/visual_basic/visual_basic_extern.cpp b/src/fileformat/types/visual_basic/visual_basic_extern.cpp index 59a04b54..b03389e8 100644 --- a/src/fileformat/types/visual_basic/visual_basic_extern.cpp +++ b/src/fileformat/types/visual_basic/visual_basic_extern.cpp @@ -61,6 +61,5 @@ void VisualBasicExtern::setApiName(const std::string &aName) apiName = aName; } - } // namespace fileformat } // namespace retdec diff --git a/src/fileformat/types/visual_basic/visual_basic_info.cpp b/src/fileformat/types/visual_basic/visual_basic_info.cpp index 408864ec..f2a59a70 100644 --- a/src/fileformat/types/visual_basic/visual_basic_info.cpp +++ b/src/fileformat/types/visual_basic/visual_basic_info.cpp @@ -10,7 +10,6 @@ #include "retdec/utils/conversion.h" #include "retdec/fileformat/types/visual_basic/visual_basic_info.h" - using namespace retdec::utils; namespace retdec { @@ -768,6 +767,5 @@ std::string VisualBasicInfo::guidToStr(const std::uint8_t data[16]) return r1 + "-" + r2 + "-" + r3 + "-" + r4 + "-" + r5; } - } // namespace fileformat } // namespace retdec diff --git a/src/fileformat/types/visual_basic/visual_basic_object.cpp b/src/fileformat/types/visual_basic/visual_basic_object.cpp index 100a1b04..c6777a25 100644 --- a/src/fileformat/types/visual_basic/visual_basic_object.cpp +++ b/src/fileformat/types/visual_basic/visual_basic_object.cpp @@ -70,7 +70,5 @@ void VisualBasicObject::addMethod(const std::string &method) methods.push_back(method); } - - } // namespace fileformat } // namespace retdec diff --git a/src/fileinfo/file_information/file_information.cpp b/src/fileinfo/file_information/file_information.cpp index be040290..c13db905 100644 --- a/src/fileinfo/file_information/file_information.cpp +++ b/src/fileinfo/file_information/file_information.cpp @@ -1118,13 +1118,6 @@ std::string FileInformation::getVisualBasicObjectTableHashSha256() const return visualBasicInfo.getObjectTableHashSha256(); } - - - - - - - /** * Get type of related PDB file * @return Type of related PDB file diff --git a/src/fileinfo/file_information/file_information.h b/src/fileinfo/file_information/file_information.h index ee2a3cb3..1801c79f 100644 --- a/src/fileinfo/file_information/file_information.h +++ b/src/fileinfo/file_information/file_information.h @@ -195,7 +195,6 @@ class FileInformation std::string getVisualBasicObjectTableHashSha256() const; /// @} - /// @name Getters of @a pdbInfo /// @{ std::string getPdbType() const; diff --git a/src/fileinfo/file_information/file_information_types/tls_info.cpp b/src/fileinfo/file_information/file_information_types/tls_info.cpp index 24e77884..52daf302 100644 --- a/src/fileinfo/file_information/file_information_types/tls_info.cpp +++ b/src/fileinfo/file_information/file_information_types/tls_info.cpp @@ -133,5 +133,4 @@ bool TlsInfo::isUsed() const return tlsInfo != nullptr; } - } // namespace fileinfo diff --git a/src/fileinfo/file_information/file_information_types/visual_basic_info.cpp b/src/fileinfo/file_information/file_information_types/visual_basic_info.cpp index 4034e8c1..d77ff78b 100644 --- a/src/fileinfo/file_information/file_information_types/visual_basic_info.cpp +++ b/src/fileinfo/file_information/file_information_types/visual_basic_info.cpp @@ -412,5 +412,4 @@ bool VisualBasicInfo::isPcode() const return visualBasicInfo ? visualBasicInfo->isPcode() : false; } - } // namespace fileinfo diff --git a/src/fileinfo/file_presentation/json_presentation.cpp b/src/fileinfo/file_presentation/json_presentation.cpp index 3a3da012..3660be44 100644 --- a/src/fileinfo/file_presentation/json_presentation.cpp +++ b/src/fileinfo/file_presentation/json_presentation.cpp @@ -385,7 +385,7 @@ void JsonPresentation::presentTlsInfo(Json::Value &root) const { return; } - + Value jTlsInfo; presentIfNotEmpty("rawDataStartAddress", fileinfo.getTlsRawDataStartAddrStr(hexWithPrefix), jTlsInfo); presentIfNotEmpty("rawDataEndAddress", fileinfo.getTlsRawDataEndAddrStr(hexWithPrefix), jTlsInfo); diff --git a/src/llvmir2hll/hll/bir_writer.cpp b/src/llvmir2hll/hll/bir_writer.cpp index 0ed17113..6e7d8d33 100644 --- a/src/llvmir2hll/hll/bir_writer.cpp +++ b/src/llvmir2hll/hll/bir_writer.cpp @@ -765,6 +765,5 @@ void BIRWriter::visit(ShPtr type) { out << "type_unknown"; } - } // namespace llvmir2hll } // namespace retdec diff --git a/src/llvmir2hll/optimizer/optimizers/dead_local_assign_optimizer.cpp b/src/llvmir2hll/optimizer/optimizers/dead_local_assign_optimizer.cpp index 142d8f95..7bf3f69e 100644 --- a/src/llvmir2hll/optimizer/optimizers/dead_local_assign_optimizer.cpp +++ b/src/llvmir2hll/optimizer/optimizers/dead_local_assign_optimizer.cpp @@ -92,7 +92,6 @@ bool DeadLocalAssignOptimizer::canBeOptimized(ShPtr var, return false; } - // The use cannot contain any function calls. if (useData->hasCalls()) { return false; diff --git a/src/unpackertool/plugins/upx/decompressors/decompressor_lzma.h b/src/unpackertool/plugins/upx/decompressors/decompressor_lzma.h index 38635fe6..b9a31e24 100644 --- a/src/unpackertool/plugins/upx/decompressors/decompressor_lzma.h +++ b/src/unpackertool/plugins/upx/decompressors/decompressor_lzma.h @@ -8,7 +8,6 @@ #include "unpackertool/plugins/upx/decompressors/decompressor.h" - namespace retdec { namespace unpackertool { namespace upx { diff --git a/support/ordinals/CMakeLists.txt b/support/ordinals/CMakeLists.txt index 139597f9..8b137891 100644 --- a/support/ordinals/CMakeLists.txt +++ b/support/ordinals/CMakeLists.txt @@ -1,2 +1 @@ - diff --git a/tests/bin2llvmir/optimizations/param_return/param_return_tests.cpp b/tests/bin2llvmir/optimizations/param_return/param_return_tests.cpp index a76cb842..3c12f61a 100644 --- a/tests/bin2llvmir/optimizations/param_return/param_return_tests.cpp +++ b/tests/bin2llvmir/optimizations/param_return/param_return_tests.cpp @@ -3675,7 +3675,6 @@ TEST_F(ParamReturnTests, x86FastcallBasic) checkModuleAgainstExpectedIr(exp); } - TEST_F(ParamReturnTests, x86FastcallLargeTypeCatch) { parseInput(R"( diff --git a/tests/capstone2llvmir/arm64_tests.cpp b/tests/capstone2llvmir/arm64_tests.cpp index 0f3acd64..2fd4b47a 100644 --- a/tests/capstone2llvmir/arm64_tests.cpp +++ b/tests/capstone2llvmir/arm64_tests.cpp @@ -276,7 +276,6 @@ TEST_P(Capstone2LlvmIrTranslatorArm64Tests, ARM64_INS_ADC32_flags) EXPECT_NO_VALUE_CALLED(); } - TEST_P(Capstone2LlvmIrTranslatorArm64Tests, ARM64_INS_ADC_flags) { setRegisters({ @@ -6018,7 +6017,6 @@ TEST_P(Capstone2LlvmIrTranslatorArm64Tests, ARM64_INS_UXTH_r_r_false) EXPECT_NO_VALUE_CALLED(); } - // // ARM64_INS_TBNZ // @@ -7496,7 +7494,6 @@ TEST_P(Capstone2LlvmIrTranslatorArm64Tests, ARM64_INS_FMAX_d_d_d) EXPECT_NO_VALUE_CALLED(); } - TEST_P(Capstone2LlvmIrTranslatorArm64Tests, ARM64_INS_FMAX_d_d_d_1) { setRegisters({ @@ -7611,7 +7608,6 @@ TEST_P(Capstone2LlvmIrTranslatorArm64Tests, ARM64_INS_FMIN_d_d_d) EXPECT_NO_VALUE_CALLED(); } - TEST_P(Capstone2LlvmIrTranslatorArm64Tests, ARM64_INS_FMIN_d_d_d_1) { setRegisters({