Contact Us Today!
443.276.5050

IDA Pro programming API information

IDA Pro rocks. If only there was good documentation for the API...

Useful IDA pro api functions


FunctionPurpose
Functions([start address],[end address]) returns start addresses of functions falling between the start and end address. This does DOES NOT return function representing imports
get_func(address) returns a function object (func_t) of the current memory location
Chunks(function,address)
LocByName(name) locates and returns the address of name
XrefTypeName(type) returns a string describing the xreference type
Name(address) returns the name associated with an address
Names() returns a list tuples of all names and addresses
DecodeInstruction(address) returns an instruction (inst_t) object relating to the decoded object
Flowchart(address,[flags=flags]) returns a flowchart object that can be iterated through, returning BasicBlock objects.
Note: if you want the predecessors of the BasicBlocks to be generated, use flags=FC_PREDS in constructor
Note: options in [] are optional

Segment related Functions
FunctionPurpose
getseg(address)returns a segment_t object relating to the specified address
FirstSeg()Returns address of first segement
FirstSeg()Returns address of first segement
Segments()Returns collection of starting addresses of all segement
NextSeg()Returns address of first segement, returns BADADDR when none are left
SegByName(string)Returns an index into a segment array?
SegStart(address)Returns start address of the segment in which address falls
SegEnd(address)Returns end address of the segment in which address falls
SegName(address)Returns the name of the segment in which address falls

Useful classes
segment_tSegment Class
func_tFunction Class
insn_tInstruction Class
BasicBlockBasicBlock Class

xref.type == fl_CN is Code_Near_Call
xref.type == fl_CF is code_Far_Call
use XrefTypeName(type) to determine the type

Random: turn on ida output logging by setting the IDALOG environmental variable to the file you'd like to log to

Business Testimonial

I would like to recommend Paladin Group to anyone who wants or needs quality IT support. I founded a business in 1996, and a few years later Brian Brzezicki was recommended to me by a colleague. At the time I had some networking issues but once our people had a chance to work with Brian we learned there was no end to his knowledge and can do attitude. For the next ten years our business thrived and Brian was there every step of the way. He helped us build several platforms from the ground up. If we had a problem that needed attention he was prompt and needed little or no guidance to resolve it. If he didn't have an answer he would research it and get right back to us.

If you own or operate a business you know that the qualities we determined Brian exemplified are rare.

Mike Batte, Founder ShoreLink Communications