mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-24 10:09:20 +01:00
bugfix: import enumeration did not handle imports by ordinal properly
This commit is contained in:
parent
ee8fab6c4c
commit
f57af01a21
@ -5,6 +5,9 @@
|
||||
import idaapi
|
||||
|
||||
def imp_cb(ea, name, ord):
|
||||
if not name:
|
||||
print "%08x: ord#%d" % (ea, ord)
|
||||
else:
|
||||
print "%08x: %s (ord#%d)" % (ea, name, ord)
|
||||
# True -> Continue enumeration
|
||||
# False -> Stop enumeration
|
||||
|
11
swig/nalt.i
11
swig/nalt.i
@ -26,7 +26,16 @@ static int idaapi py_import_enum_cb(
|
||||
void *param)
|
||||
{
|
||||
PyObject *py_ea = Py_BuildValue(PY_FMT64, pyul_t(ea));
|
||||
PyObject *py_name = PyString_FromString(name);
|
||||
PyObject *py_name;
|
||||
if ( name == NULL )
|
||||
{
|
||||
py_name = Py_None;
|
||||
Py_INCREF(Py_None);
|
||||
}
|
||||
else
|
||||
{
|
||||
py_name = PyString_FromString(name);
|
||||
}
|
||||
PyObject *py_ord = Py_BuildValue(PY_FMT64, pyul_t(ord));
|
||||
PyObject *py_result = PyObject_CallFunctionObjArgs((PyObject *)param, py_ea, py_name, py_ord, NULL);
|
||||
int r = py_result != NULL && PyObject_IsTrue(py_result) ? 1 : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user