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 574 | Next

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

"Gray Hat Hacking, Second Edition"


??? Variable declarations are introduced using the auto keyword:
auto addr, j, k, val;
auto min_ea, max_ea;
??? Function declarations are introduced with the static keyword. Functions have no
explicit return type. Function argument declarations do not require the auto
keyword. If you want to return a value from a function, simply return it.
Different control paths can return different data types:
static demoIdcFunc(val, addr) {
if (addr > 0x4000000) {
return addr + val; // return an int
}
else {
return "Bad addr"; //return a string
}
}
??? IDC offers most C control structures, including if, while, for, and do. The break
and continue statements are available within loops. There is no switch statement.
As with C, all statements must terminate with a semicolon. C-style bracing with
{ and } is used.
??? Most C-style operators are available in IDC. Operators that are not available
include += and all other operators of the form =.
Gray Hat Hacking: The Ethical Hacker??™s Handbook
326
Chapter 13: Advanced Static Analysis with IDA Pro
327
PART IV
??? There is no array syntax available in IDC. Sparse arrays are implemented as
named objects via the CreateArray, DeleteArray, SetArrayLong, SetArrayString,
GetArrayElement, and GetArrayId functions.


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