Permalink
Browse files

GUI+DBG: issue #416 should be partially fixed now (mainly disassembling)

  • Loading branch information...
mrexodia committed Oct 29, 2015
1 parent 0cffb9d commit 81377dd4b009262515782d32b3851ef5400b9fb0
@@ -74,9 +74,7 @@ bool Capstone::InGroup(cs_group_type group) const
std::string Capstone::OperandText(int opindex) const
{
if(!Success())
return false;
if(opindex >= mInstr->detail->x86.op_count)
if(!Success() || opindex >= mInstr->detail->x86.op_count)
return "";
const auto & op = mInstr->detail->x86.operands[opindex];
std::string result;
@@ -415,7 +415,7 @@ bool CapstoneTokenizer::tokenizeMemOperand(const cs_x86_op & op)
//stuff inside the brackets
if(mem.base == X86_REG_RIP) //rip-relative (#replacement)
{
duint addr = _cp.Address() + duint (mem.disp);
duint addr = _cp.Address() + duint (mem.disp) + _cp.Size();
TokenValue value = TokenValue(op.size, addr);
auto displacementType = DbgMemIsValidReadPtr(addr) ? TokenType::Address : TokenType::Value;
addToken(displacementType, printValue(value, false, _maxModuleLength), value);
@@ -74,9 +74,7 @@ bool Capstone::InGroup(cs_group_type group) const
std::string Capstone::OperandText(int opindex) const
{
if(!Success())
return false;
if(opindex >= mInstr->detail->x86.op_count)
if(!Success() || opindex >= mInstr->detail->x86.op_count)
return "";
const auto & op = mInstr->detail->x86.operands[opindex];
std::string result;

0 comments on commit 81377dd

Please sign in to comment.