Files
idapython-src/tools/examples_index_template.md
2025-03-13 16:17:53 +01:00

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

  1. Navigate to File -> Script file....
  2. In the new dialog, select the .py script you want to run and click Open.

Load the script via Script command

  1. Navigate to File -> Script command....
  2. Paste the code into Please enter script body field and click Run.

Load the script via output window/console

  1. 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}}
    {{"".join(["
  • %s
  • " % (e.name, e.summary) for e in sorted(l.examples, key=lambda e: e.name)])}}

% 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