Skip to content
Snippets Groups Projects
Commit 05b2a463 authored by Jason Hiser's avatar Jason Hiser :tractor:
Browse files

adding irdb-deep to irdb-sdk

parent cd29ed89
No related branches found
No related tags found
No related merge requests found
#include <irdb-core>
#include <irdb-util>
#include <map>
#include <set>
#include <memory>
namespace IRDB_SDK
{
using namespace std;
using AnalysisEngine_t = enum AnalysisEngine
{
aeSTARS,
aeMoon,
aeRida
};
using RegisterIDSet_t = set<RegisterID_t>;
using DeadRegisterMap_t = map<Instruction_t*,RegisterIDSet_t*>;
using StaticGlobalSet_t = InstructionSet_t;
using RangeSentinalSet_t = InstructionSet_t;
class DeepAnalysis_t
{
protected:
DeepAnalysis_t() {}
DeepAnalysis_t(const DeepAnalysis_t& copy) = delete;
public:
unique_ptr<DeadRegisterMap_t> getDeadRegisters() const = 0;
unique_ptr<StaticGlobalSet_t> getStaticGlobalRanges() const = 0;
unique_ptr<SentinalSet_t > getRangeSentials() const = 0;
// factories
unique_ptr<DeepAnalysis_t> factory(FileIR_t* firp, const AnalysisEngine_t& ae=aeSTARS, vector<string> options={});
};
}
#include <string>
namespace IRDB_SDK
{
using namespace std;
using RegisterID_t = enum RegisterID
{
/* an register that's not valid on any machine, equiv. to a nullptr of registers */
rn_UNKNOWN,
/* x86 32 and 64 */
rn_EFLAGS,
/* x86 IP register names */
rn_IP, rn_EIP=rn_IP, rn_RIP=rn_IP,
/* x86 general purpose registers */
rn_EAX, rn_EBX, rn_ECX, rn_EDX, rn_ESI, rn_EDI, rn_EBP, rn_ESP, rn_R8D, rn_R9D, rn_R10D, rn_R11D, rn_R12D, rn_R13D, rn_R14D, rn_R15D,
rn_RAX, rn_RBX, rn_RCX, rn_RDX, rn_RBP, rn_RSP, rn_RSI, rn_RDI, rn_R8, rn_R9 , rn_R10, rn_R11, rn_R12, rn_R13, rn_R14, rn_R15,
rn_AX, rn_BX, rn_CX, rn_DX, rn_BP, rn_SP, rn_SI, rn_DI, rn_R8W, rn_R9W, rn_R10W, rn_R11W, rn_R12W, rn_R13W, rn_R14W, rn_R15W,
rn_AH, rn_BH, rn_CH, rn_DH, rn_SIH, rn_DIH, rn_BPH, rn_SPH,
rn_AL, rn_BL, rn_CL, rn_DL, rn_SIL, rn_DIL, rn_BPL, rn_SPL, rn_R8B, rn_R9B, rn_R10B, rn_R11B, rn_R12B, rn_R13B, rn_R14B, rn_R15B,
/* other x86 registers here (e.g., fp, xmm, etc.), eventually */
/* other archs support added here, eventually */
};
RegisterID_t strToRegister (const string& p_regStr);
RegisterID_t strToRegister (const char * p_regStr);
bool isValidRegister (const RegisterID_t p_reg);
bool is64bitRegister (const RegisterID_t p_reg);
bool is32bitRegister (const RegisterID_t p_reg);
bool is16bitRegister (const RegisterID_t p_reg);
bool is8bitRegister (const RegisterID_t p_reg);
int getRegisterBitWidth (const RegisterID_t p_reg);
string registerToString (const RegisterID_t p_reg);
RegisterID_t convertRegisterTo64bit (const RegisterID_t p_reg);
RegisterID_t convertRegisterTo32bit (const RegisterID_t p_reg);
RegisterID_t convertRegisterTo16bit (const RegisterID_t p_reg);
}
#ifndef IRDB_SDK_deep
#define IRDB_SDK_deep
#include <inc-deep/deep.hpp>
#endif
......@@ -19,6 +19,8 @@
*/
#ifndef IRDB_SDK_util
#include <irdb-core>
#define IRDB_SDK_util
/* Building a CFG depends on core functionality */
......@@ -30,5 +32,6 @@
#include <inc-util/IBT_Provenance.hpp>
#include <inc-util/params.hpp>
#include <inc-util/utils.hpp>
#include <inc-util/register.hpp>
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment