mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-28 03:54:18 +01:00
bugfix: import enumeration did not handle imports by ordinal properly
This commit is contained in:
parent
ee8fab6c4c
commit
f57af01a21
@ -5,7 +5,10 @@
|
|||||||
import idaapi
|
import idaapi
|
||||||
|
|
||||||
def imp_cb(ea, name, ord):
|
def imp_cb(ea, name, ord):
|
||||||
print "%08x: %s (ord#%d)" % (ea, name, ord)
|
if not name:
|
||||||
|
print "%08x: ord#%d" % (ea, ord)
|
||||||
|
else:
|
||||||
|
print "%08x: %s (ord#%d)" % (ea, name, ord)
|
||||||
# True -> Continue enumeration
|
# True -> Continue enumeration
|
||||||
# False -> Stop enumeration
|
# False -> Stop enumeration
|
||||||
return True
|
return True
|
||||||
|
17
swig/nalt.i
17
swig/nalt.i
@ -20,13 +20,22 @@
|
|||||||
// param: user parameter passed to enum_import_names()
|
// param: user parameter passed to enum_import_names()
|
||||||
// return: 1-ok, 0-stop enumeration
|
// return: 1-ok, 0-stop enumeration
|
||||||
static int idaapi py_import_enum_cb(
|
static int idaapi py_import_enum_cb(
|
||||||
ea_t ea,
|
ea_t ea,
|
||||||
const char *name,
|
const char *name,
|
||||||
uval_t ord,
|
uval_t ord,
|
||||||
void *param)
|
void *param)
|
||||||
{
|
{
|
||||||
PyObject *py_ea = Py_BuildValue(PY_FMT64, pyul_t(ea));
|
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_ord = Py_BuildValue(PY_FMT64, pyul_t(ord));
|
||||||
PyObject *py_result = PyObject_CallFunctionObjArgs((PyObject *)param, py_ea, py_name, py_ord, NULL);
|
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;
|
int r = py_result != NULL && PyObject_IsTrue(py_result) ? 1 : 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user