Examples

IDC examples

The following examples demonstrate the usage of native IDA scripting language in more complex scripts. Our selection illustrates how IDC can help you automate everyday tasks and speed up your learning efforts while learning IDC scripting.

Where can I find all the examples?

The full library of our examples is shipped with your IDA instance in the idc folder.

Before you start

Some of the examples shows below used an imports another scripts, like idc.idc: the file that contains IDA built-in function declarations and internal bit definitions. It is recommend to check the idc folder for all sample scripts.

How to run the examples?

Load the script via File Loader

  1. Navigate to File -> Script file...

  2. In the new dialog, select the .idc script you want to run and click Open.

Load the script via Script command

  1. Navigate to File -> Script command....

  2. Change the scripting language to IDC.

  3. Paste the code into Please enter script body field and click Run.

Sample scripts

You can also find the scripts below in the idc folder inside your IDA directory.

analysis

Sample IDC program to automate IDA.

arraytst

Sample demonstration on how to use array manipulation functions.

bds

Sample executed when IDA detects Delphi 6-7 or BDS.

biosdata

Sample that makes comments to BIOS data area.

entrytst

Sample that shows how to get list of entry points.

find_insn

Script to be used with the 'grep' plugins.

fixuptst

Sample that gets fixup information about the file.

functest

Sample that gets list of funcions.

kernel

Sample that insert custom comments for the imported DLLs.

loaddef

Sample that loads DEF file with dialog.

loadsym

Sample that loads a SYM file with dialog.

marktest

Sample that shows how to get list of marked positions.

memcpy

Sample that demonstrates how to copy memory blocks.

ndk

Android bionic lib.

onload

File called after a new file is loaded into IDA.

opertest

Sample demonstrates how to use get_operand_value() function.

pilot

File executed when a PalmPilot program is loaded.

renimp

Script that renames imports.

resource

Sample that demonstrates how new executable format can be analyzed.

struct2

Sample that demonstrates structure manipulation functions.

structst

Sample that demonstrates structure access functions.

tpdll

Example executed when IDA detects Turbo Pascal DLL.

tpdos

Example executed when IDA detects Turbo Pascal DOS app.

tpne

Example executed when IDA detects Windows or DPMI app.

xrefs

Example shows how to use cross-reference related functions.

Other sample scripts

Batch analysis

This program forces the IDA Disassembler in “batch” analysis mode if it is started in the following way : ida -Sanalysis.idc file.

Device driver analysis

This program is automatically executed when a new device driver is loaded.

New file format definition

Structures manipulation

This program demonstrates basic structure manipulation.

VxD analysis

This program is automatically executed when a new VxD is loaded.

Last updated

Was this helpful?