Miasm2
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros
Jitllvm.c
Go to the documentation of this file.
1 #include <Python.h>
2 
3 #include <inttypes.h>
4 
5 #include <stdint.h>
6 
7 PyObject* llvm_exec_bloc(PyObject* self, PyObject* args)
8 {
9  uint64_t (*func)(void*, void*);
10  uint64_t vm;
11  uint64_t cpu;
12  uint64_t ret;
13 
14  if (!PyArg_ParseTuple(args, "KKK", &func, &cpu, &vm))
15  return NULL;
16  ret = func((void*)cpu, (void*)vm);
17  return PyLong_FromUnsignedLongLong( (uint64_t)ret);
18 }
19 
20 
21 static PyMethodDef LLVMMethods[] = {
22  {"llvm_exec_bloc", llvm_exec_bloc, METH_VARARGS,
23  "llvm exec bloc"},
24  {NULL, NULL, 0, NULL} /* Sentinel */
25 };
26 
27 PyMODINIT_FUNC
29 {
30  PyObject *m;
31 
32  m = Py_InitModule("Jitllvm", LLVMMethods);
33  if (m == NULL)
34  return;
35 
36 }
PyObject * llvm_exec_bloc(PyObject *self, PyObject *args)
Definition: Jitllvm.c:7
PyMODINIT_FUNC initJitllvm(void)
Definition: Jitllvm.c:28
static PyMethodDef LLVMMethods[]
Definition: Jitllvm.c:21