mirror of
https://github.com/idapython/src
synced 2026-06-08 14:47:00 +00:00
2.4 KiB
2.4 KiB
Examples
IDAPython examples
This collection of examples organizes all IDAPython sample code into categories for easy reference. Each example demonstrates practical implementation for the IDAPython API, complementing the reference documentation with a real-world usage scenario.
How to run the examples?
Load the script via File Loader
- Navigate to File -> Script file....
- In the new dialog, select the
.pyscript you want to run and click Open.
Load the script via Script command
- Navigate to File -> Script command....
- Paste the code into Please enter script body field and click Run.
Load the script via output window/console
- In the output window/IDAPython console, type the following command:
exec(open("path/to/your_script.py").read())to execute the script.
Example Categories: Overview
% for c in sorted(categories.categories, key=lambda c: c.rank):
% endfor # categories| {{c.label}} | {{c.description}} |
% for c in sorted(categories.categories, key=lambda c: c.rank):
{{c.label}} {#{{c.id}}}
% for l in sorted(c.levels, key=lambda l: l.rank):
% endfor # levels| Level | Examples |
|---|---|
| {{l.label}} |
|
% endfor # categories
Examples list
% for c in sorted(categories.categories, key=lambda c: c.rank): % for l in sorted(c.levels, key=lambda l: l.rank): % for e in sorted(l.examples, key=lambda e: e.name):
{{e.summary}} {#{{e.name}}}
{{e.description}}
| Source code | Keywords | Level |
|---|---|---|
| {{e.file_name}} | {{' '.join(e.keywords)}} | {{l.label}} |
% if e.uses: APIs Used: % for use in e.uses:
{{use}}% endfor % endif
% endfor # examples % endfor # levels % endfor # categories