summaryrefslogtreecommitdiff
path: root/architecture.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2016-07-29 22:12:59 -0400
committerRusty Wagner <rusty@vector35.com>2016-07-29 22:12:59 -0400
commit038d192dfb3f73a268447d890cccf27926d35941 (patch)
tree87065866c86fd7416e520124b8a688d3da16883e /architecture.cpp
parent508584830e65fc08ea3a756dfa651670c9e01217 (diff)
Add API to set display type of integers
Diffstat (limited to 'architecture.cpp')
-rw-r--r--architecture.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/architecture.cpp b/architecture.cpp
index d068ff36..a10ef29c 100644
--- a/architecture.cpp
+++ b/architecture.cpp
@@ -51,8 +51,8 @@ InstructionTextToken::InstructionTextToken(): type(TextToken), value(0)
}
-InstructionTextToken::InstructionTextToken(BNInstructionTextTokenType t, const std::string& txt, uint64_t val) :
- type(t), text(txt), value(val)
+InstructionTextToken::InstructionTextToken(BNInstructionTextTokenType t, const std::string& txt, uint64_t val,
+ size_t s, size_t o) : type(t), text(txt), value(val), size(s), operand(o)
{
}
@@ -144,6 +144,8 @@ bool Architecture::GetInstructionTextCallback(void* ctxt, const uint8_t* data, u
(*result)[i].type = tokens[i].type;
(*result)[i].text = BNAllocString(tokens[i].text.c_str());
(*result)[i].value = tokens[i].value;
+ (*result)[i].size = tokens[i].size;
+ (*result)[i].operand = tokens[i].operand;
}
return true;
}
@@ -931,7 +933,10 @@ bool CoreArchitecture::GetInstructionText(const uint8_t* data, uint64_t addr, si
return false;
for (size_t i = 0; i < count; i++)
- result.push_back(InstructionTextToken(tokens[i].type, tokens[i].text, tokens[i].value));
+ {
+ result.push_back(InstructionTextToken(tokens[i].type, tokens[i].text, tokens[i].value,
+ tokens[i].size, tokens[i].operand));
+ }
BNFreeInstructionText(tokens, count);
return true;