From 37bc7f679b870b169726e746b75e573db1f3e268 Mon Sep 17 00:00:00 2001 From: plafosse Date: Sun, 26 Jul 2015 14:27:20 -0400 Subject: Adding support for branch delay slots --- architecture.cpp | 3 ++- binaryninjaapi.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/architecture.cpp b/architecture.cpp index 60585826..6c7e0e4c 100644 --- a/architecture.cpp +++ b/architecture.cpp @@ -14,10 +14,11 @@ InstructionInfo::InstructionInfo() } -void InstructionInfo::AddBranch(BNBranchType type, uint64_t target, Architecture* arch) +void InstructionInfo::AddBranch(BNBranchType type, uint64_t target, Architecture* arch, bool hasDelaySlot) { if (branchCount >= BN_MAX_INSTRUCTION_BRANCHES) return; + branchDelay = hasDelaySlot; branchType[branchCount] = type; branchTarget[branchCount] = target; branchArch[branchCount++] = arch ? arch->GetArchitectureObject() : nullptr; diff --git a/binaryninjaapi.h b/binaryninjaapi.h index de65ee45..a5a3419e 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -776,7 +776,7 @@ namespace BinaryNinja struct InstructionInfo: public BNInstructionInfo { InstructionInfo(); - void AddBranch(BNBranchType type, uint64_t target = 0, Architecture* arch = nullptr); + void AddBranch(BNBranchType type, uint64_t target = 0, Architecture* arch = nullptr, bool hasDelaySlot = false); }; struct InstructionTextToken -- cgit v1.3.1