Arion 1.0.2-alpha
A high-performance C++ framework for emulating executable binaries.
 
Loading...
Searching...
No Matches
executable_parser.hpp
Go to the documentation of this file.
1#ifndef ARION_EXECUTABLE_PARSER_HPP
2#define ARION_EXECUTABLE_PARSER_HPP
3
4#include <arion/LIEF/LIEF.hpp>
6#include <memory>
7#include <string>
8
9namespace arion
10{
11
12class Arion;
13
36
39{
40 protected:
42 std::weak_ptr<Arion> arion;
44 std::shared_ptr<EXECUTABLE_PARSER_ATTRIBUTES> attrs;
46 std::vector<std::shared_ptr<struct SEGMENT>> segments;
47
48 public:
53 ExecutableParser(std::weak_ptr<Arion> arion) : arion(arion) {};
57 virtual void process() = 0;
62 std::shared_ptr<EXECUTABLE_PARSER_ATTRIBUTES> get_attrs();
67 std::vector<std::shared_ptr<struct SEGMENT>> get_segments();
68};
69
70}; // namespace arion
71
72#endif // ARION_EXECUTABLE_PARSER_HPP
This class is responsible for extracting specific data from an executable file.
Definition executable_parser.hpp:39
virtual void process()=0
std::shared_ptr< EXECUTABLE_PARSER_ATTRIBUTES > attrs
A structure of attributes which are filled during the parsing.
Definition executable_parser.hpp:44
std::weak_ptr< Arion > arion
The Arion instance which requested the executable parsing.
Definition executable_parser.hpp:42
std::vector< std::shared_ptr< struct SEGMENT > > get_segments()
std::shared_ptr< EXECUTABLE_PARSER_ATTRIBUTES > get_attrs()
ExecutableParser(std::weak_ptr< Arion > arion)
Definition executable_parser.hpp:53
std::vector< std::shared_ptr< struct SEGMENT > > segments
The memory segments in the executable.
Definition executable_parser.hpp:46
Definition arch_x86-64.hpp:11
LINKAGE_TYPE
Identifies the method used to link an executable.
Definition global_defs.hpp:117
@ UNKNOWN_LINKAGE
Unknown linkage method.
Definition global_defs.hpp:119
uint64_t ADDR
Identifies a memory address.
Definition global_defs.hpp:36
CPU_ARCH
Identifies a CPU architecture.
Definition global_defs.hpp:128
@ UNKNOWN_ARCH
Unknown CPU architecture.
Definition global_defs.hpp:130
Stores attributes which are filled during the parsing of an executable.
Definition executable_parser.hpp:16
LINKAGE_TYPE linkage
The method used to link the executable.
Definition executable_parser.hpp:30
std::string interpreter_path
Path to the interpreter of the executable.
Definition executable_parser.hpp:32
std::vector< std::string > args
The program arguments of the emulated process, basically the "argv" array.
Definition executable_parser.hpp:26
ADDR entry
Memory address at which the executable starts being executed.
Definition executable_parser.hpp:34
virtual ~EXECUTABLE_PARSER_ATTRIBUTES()=default
std::string path
Path to the executable that may differ from the user specified one in some special cases (like coredu...
Definition executable_parser.hpp:24
std::string usr_path
Path to the executable as passed to the Arion instance when initializing it.
Definition executable_parser.hpp:22
CPU_ARCH arch
The CPU architecture of the executable.
Definition executable_parser.hpp:28