本文整理汇总了C++中AnalysisProcessor::setMemValue方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisProcessor::setMemValue方法的具体用法?C++ AnalysisProcessor::setMemValue怎么用?C++ AnalysisProcessor::setMemValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisProcessor
的用法示例。
在下文中一共展示了AnalysisProcessor::setMemValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyErr_Format
static PyObject *Triton_setMemValue(PyObject *self, PyObject *args)
{
PyObject *addr;
PyObject *value;
PyObject *writeSize;
uint128 va; // value
uint64 ad; // address
uint64 ws; // write size
/* Extract arguments */
PyArg_ParseTuple(args, "O|O|O", &addr, &writeSize, &value);
if (!PyLong_Check(addr) && !PyInt_Check(addr))
return PyErr_Format(PyExc_TypeError, "setMemValue(): expected an address (integer) as first argument");
if (!PyLong_Check(writeSize) && !PyInt_Check(writeSize))
return PyErr_Format(PyExc_TypeError, "setMemValue(): expected an integer as second argument");
if (!PyLong_Check(value) && !PyInt_Check(value))
return PyErr_Format(PyExc_TypeError, "setMemValue(): expected an integer as third argument");
ad = PyLong_AsLong(addr);
ws = PyLong_AsLong(writeSize);
if (ws != DQWORD_SIZE && ws != QWORD_SIZE && ws != DWORD_SIZE && ws != WORD_SIZE && ws != BYTE_SIZE)
return PyErr_Format(PyExc_TypeError, "setMemValue(): The writeSize argument must be: DQWORD, QWORD, DWORD, WORD or BYTE");
if (PIN_CheckWriteAccess(reinterpret_cast<void*>(ad)) == false)
return PyErr_Format(PyExc_TypeError, "setMemValue(): Can not write into the targeted address memory");
va = PyLongObjectToUint128(value);
ap.setMemValue(ad, ws, va);
return Py_None;
}