mirror of
https://github.com/cemu-project/idapython.git
synced 2024-12-27 10:11:53 +01:00
- wrapped get_debug_names() (check ex_debug_names.py)
This commit is contained in:
parent
38b7c484f3
commit
3ea31d70c7
1
build.py
1
build.py
@ -72,6 +72,7 @@ BINDIST_MANIFEST = [
|
|||||||
"examples/structure.py",
|
"examples/structure.py",
|
||||||
"examples/ex_gdl_qflow_chart.py",
|
"examples/ex_gdl_qflow_chart.py",
|
||||||
"examples/ex_strings.py",
|
"examples/ex_strings.py",
|
||||||
|
"examples/ex_debug_names.py"
|
||||||
]
|
]
|
||||||
|
|
||||||
# List files for the source distribution (appended to binary list)
|
# List files for the source distribution (appended to binary list)
|
||||||
|
15
examples/ex_debug_names.py
Normal file
15
examples/ex_debug_names.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import idaapi
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if not idaapi.is_debugger_on():
|
||||||
|
print "Please run the process first!"
|
||||||
|
return
|
||||||
|
if idaapi.get_process_state() != -1:
|
||||||
|
print "Please suspend the debugger first!"
|
||||||
|
return
|
||||||
|
|
||||||
|
dn = idaapi.get_debug_names(idaapi.cvar.inf.minEA, idaapi.cvar.inf.maxEA)
|
||||||
|
for i in dn:
|
||||||
|
print "%08x: %s" % (i, dn[i])
|
||||||
|
|
||||||
|
main()
|
22
swig/name.i
22
swig/name.i
@ -11,6 +11,7 @@
|
|||||||
%ignore get_struct_operand;
|
%ignore get_struct_operand;
|
||||||
%ignore set_debug_names;
|
%ignore set_debug_names;
|
||||||
%ignore get_debug_name;
|
%ignore get_debug_name;
|
||||||
|
%ignore get_debug_names;
|
||||||
%ignore nameVa;
|
%ignore nameVa;
|
||||||
|
|
||||||
// Unexported & kernel-only
|
// Unexported & kernel-only
|
||||||
@ -30,5 +31,26 @@
|
|||||||
%ignore is_exit_name;
|
%ignore is_exit_name;
|
||||||
%ignore dummy_name_ea;
|
%ignore dummy_name_ea;
|
||||||
|
|
||||||
|
%rename (get_debug_names) py_get_debug_names;
|
||||||
|
%inline %{
|
||||||
|
PyObject *py_get_debug_names(ea_t ea1, ea_t ea2)
|
||||||
|
{
|
||||||
|
// Get debug names
|
||||||
|
ea_name_vec_t names;
|
||||||
|
get_debug_names(ea1, ea2, names);
|
||||||
|
PyObject *dict = Py_BuildValue("{}");
|
||||||
|
if (dict == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (ea_name_vec_t::iterator it=names.begin();it!=names.end();++it)
|
||||||
|
{
|
||||||
|
PyDict_SetItem(dict,
|
||||||
|
PyInt_FromSize_t(it->ea),
|
||||||
|
PyString_FromString(it->name.c_str()));
|
||||||
|
}
|
||||||
|
return dict;
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
%include "name.hpp"
|
%include "name.hpp"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user