This file contains IDA built-in function declarations and internal bit
definitions. Each byte of the program has 32-bit flags (low 8 bits keep
the byte value). These 32 bits are used in GetFlags/SetFlags functions.
You may freely examine these bits using GetFlags() but the use of the
SetFlags() function is strongly discouraged.
This file is subject to change without any notice. Future versions of
IDA may use other definitions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MK_FP(seg,
off)
Return value of expression: ((seg<<4) + off) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
atoa(ea)
Convert address value to a string Return address in the form
'seg000:1234' (the same as in line prefixes) |
|
|
|
|
|
|
|
|
|
|
rotate_left(value,
count,
nbits,
offset)
Rotate a value to the left (or right) |
|
|
|
|
|
|
|
|
|
|
|
|
|
AddHotkey(hotkey,
idcfunc)
Add hotkey for IDC function |
|
|
|
|
|
|
|
Jump(ea)
Move cursor to the specifed linear address |
|
|
|
|
Wait()
Process all entries in the autoanalysis queue Wait for the end of
autoanalysis |
|
|
|
|
Compile(filename)
Compile an IDC file. |
|
|
|
|
Exit(code)
Stop execution of IDC program, close the database and exit to OS |
|
|
|
|
Exec(command)
Execute an OS command. |
|
|
|
|
|
|
|
ApplySig(name)
Load (plan to apply) a FLIRT signature file |
|
|
|
|
DeleteAll()
Delete all segments, instructions, comments, i.e. |
|
|
|
|
MakeCode(ea)
Create an instruction at the specified address |
|
|
|
|
AnalyzeArea(sEA,
eEA)
Perform full analysis of the area |
|
|
|
|
|
|
|
MakeComm(ea,
comment)
Set an indented regular comment of an item |
|
|
|
|
MakeRptCmt(ea,
comment)
Set an indented repeatable comment of an item |
|
|
|
|
|
|
|
MakeStr(ea,
endea)
Create a string. |
|
|
|
|
MakeData(ea,
flags,
size,
tid)
Create a data item at the specified address |
|
|
|
|
MakeByte(ea)
Convert the current item to a byte |
|
|
|
|
MakeWord(ea)
Convert the current item to a word (2 bytes) |
|
|
|
|
MakeDword(ea)
Convert the current item to a double word (4 bytes) |
|
|
|
|
MakeQword(ea)
Convert the current item to a quadro word (8 bytes) |
|
|
|
|
MakeOword(ea)
Convert the current item to a octa word (16 bytes) |
|
|
|
|
MakeFloat(ea)
Convert the current item to a floating point (4 bytes) |
|
|
|
|
MakeDouble(ea)
Convert the current item to a double floating point (8 bytes) |
|
|
|
|
MakePackReal(ea)
Convert the current item to a packed real (10 or 12 bytes) |
|
|
|
|
MakeTbyte(ea)
Convert the current item to a tbyte (10 or 12 bytes) |
|
|
|
|
MakeStructEx(ea,
size,
strname)
Convert the current item to a structure instance |
|
|
|
|
MakeAlign(ea,
count,
align)
Convert the current item to an alignment directive |
|
|
|
|
MakeLocal(start,
end,
location,
name)
Create a local variable |
|
|
|
|
MakeUnkn(ea,
flags)
Convert the current item to an explored item |
|
|
|
|
MakeUnknown(ea,
size,
flags)
Convert the current item to an explored item |
|
|
|
|
OpBinary(ea,
n)
Convert an operand of the item (instruction or data) to a binary
number |
|
|
|
|
OpOctal(ea,
n)
Convert an operand of the item (instruction or data) to an octal
number |
|
|
|
|
OpDecimal(ea,
n)
Convert an operand of the item (instruction or data) to a decimal
number |
|
|
|
|
OpHex(ea,
n)
Convert an operand of the item (instruction or data) to a hexadecimal
number |
|
|
|
|
|
|
|
OpOff(ea,
n,
base)
Convert operand to an offset (for the explanations of 'ea' and 'n'
please see OpBinary()) |
|
|
|
|
OpOffEx(ea,
n,
reftype,
target,
base,
tdelta)
Convert operand to a complex offset expression This is a more
powerful version of OpOff() function. |
|
|
|
|
OpSeg(ea,
n)
Convert operand to a segment expression |
|
|
|
|
OpNumber(ea,
n)
Convert operand to a number (with default number base, radix) |
|
|
|
|
OpAlt(ea,
n,
opstr)
Specify operand represenation manually. |
|
|
|
|
OpSign(ea,
n)
Change sign of the operand |
|
|
|
|
OpNot(ea,
n)
Toggle the bitwise not operator for the operand |
|
|
|
|
OpEnumEx(ea,
n,
enumid,
serial)
Convert operand to a symbolic constant |
|
|
|
|
OpStroffEx(ea,
n,
strid,
delta)
Convert operand to an offset in a structure |
|
|
|
|
OpStkvar(ea,
n)
Convert operand to a stack variable |
|
|
|
|
OpHigh(ea,
n,
target)
Convert operand to a high offset High offset is the upper 16bits of
an offset. |
|
|
|
|
MakeVar(ea)
Mark the location as "variable" |
|
|
|
|
ExtLinA(ea,
n,
line)
Specify an additional line to display before the generated ones. |
|
|
|
|
ExtLinB(ea,
n,
line)
Specify an additional line to display after the generated ones. |
|
|
|
|
DelExtLnA(ea,
n)
Delete an additional anterior line |
|
|
|
|
DelExtLnB(ea,
n)
Delete an additional posterior line |
|
|
|
|
SetManualInsn(ea,
insn)
Specify instruction represenation manually. |
|
|
|
|
|
|
|
PatchByte(ea,
value)
Change value of a program byte |
|
|
|
|
PatchWord(ea,
value)
Change value of a program word (2 bytes) |
|
|
|
|
PatchDword(ea,
value)
Change value of a double word |
|
|
|
|
SetFlags(ea,
flags)
Set new value of flags This function should not used be used directly
if possible. |
|
|
|
|
SetReg(ea,
reg,
value)
Set value of a segment register. |
|
|
|
|
AutoMark2(start,
end,
queuetype)
Plan to perform an action in the future. |
|
|
|
|
AutoUnmark(start,
end,
queuetype)
Remove range of addresses from a queue. |
|
|
|
|
AutoMark(ea,
qtype)
Plan to analyze an address |
|
|
|
|
GenerateFile(filetype,
path,
ea1,
ea2,
flags)
Generate an output file |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Byte(ea)
Get value of program byte |
|
|
|
|
|
|
|
Word(ea)
Get value of program word (2 bytes) |
|
|
|
|
Dword(ea)
Get value of program double word (4 bytes) |
|
|
|
|
GetFloat(ea)
Get value of a floating point number (4 bytes) |
|
|
|
|
GetDouble(ea)
Get value of a floating point number (8 bytes) |
|
|
|
|
|
|
|
LocByNameEx(fromaddr,
name)
Get linear address of a name |
|
|
|
|
|
|
|
ScreenEA()
Get linear address of cursor |
|
|
|
|
|
|
|
SelStart()
Get start address of the selected area returns BADADDR - the user has
not selected an area |
|
|
|
|
SelEnd()
Get end address of the selected area |
|
|
|
|
GetReg(ea,
reg)
Get value of segment register at the specified address |
|
|
|
|
NextAddr(ea)
Get next address in the program |
|
|
|
|
PrevAddr(ea)
Get previous address in the program |
|
|
|
|
NextHead(ea,
maxea)
Get next defined item (instruction or data) in the program |
|
|
|
|
PrevHead(ea,
minea)
Get previous defined item (instruction or data) in the program |
|
|
|
|
NextNotTail(ea)
Get next not-tail address in the program This function searches for
the next displayable address in the program. |
|
|
|
|
PrevNotTail(ea)
Get previous not-tail address in the program This function searches
for the previous displayable address in the program. |
|
|
|
|
ItemEnd(ea)
Get address of the end of the item (instruction or data) |
|
|
|
|
ItemSize(ea)
Get size of instruction or data item in bytes |
|
|
|
|
NameEx(fromaddr,
ea)
Get visible name of program byte |
|
|
|
|
|
|
|
Demangle(name,
disable_mask)
Demangle a name |
|
|
|
|
|
|
|
GetMnem(ea)
Get instruction mnemonics |
|
|
|
|
GetOpnd(ea,
n)
Get operand of an instruction |
|
|
|
|
GetOpType(ea,
n)
Get type of instruction operand |
|
|
|
|
|
|
|
LineA(ea,
num)
Get anterior line |
|
|
|
|
LineB(ea,
num)
Get posterior line |
|
|
|
|
|
|
|
| CommentEx(ea,
repeatable) |
|
|
|
|
AltOp(ea,
n)
Get manually entered operand string |
|
|
|
|
GetString(ea,
length,
strtype)
Get string contents |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| FindImmediate(ea,
flag,
value) |
|
|
|
|
FindText(ea,
flag,
y,
x,
searchstr)
Returns:
ea of result or BADADDR if not found |
|
|
|
|
FindBinary(ea,
flag,
searchstr,
radix=16)
Returns:
ea of result or BADADDR if not found |
|
|
|
|
|
|
|
|
|
|
|
|
|
| SetLongPrm(offset,
value) |
|
|
|
|
| SetShortPrm(offset,
value) |
|
|
|
|
| SetCharPrm(offset,
value) |
|
|
|
|
|
|
|
|
|
|
Batch(batch)
Enable/disable batch mode of operation |
|
|
|
|
AskStr(defval,
prompt)
Ask the user to enter a string |
|
|
|
|
AskFile(forsave,
mask,
prompt)
Ask the user to choose a file |
|
|
|
|
AskAddr(defval,
prompt)
Ask the user to enter an address |
|
|
|
|
AskLong(defval,
prompt)
Ask the user to enter a number |
|
|
|
|
AskSeg(defval,
prompt)
Ask the user to enter a segment value |
|
|
|
|
AskIdent(defval,
prompt)
Ask the user to enter an identifier |
|
|
|
|
AskYN(defval,
prompt)
Ask the user a question and let him answer Yes/No/Cancel |
|
|
|
|
Message(msg)
Display a message in the message window |
|
|
|
|
Warning(msg)
Display a message in a message box |
|
|
|
|
Fatal(format)
Display a fatal message in a message box and quit IDA |
|
|
|
|
|
|
|
Refresh()
Refresh all disassembly views |
|
|
|
|
RefreshLists()
Refresh all list views (names, functions, etc) |
|
|
|
|
|
|
|
FindSelector(val)
Find a selector which has the specifed value |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SegStart(ea)
Get start address of a segment |
|
|
|
|
SegEnd(ea)
Get end address of a segment |
|
|
|
|
|
|
|
SegCreate(startea,
endea,
base,
use32,
align,
comb)
Create a new segment |
|
|
|
|
|
|
|
SegBounds(ea,
startea,
endea,
disable)
Change segment boundaries |
|
|
|
|
SegRename(ea,
name)
Change name of the segment |
|
|
|
|
SegClass(ea,
segclass)
Change class of the segment |
|
|
|
|
SegAlign(ea,
alignment)
Change alignment of the segment |
|
|
|
|
SegComb(segea,
comb)
Change combination of the segment |
|
|
|
|
SegAddrng(ea,
bitness)
Change segment addressing |
|
|
|
|
|
|
|
SegDefReg(ea,
reg,
value)
Set default segment register value for a segment |
|
|
|
|
|
|
|
|
|
|
|
|
|
| AddCodeXref(From,
To,
flowtype) |
|
|
|
|
DelCodeXref(From,
To,
undef)
Unmark exec flow 'from' 'to' |
|
|
|
|
Rfirst(From)
Get first code xref from 'From' |
|
|
|
|
Rnext(From,
current)
Get next code xref from |
|
|
|
|
RfirstB(To)
Get first code xref to 'To' |
|
|
|
|
RnextB(To,
current)
Get next code xref to 'To' |
|
|
|
|
Rfirst0(From)
Get first xref from 'From' |
|
|
|
|
Rnext0(From,
current)
Get next xref from |
|
|
|
|
RfirstB0(To)
Get first xref to 'To' |
|
|
|
|
RnextB0(To,
current)
Get next xref to 'To' |
|
|
|
|
add_dref(From,
To,
drefType)
Create Data Ref |
|
|
|
|
del_dref(From,
To)
Unmark Data Ref |
|
|
|
|
Dfirst(From)
Get first data xref from 'From' |
|
|
|
|
Dnext(From,
current)
Get next data xref from 'From' |
|
|
|
|
DfirstB(To)
Get first data xref to 'To' |
|
|
|
|
DnextB(To,
current)
Get next data xref to 'To' |
|
|
|
|
XrefType()
Return type of the last xref obtained by [RD]first/next[B0]
functions. |
|
|
|
|
|
|
|
|
|
|
|
|
|
| fseek(handle,
offset,
origin) |
|
|
|
|
|
|
|
LoadFile(filepath,
pos,
ea,
size)
Load file into IDA database |
|
|
|
|
| loadfile(filepath,
pos,
ea,
size) |
|
|
|
|
SaveFile(filepath,
pos,
ea,
size)
Save from IDA database to file |
|
|
|
|
| savefile(filepath,
pos,
ea,
size) |
|
|
|
|
|
|
|
|
|
|
| fprintf(handle,
format,
*args) |
|
|
|
|
| readshort(handle,
mostfirst) |
|
|
|
|
| readlong(handle,
mostfirst) |
|
|
|
|
| writeshort(handle,
word,
mostfirst) |
|
|
|
|
| writelong(handle,
dword,
mostfirst) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetFrame(ea)
Get ID of function frame structure |
|
|
|
|
|
|
|
|
|
|
GetFrameArgsSize(ea)
Get size of arguments in function frame which are purged upon return |
|
|
|
|
|
|
|
MakeFrame(ea,
lvsize,
frregs,
argsize)
Make function frame |
|
|
|
|
GetSpd(ea)
Get current delta for the stack pointer |
|
|
|
|
GetSpDiff(ea)
Get modification of SP made by the instruction |
|
|
|
|
SetSpDiff(ea,
delta)
Setup modification of SP made by the instruction |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetFixup(ea,
fixuptype,
targetsel,
targetoff,
displ)
Set fixup information |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetStrucId(index)
Get structure ID by structure index |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetMemberOffset(sid,
member_name)
Get offset of a member of a structure by the member name |
|
|
|
|
GetMemberNames(sid,
member_offset)
Get name of a member of a structure |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IsUnion(sid)
Is a structure a union? |
|
|
|
|
AddStrucEx(index,
name,
is_union)
Define a new structure type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AddStrucMember(sid,
name,
offset,
flag,
typeid,
nbytes)
Add structure member |
|
|
|
|
|
|
|
SetMemberName(sid,
member_offset,
name)
Change structure member name |
|
|
|
|
SetMemberType(sid,
member_offset,
flag,
typeid,
nitems)
Change structure member type |
|
|
|
|
SetMemberComment(sid,
member_offset,
comment,
repeatable)
Change structure member comment |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AppendFchunk(funcea,
ea1,
ea2)
Append a function chunk to the function |
|
|
|
|
RemoveFchunk(funcea,
tailea)
Remove a function chunk from the function |
|
|
|
|
|
|
|
FirstFuncFchunk(funcea)
Get the first function chunk of the specified function |
|
|
|
|
NextFuncFchunk(funcea,
tailea)
Get the next function chunk of the specified function |
|
|
|
|
|
|
|
GetnEnum(idx)
Get ID of the specified enum by its serial number |
|
|
|
|
GetEnumIdx(enum_id)
Get serial number of enum by its ID |
|
|
|
|
GetEnum(name)
Get enum ID by the name of enum |
|
|
|
|
|
|
|
GetEnumCmt(enum_id,
repeatable)
Get comment of enum |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetConstEx(enum_id,
value,
serial,
bmask)
Get id of constant |
|
|
|
|
|
|
|
GetLastBmask(enum_id)
Get last bitmask in the enum (bitfield) |
|
|
|
|
GetNextBmask(enum_id,
value)
Get next bitmask in the enum (bitfield) |
|
|
|
|
GetPrevBmask(enum_id,
value)
Get prev bitmask in the enum (bitfield) |
|
|
|
|
GetBmaskName(enum_id,
bmask)
Get bitmask name (only for bitfields) |
|
|
|
|
GetBmaskCmt(enum_id,
bmask,
repeatable)
Get bitmask comment (only for bitfields) |
|
|
|
|
SetBmaskName(enum_id,
bmask,
name)
Set bitmask name (only for bitfields) |
|
|
|
|
SetBmaskCmt(enum_id,
bmask,
cmt,
repeatable)
Set bitmask comment (only for bitfields) |
|
|
|
|
|
|
|
|
|
|
GetNextConst(enum_id,
value,
bmask)
Get next constant in the enum |
|
|
|
|
GetPrevConst(enum_id,
value,
bmask)
Get prev constant in the enum |
|
|
|
|
|
|
|
GetConstCmt(const_id,
repeatable)
Get comment of a constant |
|
|
|
|
AddEnum(idx,
name,
flag)
Add a new enum type |
|
|
|
|
|
|
|
SetEnumIdx(enum_id,
idx)
Give another serial number to a enum |
|
|
|
|
|
|
|
SetEnumCmt(enum_id,
cmt,
repeatable)
Set comment of enum |
|
|
|
|
|
|
|
SetEnumBf(enum_id,
flag)
Set bitfield property of enum |
|
|
|
|
|
|
|
AddConstEx(enum_id,
name,
value,
bmask)
Add a member of enum - a symbolic constant |
|
|
|
|
DelConstEx(enum_id,
value,
serial,
bmask)
Delete a member of enum - a symbolic constant |
|
|
|
|
SetConstName(const_id,
name)
Rename a member of enum - a symbolic constant |
|
|
|
|
SetConstCmt(const_id,
cmt,
repeatable)
Set a comment of a symbolic constant |
|
|
|
|
|
|
|
|
|
|
| RenameArray(hashid,
newname) |
|
|
|
|
|
|
|
| SetArrayLong(hashid,
idx,
value) |
|
|
|
|
| SetArrayString(hashid,
idx,
s) |
|
|
|
|
| GetArrayElement(tag,
hashid,
idx) |
|
|
|
|
| DelArrayElement(tag,
hashid,
idx) |
|
|
|
|
| GetFirstIndex(tag,
hashid) |
|
|
|
|
| GetLastIndex(tag,
hashid) |
|
|
|
|
| GetNextIndex(tag,
hashid,
idx) |
|
|
|
|
| GetPrevIndex(tag,
hashid,
idx) |
|
|
|
|
| SetHashLong(hashid,
idx,
value) |
|
|
|
|
| SetHashString(hashid,
idx,
value) |
|
|
|
|
|
|
|
| GetHashString(hashid,
idx) |
|
|
|
|
| DelHashElement(hashid,
idx) |
|
|
|
|
|
|
|
| GetNextHashKey(hashid,
idx) |
|
|
|
|
|
|
|
| GetPrevHashKey(hashid,
idx) |
|
|
|
|
AddSourceFile(ea1,
ea2,
filename)
Mark a range of address as belonging to a source file An address
range may belong only to one source file. |
|
|
|
|
GetSourceFile(ea)
Get name of source file occupying the given address |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LoadTil(name,
tildir=None)
Load a type library |
|
|
|
|
Til2Idb(idx,
type_name)
Copy information from type library to database Copy structure, union,
or enum definition from the type library to the IDA database. |
|
|
|
|
GetType(ea)
Get type of function/variable |
|
|
|
|
GuessType(ea)
Guess type of function/variable |
|
|
|
|
SetType(ea,
newtype)
Set type of function/variable |
|
|
|
|
ParseTypes(inputtype,
flags)
Parse type declarations |
|
|
|
|
HideArea(start,
end,
description,
header,
footer,
color)
Hide an area |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetBptAttr(ea,
bptattr)
Get the characteristics of a breakpoint |
|
|
|
|
SetBptAttr(address,
bptattr,
value)
modifiable characteristics of a breakpoint |
|
|
|
|
|
|
|
AddBptEx(ea,
size,
bpttype)
Add a new breakpoint |
|
|
|
|
|
|
|
|
|
|
EnableBpt(ea,
enable)
Enable/disable breakpoint |
|
|
|
|
|
|
|
SetColor(ea,
what,
color)
Set item color |
|
|
|
|
SetXML(path,
name,
value)
Set or update one or more XML values. |
|
|
|
|
GetXML(path)
Get one XML value. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| WriteTxt(filepath,
ea1,
ea2) |
|
|
|
|
|
|
|
| AddConst(enum_id,
name,
value) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| DelConst(constid,
v,
mask) |
|
|
|
|
| GetConst(constid,
v,
mask) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|