SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 575 | Next

Shon Harris, Allen Harper, Chris Eagle, and Jonathan Ness

"Gray Hat Hacking, Second Edition"


??? Strings are a native data type in IDC. String concatenation is performed using
the + operator, while string comparison is performed using the == operator.
There is no character data type; instead use strings of length one.
??? IDC understands the #define and #include directives. All IDC scripts executed
from files must have the directive #include . Interactive scripts need not
include this file.
??? IDC script files must contain a main function as follows:
static main() {
//idc statements
}
Executing IDC Scripts
There are two ways to execute an IDC script, both accessible via IDA??™s File menu. The first
method is to execute a stand-alone script using the File | IDC File menu option. This will
bring up a file open dialog box to select the desired script to run. A stand-alone script has
the following basic structure:
#include //Mandatory include for standalone scripts
/*
* Other idc files may be #include'd if you have split your code
* across several files.
*
* Standalone scripts can have no global variables, but can have
* any number of functions.
*
* A standalone script must have a main function
*/
static main() {
//statements for main, beginning with any variable declarations
}
The second method for executing IDC commands is to enter just the commands you wish
to execute in a dialog box provided by IDA via the File | IDC Command menu item.


Pages:
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587