GUI+DBG: issue #416 should be partially fixed now (mainly disassembling)
This commit is contained in:
		
							parent
							
								
									0cffb9d42b
								
							
						
					
					
						commit
						81377dd4b0
					
				|  | @ -74,9 +74,7 @@ bool Capstone::InGroup(cs_group_type group) const | ||||||
| 
 | 
 | ||||||
| std::string Capstone::OperandText(int opindex) const | std::string Capstone::OperandText(int opindex) const | ||||||
| { | { | ||||||
|     if(!Success()) |     if(!Success() || opindex >= mInstr->detail->x86.op_count) | ||||||
|         return false; |  | ||||||
|     if(opindex >= mInstr->detail->x86.op_count) |  | ||||||
|         return ""; |         return ""; | ||||||
|     const auto & op = mInstr->detail->x86.operands[opindex]; |     const auto & op = mInstr->detail->x86.operands[opindex]; | ||||||
|     std::string result; |     std::string result; | ||||||
|  |  | ||||||
|  | @ -415,7 +415,7 @@ bool CapstoneTokenizer::tokenizeMemOperand(const cs_x86_op & op) | ||||||
|     //stuff inside the brackets
 |     //stuff inside the brackets
 | ||||||
|     if(mem.base == X86_REG_RIP)   //rip-relative (#replacement)
 |     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); |         TokenValue value = TokenValue(op.size, addr); | ||||||
|         auto displacementType = DbgMemIsValidReadPtr(addr) ? TokenType::Address : TokenType::Value; |         auto displacementType = DbgMemIsValidReadPtr(addr) ? TokenType::Address : TokenType::Value; | ||||||
|         addToken(displacementType, printValue(value, false, _maxModuleLength), 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 | std::string Capstone::OperandText(int opindex) const | ||||||
| { | { | ||||||
|     if(!Success()) |     if(!Success() || opindex >= mInstr->detail->x86.op_count) | ||||||
|         return false; |  | ||||||
|     if(opindex >= mInstr->detail->x86.op_count) |  | ||||||
|         return ""; |         return ""; | ||||||
|     const auto & op = mInstr->detail->x86.operands[opindex]; |     const auto & op = mInstr->detail->x86.operands[opindex]; | ||||||
|     std::string result; |     std::string result; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue