本文整理汇总了C++中AnalysisProcessor::getCurrentCtxH方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisProcessor::getCurrentCtxH方法的具体用法?C++ AnalysisProcessor::getCurrentCtxH怎么用?C++ AnalysisProcessor::getCurrentCtxH使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisProcessor
的用法示例。
在下文中一共展示了AnalysisProcessor::getCurrentCtxH方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyErr_Format
static PyObject *Triton_getMemValue(PyObject *self, PyObject *args)
{
PyObject *addr;
PyObject *readSize;
uint64 ad;
uint64 rs;
/* Extract arguments */
PyArg_ParseTuple(args, "O|O", &addr, &readSize);
if (!ap.getCurrentCtxH())
return PyErr_Format(PyExc_TypeError, "getMemValue(): Can't call getMemValue() right now. You must run the program before.");
if (!PyLong_Check(addr) && !PyInt_Check(addr))
return PyErr_Format(PyExc_TypeError, "getMemValue(): expected an address (integer) as argument");
ad = PyLong_AsLong(addr);
rs = PyLong_AsLong(readSize);
if (rs != DQWORD_SIZE && rs != QWORD_SIZE && rs != DWORD_SIZE && rs != WORD_SIZE && rs != BYTE_SIZE)
return PyErr_Format(PyExc_TypeError, "getMemValue(): The readSize argument must be: DQWORD, QWORD, DWORD, WORD or BYTE");
if (PIN_CheckReadAccess(reinterpret_cast<void*>(ad)) == false)
return PyErr_Format(PyExc_TypeError, "getMemValue(): The targeted address memory can not be read");
/* If this is a 128-bits read size, we must use uint128ToPyLongObject() */
if (rs == DQWORD_SIZE){
uint128 value = ap.getMemValue(ad, rs);
return uint128ToPyLongObject(value);
}
return Py_BuildValue("k", ap.getMemValue(ad, rs));
}
示例2: PyErr_Format
static PyObject *Triton_getSyscallReturn(PyObject *self, PyObject *std) {
uint64 ret;
if (!PyLong_Check(std) && !PyInt_Check(std))
return PyErr_Format(PyExc_TypeError, "getSyscallReturn(): expected an id (integer) as argument");
LEVEL_CORE::SYSCALL_STANDARD standard = static_cast<LEVEL_CORE::SYSCALL_STANDARD>(PyLong_AsLong(std));;
CONTEXT *ctx = static_cast<CONTEXT*>(ap.getCurrentCtxH()->getCtx());
ret = PIN_GetSyscallReturn(ctx, standard);
return PyLong_FromLong(ret);
}