summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2020-04-28 17:13:54 -0400
committerRusty Wagner <rusty@vector35.com>2020-04-28 17:17:46 -0400
commitce385dc73e2d264fc2404c75b060a8a42486e27b (patch)
treed5e4650935f414799a6b61f9cd22f047b7d0cfee /binaryninjaapi.h
parente2c1b6123769e9eb185ddb23c2f7131ed6e593e8 (diff)
Add system register list to architectures.
Global registers are commonly used for module data pointers in architectures, which are global in nature but should still be eliminated in high level ILs once the data pointers have been resolved. This means there needs to be an additional type of global register for those that should never be eliminated in any way, such as an MSR register or other registers that contain important system state with side effects. To allow for this, a list of system registers can be supplied by the archtiecture.
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index af68eafd..d0e23d28 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -2064,6 +2064,7 @@ __attribute__ ((format (printf, 1, 2)))
static uint32_t GetStackPointerRegisterCallback(void* ctxt);
static uint32_t GetLinkRegisterCallback(void* ctxt);
static uint32_t* GetGlobalRegistersCallback(void* ctxt, size_t* count);
+ static uint32_t* GetSystemRegistersCallback(void* ctxt, size_t* count);
static char* GetRegisterStackNameCallback(void* ctxt, uint32_t regStack);
static uint32_t* GetAllRegisterStacksCallback(void* ctxt, size_t* count);
@@ -2151,6 +2152,8 @@ __attribute__ ((format (printf, 1, 2)))
virtual uint32_t GetLinkRegister();
virtual std::vector<uint32_t> GetGlobalRegisters();
bool IsGlobalRegister(uint32_t reg);
+ virtual std::vector<uint32_t> GetSystemRegisters();
+ bool IsSystemRegister(uint32_t reg);
std::vector<uint32_t> GetModifiedRegistersOnWrite(uint32_t reg);
uint32_t GetRegisterByName(const std::string& name);
@@ -2303,6 +2306,7 @@ __attribute__ ((format (printf, 1, 2)))
virtual uint32_t GetStackPointerRegister() override;
virtual uint32_t GetLinkRegister() override;
virtual std::vector<uint32_t> GetGlobalRegisters() override;
+ virtual std::vector<uint32_t> GetSystemRegisters() override;
virtual std::string GetRegisterStackName(uint32_t regStack) override;
virtual std::vector<uint32_t> GetAllRegisterStacks() override;
@@ -2377,6 +2381,7 @@ __attribute__ ((format (printf, 1, 2)))
virtual uint32_t GetStackPointerRegister() override;
virtual uint32_t GetLinkRegister() override;
virtual std::vector<uint32_t> GetGlobalRegisters() override;
+ virtual std::vector<uint32_t> GetSystemRegisters() override;
virtual std::string GetRegisterStackName(uint32_t regStack) override;
virtual std::vector<uint32_t> GetAllRegisterStacks() override;