本文整理汇总了C++中Operand::GetReg方法的典型用法代码示例。如果您正苦于以下问题:C++ Operand::GetReg方法的具体用法?C++ Operand::GetReg怎么用?C++ Operand::GetReg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operand
的用法示例。
在下文中一共展示了Operand::GetReg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FormatOperand
bool Architecture::FormatOperand(
Document const& rDoc,
Address const& rAddr,
Instruction const& rInsn,
Operand const& rOprd,
u8 OperandNo,
PrintData & rPrintData) const
{
rPrintData.MarkOffset();
auto const& rBinStrm = rDoc.GetBinaryStream();
if (rOprd.GetType() == O_NONE)
return true;
u32 OprdType = rOprd.GetType();
auto const* pCpuInfo = GetCpuInformation();
std::string MemBegChar = "[";
std::string MemEndChar = "]";
if (OprdType & O_MEM)
rPrintData.AppendOperator("[");
if (OprdType & O_REL || OprdType & O_ABS)
{
Address DstAddr;
if (rInsn.GetOperandReference(rDoc, 0, rAddr, DstAddr))
{
auto Lbl = rDoc.GetLabelFromAddress(DstAddr);
if (Lbl.GetType() != Label::Unknown)
rPrintData.AppendLabel(Lbl.GetLabel());
else
rPrintData.AppendAddress(rAddr);
}
else
rPrintData.AppendImmediate(rOprd.GetValue(), rAddr.GetOffsetSize());
}
else if (OprdType & O_DISP || OprdType & O_IMM)
{
if (rOprd.GetType() & O_NO_REF)
{
rPrintData.AppendImmediate(rOprd.GetValue(), rAddr.GetOffsetSize());
return true;
}
Address OprdAddr = rDoc.MakeAddress(rOprd.GetSegValue(), rOprd.GetValue());
auto Lbl = rDoc.GetLabelFromAddress(OprdAddr);
if (Lbl.GetType() != Label::Unknown)
rPrintData.AppendLabel(Lbl.GetLabel());
else
rPrintData.AppendAddress(OprdAddr);
}
else if (OprdType & O_REG)
{
if (pCpuInfo == nullptr)
return false;
auto pRegName = pCpuInfo->ConvertIdentifierToName(rOprd.GetReg());
if (pRegName == nullptr)
return false;
rPrintData.AppendRegister(pRegName);
}
if (OprdType & O_MEM)
rPrintData.AppendOperator("]");
return true;
}