当前位置: 首页>>代码示例>>C++>>正文


C++ SymbolicVariable::getSymVarName方法代码示例

本文整理汇总了C++中SymbolicVariable::getSymVarName方法的典型用法代码示例。如果您正苦于以下问题:C++ SymbolicVariable::getSymVarName方法的具体用法?C++ SymbolicVariable::getSymVarName怎么用?C++ SymbolicVariable::getSymVarName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SymbolicVariable的用法示例。


在下文中一共展示了SymbolicVariable::getSymVarName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: runtime_error

SymbolicVariable *SymbolicEngine::convertRegToSymVar(uint64 regId, uint64 symVarSize, std::string symVarComment) {
  SymbolicVariable   *symVar = nullptr;
  SymbolicExpression *expression = nullptr;
  uint64             regSymId = UNSET;

  if (regId >= ID_LAST_ITEM)
    throw std::runtime_error("SymbolicEngine::convertRegToSymVar() - Invalid register ID");

  regSymId = this->getRegSymbolicID(regId);
  if (regSymId == UNSET) {
    symVar = this->addSymbolicVariable(SymVar::kind::REG, regId, symVarSize, symVarComment);

    smt2lib::smtAstAbstractNode *tmp = smt2lib::variable(symVar->getSymVarName());
    if (tmp == nullptr)
      throw std::runtime_error("convertRegToSymVar can't create smtAstAbstractNode (nullptr)");

    SymbolicExpression *se = this->newSymbolicExpression(tmp);
    if (se == nullptr)
      throw std::runtime_error("convertRegToSymVar can't create symbolic expression (nullptr)");

    this->symbolicReg[regId] = se->getID();
  }

  else {
    expression = this->getExpressionFromId(regSymId);
    if (expression == nullptr)
      return nullptr;
    symVar = this->addSymbolicVariable(SymVar::kind::REG, regId, symVarSize, symVarComment);
    expression->setExpression(smt2lib::variable(symVar->getSymVarName()));
  }

  return symVar;
}
开发者ID:v0re,项目名称:Triton,代码行数:33,代码来源:symbolicEngine.cpp

示例2: convertRegToSymVar

uint64 SymbolicEngine::convertRegToSymVar(uint64 regId, uint64 symVarSize)
{
  SymbolicVariable   *symVar  = nullptr;
  SymbolicElement    *element = nullptr;
  std::stringstream  newExpr;
  uint64             regSymId = UNSET;

  if (regId >= ID_LAST_ITEM)
    throw std::runtime_error("SymbolicEngine::convertRegToSymVar() - Invalid register ID");

  regSymId = this->getRegSymbolicID(regId);
  if (regSymId == UNSET)
    throw std::runtime_error("SymbolicEngine::convertRegToSymVar() - This register ID is UNSET");

  element = this->getElementFromId(regSymId);

  if (element == nullptr)
    return UNSET;

  if (symVarSize != BYTE_SIZE && symVarSize != WORD_SIZE && symVarSize != DWORD_SIZE && symVarSize != QWORD_SIZE && symVarSize != DQWORD_SIZE)
    throw std::runtime_error("SymbolicEngine::convertRegToSymVar() - Invalid symVarSize");

  symVar = this->addSymbolicVariable(SymVar::kind::REG, regId, symVarSize);

  newExpr << symVar->getSymVarName();
  element->setSrcExpr(newExpr);

  return symVar->getSymVarId();
}
开发者ID:bowlofstew,项目名称:Triton,代码行数:29,代码来源:symbolicEngine.cpp

示例3: convertMemToSymVar

uint64 SymbolicEngine::convertMemToSymVar(uint64 memAddr, uint64 symVarSize)
{
  SymbolicVariable   *symVar  = nullptr;
  SymbolicElement    *element = nullptr;
  std::stringstream  newExpr;
  uint64             memSymId = UNSET;

  memSymId = this->getMemSymbolicID(memAddr);
  if (memSymId == UNSET)
    throw std::runtime_error("SymbolicEngine::convertMemToSymVar() - This memory address is UNSET");

  element = this->getElementFromId(memSymId);

  if (element == nullptr)
    return UNSET;

  if (symVarSize != BYTE_SIZE && symVarSize != WORD_SIZE && symVarSize != DWORD_SIZE && symVarSize != QWORD_SIZE && symVarSize != DQWORD_SIZE)
    throw std::runtime_error("SymbolicEngine::convertMemToSymVar() - Invalid symVarSize");

  symVar = this->addSymbolicVariable(SymVar::kind::MEM, memAddr, symVarSize);

  newExpr << symVar->getSymVarName();
  element->setSrcExpr(newExpr);

  return symVar->getSymVarId();
}
开发者ID:bowlofstew,项目名称:Triton,代码行数:26,代码来源:symbolicEngine.cpp

示例4:

/*
 * Converts an expression ID to a symbolic variable.
 * e.g:
 * #43 = (_ bv10 8)
 * convertExprToSymVar(43, 8)
 * #43 = SymVar_4
 */
SymbolicVariable *SymbolicEngine::convertExprToSymVar(uint64 exprId, uint64 symVarSize, std::string symVarComment) {
  SymbolicVariable    *symVar = nullptr;
  SymbolicExpression  *expression = this->getExpressionFromId(exprId);

  if (expression == nullptr)
    return nullptr;

  symVar = this->addSymbolicVariable(SymVar::kind::UNDEF, 0, symVarSize, symVarComment);

  expression->setExpression(smt2lib::variable(symVar->getSymVarName()));

  return symVar;
}
开发者ID:v0re,项目名称:Triton,代码行数:20,代码来源:symbolicEngine.cpp

示例5: convertExprToSymVar

/*
 * Converts an expression ID to a symbolic variable.
 * e.g:
 * #43 = (_ bv10 8)
 * convertExprToSymVar(43, 8)
 * #43 = SymVar_4
 */
uint64 SymbolicEngine::convertExprToSymVar(uint64 exprId, uint64 symVarSize)
{
  SymbolicVariable   *symVar  = nullptr;
  SymbolicElement    *element = this->getElementFromId(exprId);
  std::stringstream  newExpr;

  if (element == nullptr)
    return UNSET;

  if (symVarSize != BYTE_SIZE && symVarSize != WORD_SIZE && symVarSize != DWORD_SIZE && symVarSize != QWORD_SIZE && symVarSize != DQWORD_SIZE)
    throw std::runtime_error("SymbolicEngine::convertExprToSymVar() - Invalid symVarSize");

  symVar = this->addSymbolicVariable(SymVar::kind::UNDEF, 0, symVarSize);

  newExpr << symVar->getSymVarName();
  element->setSrcExpr(newExpr);

  return symVar->getSymVarId();
}
开发者ID:bowlofstew,项目名称:Triton,代码行数:26,代码来源:symbolicEngine.cpp

示例6: runtime_error

SymbolicVariable *SymbolicEngine::convertMemToSymVar(uint64 memAddr, uint64 symVarSize, std::string symVarComment)
{
  SymbolicVariable   *symVar = nullptr;
  SymbolicExpression *expression = nullptr;
  uint64             memSymId = UNSET;

  memSymId = this->getMemSymbolicID(memAddr);
  if (memSymId == UNSET)
    throw std::runtime_error("SymbolicEngine::convertMemToSymVar() - This memory address is UNSET");

  expression = this->getExpressionFromId(memSymId);

  if (expression == nullptr)
    return nullptr;

  symVar = this->addSymbolicVariable(SymVar::kind::MEM, memAddr, symVarSize, symVarComment);

  expression->setExpression(smt2lib::variable(symVar->getSymVarName()));

  return symVar;
}
开发者ID:Jinmo,项目名称:Triton,代码行数:21,代码来源:symbolicEngine.cpp

示例7: PyString_FromFormat

static PyObject *SymbolicVariable_getName(PyObject *self, PyObject *noarg) {
  SymbolicVariable *variable = PySymbolicVariable_AsSymbolicVariable(self);
  return PyString_FromFormat("%s", variable->getSymVarName().c_str());
}
开发者ID:EgoIncarnate,项目名称:Triton,代码行数:4,代码来源:PySymbolicVariable.cpp


注:本文中的SymbolicVariable::getSymVarName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。