retdec
main_detection.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_BIN2LLVMIR_OPTIMIZATIONS_MAIN_DETECTION_MAIN_DETECTION_H
8 #define RETDEC_BIN2LLVMIR_OPTIMIZATIONS_MAIN_DETECTION_MAIN_DETECTION_H
9 
10 #include <llvm/IR/Function.h>
11 #include <llvm/IR/Instructions.h>
12 #include <llvm/IR/Module.h>
13 #include <llvm/Pass.h>
14 
15 #include "retdec/common/address.h"
19 
20 namespace retdec {
21 namespace bin2llvmir {
22 
23 class MainDetection : public llvm::ModulePass
24 {
25  public:
26  static char ID;
27  MainDetection();
28  virtual bool runOnModule(llvm::Module& M) override;
29  bool runOnModuleCustom(
30  llvm::Module& m,
31  Config* c,
32  FileImage* img = nullptr,
33  NameContainer* names = nullptr);
34 
35  private:
36  bool run();
37  bool skipAnalysis();
44 
45  bool applyResult(retdec::common::Address mainAddr);
46 
47  private:
48  llvm::Module* _module = nullptr;
49  Config* _config = nullptr;
50  FileImage* _image = nullptr;
51  NameContainer* _names = nullptr;
52 };
53 
54 } // namespace bin2llvmir
55 } // namespace retdec
56 
57 #endif
Config DB provider for bin2llvmirl.
Definition: config.h:24
Definition: fileimage.h:27
Definition: main_detection.h:24
llvm::Module * _module
Definition: main_detection.h:48
NameContainer * _names
Definition: main_detection.h:51
void removeStaticallyLinked()
Definition: main_detection.cpp:113
Config * _config
Definition: main_detection.h:49
retdec::common::Address getFromFunctionNames()
Definition: main_detection.cpp:125
MainDetection()
Definition: main_detection.cpp:35
bool runOnModuleCustom(llvm::Module &m, Config *c, FileImage *img=nullptr, NameContainer *names=nullptr)
Definition: main_detection.cpp:50
retdec::common::Address getFromContext()
Definition: main_detection.cpp:147
retdec::common::Address getFromEntryPointOffset(int offset)
Definition: main_detection.cpp:401
retdec::common::Address getFromInterlockedExchange()
Definition: main_detection.cpp:469
virtual bool runOnModule(llvm::Module &M) override
Definition: main_detection.cpp:41
static char ID
Definition: main_detection.h:26
bool skipAnalysis()
Definition: main_detection.cpp:101
FileImage * _image
Definition: main_detection.h:50
bool run()
Definition: main_detection.cpp:63
retdec::common::Address getFromCrtSetCheckCount()
Definition: main_detection.cpp:419
bool applyResult(retdec::common::Address mainAddr)
Definition: main_detection.cpp:515
Definition: names.h:154
Definition: address.h:21
Address, address pair and other derived class representation.
File image provider for bin2llvmirl.
Database of objects' names in binary.
The frontend-end part of the decompiler.
Definition: archive_wrapper.h:19