mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-24 10:09:20 +01:00
78c79f85b9
What's new: - Proper multi-threaded support - Better PyObject reference counting with ref_t and newref_t helper classes - Improved the pywraps/deployment script - Added IDAViewWrapper class and example - Added idc.GetDisasmEx() - Added idc.AddSegEx() - Added idc.GetLocalTinfo() - Added idc.ApplyType() - Updated type information implementation - Introduced the idaapi.require() - see http://www.hexblog.com/?p=749 - set REMOVE_CWD_SYS_PATH=1 by default in python.cfg (remove current directory from the import search path). Various bugfixes: - fixed various memory leaks - asklong/askaddr/asksel (and corresponding idc.py functions) were returning results truncated to 32 bits in IDA64 - fix wrong documentation for idc.SizeOf - GetFloat/GetDouble functions did not take into account endianness of the processor - idaapi.NO_PROCESS was not defined, and was causing GetProcessPid() to fail - idc.py: insert escape characters to string parameter when call Eval() - idc.SaveFile/savefile were always overwriting an existing file instead of writing only the new data - PluginForm.Close() wasn't passing its arguments to the delegate function, resulting in an error.
108 lines
3.6 KiB
Python
108 lines
3.6 KiB
Python
|
|
#<pycode(py_view_base)>
|
|
class CustomIDAMemo(object):
|
|
def Refresh(self):
|
|
"""
|
|
Refreshes the graph. This causes the OnRefresh() to be called
|
|
"""
|
|
_idaapi.pygc_refresh(self)
|
|
|
|
def GetCurrentRendererType(self):
|
|
return _idaapi.pygc_get_current_renderer_type(self)
|
|
|
|
def SetCurrentRendererType(self, rtype):
|
|
"""
|
|
Set the current view's renderer.
|
|
|
|
@param rtype: The renderer type. Should be one of the idaapi.TCCRT_* values.
|
|
"""
|
|
_idaapi.pygc_set_current_renderer_type(self, rtype)
|
|
|
|
def SetNodeInfo(self, node_index, node_info, flags):
|
|
"""
|
|
Set the properties for the given node.
|
|
|
|
Example usage (set second nodes's bg color to red):
|
|
inst = ...
|
|
p = idaapi.node_info_t()
|
|
p.bg_color = 0x00ff0000
|
|
inst.SetNodeInfo(1, p, idaapi.NIF_BG_COLOR)
|
|
|
|
@param node_index: The node index.
|
|
@param node_info: An idaapi.node_info_t instance.
|
|
@param flags: An OR'ed value of NIF_* values.
|
|
"""
|
|
_idaapi.pygc_set_node_info(self, node_index, node_info, flags)
|
|
|
|
def SetNodesInfos(self, values):
|
|
"""
|
|
Set the properties for the given nodes.
|
|
|
|
Example usage (set first three nodes's bg color to purple):
|
|
inst = ...
|
|
p = idaapi.node_info_t()
|
|
p.bg_color = 0x00ff00ff
|
|
inst.SetNodesInfos({0 : p, 1 : p, 2 : p})
|
|
|
|
@param values: A dictionary of 'int -> node_info_t' objects.
|
|
"""
|
|
_idaapi.pygc_set_nodes_infos(self, values)
|
|
|
|
def GetNodeInfo(self, node):
|
|
"""
|
|
Get the properties for the given node.
|
|
|
|
@param node: The index of the node.
|
|
@return: A tuple (bg_color, frame_color, ea, text), or None.
|
|
"""
|
|
return _idaapi.pygc_get_node_info(self, node)
|
|
|
|
def DelNodesInfos(self, *nodes):
|
|
"""
|
|
Delete the properties for the given node(s).
|
|
|
|
@param nodes: A list of node IDs
|
|
"""
|
|
return _idaapi.pygc_del_nodes_infos(self, nodes)
|
|
|
|
def CreateGroups(self, groups_infos):
|
|
"""
|
|
Send a request to modify the graph by creating a
|
|
(set of) group(s), and perform an animation.
|
|
|
|
Each object in the 'groups_infos' list must be of the format:
|
|
{
|
|
"nodes" : [<int>, <int>, <int>, ...] # The list of nodes to group
|
|
"text" : <string> # The synthetic text for that group
|
|
}
|
|
|
|
@param groups_infos: A list of objects that describe those groups.
|
|
@return: A [<int>, <int>, ...] list of group nodes, or None (failure).
|
|
"""
|
|
return _idaapi.pygc_create_groups(self, groups_infos)
|
|
|
|
def DeleteGroups(self, groups, new_current = -1):
|
|
"""
|
|
Send a request to delete the specified groups in the graph,
|
|
and perform an animation.
|
|
|
|
@param groups: A list of group node numbers.
|
|
@param new_current: A node to focus on after the groups have been deleted
|
|
@return: True on success, False otherwise.
|
|
"""
|
|
return _idaapi.pygc_delete_groups(self, groups, new_current)
|
|
|
|
def SetGroupsVisibility(self, groups, expand, new_current = -1):
|
|
"""
|
|
Send a request to expand/collapse the specified groups in the graph,
|
|
and perform an animation.
|
|
|
|
@param groups: A list of group node numbers.
|
|
@param expand: True to expand the group, False otherwise.
|
|
@param new_current: A node to focus on after the groups have been expanded/collapsed.
|
|
@return: True on success, False otherwise.
|
|
"""
|
|
return _idaapi.pygc_set_groups_visibility(self, groups, expand, new_current)
|
|
|
|
#</pycode(py_view_base)>
|