1
0
Fork 0

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

This commit is contained in:
Mr. eXoDia 2015-10-29 23:47:07 +01:00
parent 0cffb9d42b
commit 81377dd4b0
3 changed files with 3 additions and 7 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;