Module idaapi :: Class IDP_Hooks
[frames] | no frames]

Class IDP_Hooks

object --+
         |
        IDP_Hooks

Proxy of C++ IDP_Hooks class

Instance Methods
 
__del__(self)
 
__disown__(self)
IDP_Hooks
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__repr__(self)
repr(x)
 
__swig_destroy__(self)
 
add_func(self, func)
The kernel has added a function
PyObject
assemble(self, arg0, arg1, arg2, arg3, arg4)
Assembles an instruction
int
closebase(self)
The database will be closed now
bool
custom_ana(self)
Analyzes and decodes an instruction at idaapi.cmd.ea
bool
custom_emu(self)
Emulate instruction, create cross-references, plan to analyze subsequent instructions, modify flags etc.
PyObject
custom_mnem(self)
Prints the mnemonic of the instruction defined in idaapi.cmd
bool
custom_out(self)
Outputs the instruction defined in idaapi.cmd
bool
custom_outop(self, py_op)
Notification to generate operand text.
int
del_func(self, func)
The kernel is about to delete a function
bool
hook(self)
Creates an IDP hook
int
is_call_insn(self, arg0)
Is the instruction a "call"?
int
is_ret_insn(self, arg0, arg1)
Is the instruction a "return"?
int
is_sane_insn(self, no_crefs)
is the instruction sane for the current file type?
 
load_idasgn(self, short_sig_name)
FLIRT signature have been loaded for normal processing (not for recognition of startup sequences)
int
make_code(self, ea, size)
An instruction is being created
int
make_data(self, ea, flags, tid, len)
A data item is being created
int
may_be_func(self, state)
Can a function start here?
int
rename(self, ea, new_name)
The kernel is going to rename a byte.
 
renamed(self, ea, new_name, local_name)
The kernel has renamed a byte
 
savebase(self)
The database is being saved.
int
undefine(self, ea)
An item in the database (insn or data) is being deleted
bool
unhook(self)
Removes the IDP hook

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  thisown
The membership flag

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns: IDP_Hooks
Overrides: object.__init__

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

add_func(self, func)

 

The kernel has added a function

Parameters:
  • func - the func_t instance
Returns:
Ignored

assemble(self, arg0, arg1, arg2, arg3, arg4)

 

Assembles an instruction

Parameters:
  • ea - linear address of instruction
  • cs - cs of instruction
  • ip - ip of instruction
  • use32 - is 32bit segment?
  • line - line to assemble
Returns: PyObject
- None to let the underlying processor module assemble the line
  • or a string containing the assembled buffer

custom_ana(self)

 

Analyzes and decodes an instruction at idaapi.cmd.ea

  • cmd.itype must be set >= idaapi.CUSTOM_CMD_ITYPE
  • cmd.size must be set to the instruction length
Returns: bool
Boolean
  • False if the instruction is not recognized
  • True if the instruction was decoded. idaapi.cmd should be filled in that case.

custom_emu(self)

 

Emulate instruction, create cross-references, plan to analyze subsequent instructions, modify flags etc. Upon entrance to this function all information about the instruction is in 'cmd' structure.

Returns: bool
Boolean (whether this instruction has been emulated or not)

custom_mnem(self)

 

Prints the mnemonic of the instruction defined in idaapi.cmd

Returns: PyObject
  • None: No mnemonic. IDA will use the default mnemonic value if present
  • String: The desired mnemonic string

custom_out(self)

 

Outputs the instruction defined in idaapi.cmd

Returns: bool
Boolean (whether this instruction can be outputted or not)

custom_outop(self, py_op)

 

Notification to generate operand text. If False was returned, then the standard operand output function will be called. The output buffer is inited with init_output_buffer() and this notification may use out_...() functions to form the operand text

Returns: bool
Boolean (whether the operand has been outputted or not)

del_func(self, func)

 

The kernel is about to delete a function

Parameters:
  • func - the func_t instance
Returns: int
1-ok,<=0-do not delete

hook(self)

 

Creates an IDP hook

Returns: bool
Boolean true on success

is_call_insn(self, arg0)

 

Is the instruction a "call"?

Parameters:
  • ea - instruction address
Returns: int
1-unknown, 0-no, 2-yes

is_ret_insn(self, arg0, arg1)

 

Is the instruction a "return"?

Parameters:
  • ea - instruction address
  • strict - - True: report only ret instructions False: include instructions like "leave" which begins the function epilog
Returns: int
1-unknown, 0-no, 2-yes

is_sane_insn(self, no_crefs)

 

is the instruction sane for the current file type?

Parameters:
  • no_crefs -
    • 1: the instruction has no code refs to it. ida just tries to convert unexplored bytes to an instruction (but there is no other reason to convert them into an instruction)
    • 0: the instruction is created because of some coderef, user request or another weighty reason.
Returns: int
1-ok, <=0-no, the instruction isn't likely to appear in the program

load_idasgn(self, short_sig_name)

 

FLIRT signature have been loaded for normal processing (not for recognition of startup sequences)

Parameters:
  • short_sig_name - signature name
Returns:
Ignored

make_code(self, ea, size)

 

An instruction is being created

Parameters:
  • ea - Address
  • size - Instruction size
Returns: int
1-ok, <=0-the kernel should stop

make_data(self, ea, flags, tid, len)

 

A data item is being created

Parameters:
  • ea - Address
  • tid - type id
  • flags - item flags
  • len - data item size
Returns: int
1-ok, <=0-the kernel should stop

may_be_func(self, state)

 

Can a function start here?

Parameters:
  • state - autoanalysis phase 0: creating functions 1: creating chunks
Returns: int
integer (probability 0..100)

rename(self, ea, new_name)

 

The kernel is going to rename a byte.

Parameters:
  • ea - Address
  • new_name - The new name
Returns: int
  • If returns value <=0, then the kernel should not rename it. See also the 'renamed' event

renamed(self, ea, new_name, local_name)

 

The kernel has renamed a byte

Parameters:
  • ea - Address
  • new_name - The new name
  • local_name - Is local name
Returns:
Ignored

savebase(self)

 

The database is being saved. Processor module should

undefine(self, ea)

 

An item in the database (insn or data) is being deleted

Parameters:
  • ea - Address
Returns: int
  • returns: >0-ok, <=0-the kernel should stop
  • if the return value is positive: bit0 - ignored bit1 - do not delete srareas at the item end

unhook(self)

 

Removes the IDP hook

Returns: bool
Boolean true on success

Property Details

thisown

The membership flag

Get Method:
unreachable(x)
Set Method:
unreachable(x, v)

[an error occurred while processing this directive]