mirror of
https://github.com/idapython/src
synced 2026-06-08 14:47:00 +00:00
IDAPython 1.4.3:
- IDA 6.0 support - Python CLI now prints expression evaluation result (no need to use print()) - Changed Alt-8 to Ctrl-F3 (because it conflicts with window switching key Alt+n) - Added get_highlighted_identifier() - Added PluginForm class to allow UI development with either PyQt4 or PySide - Added idautils.Entries() to enumerate entrypoints - idc / AddConst() was broken - Minor fixes
This commit is contained in:
+24
-6
@@ -16,6 +16,7 @@ import idc
|
||||
import types
|
||||
import os
|
||||
|
||||
|
||||
def refs(ea, funcfirst, funcnext):
|
||||
"""
|
||||
Generic reference collector - INTERNAL USE ONLY.
|
||||
@@ -241,6 +242,7 @@ def Chunks(start):
|
||||
yield (chunk.startEA, chunk.endEA)
|
||||
status = func_iter.next()
|
||||
|
||||
|
||||
def Modules():
|
||||
"""
|
||||
Returns a list of module objects with name,size,base and the rebase_to attributes
|
||||
@@ -251,17 +253,19 @@ def Modules():
|
||||
yield idaapi.object_t(name=mod.name, size=mod.size, base=mod.base, rebase_to=mod.rebase_to)
|
||||
result = idaapi.get_next_module(mod)
|
||||
|
||||
|
||||
def Names():
|
||||
"""
|
||||
Returns a list of names
|
||||
|
||||
@return: tuple(ea, name)
|
||||
@return: List of tuples (ea, name)
|
||||
"""
|
||||
for i in xrange(idaapi.get_nlist_size()):
|
||||
ea = idaapi.get_nlist_ea(i)
|
||||
name = idaapi.get_nlist_name(i)
|
||||
yield (ea, name)
|
||||
|
||||
|
||||
def Segments():
|
||||
"""
|
||||
Get list of segments (sections) in the binary image
|
||||
@@ -274,6 +278,20 @@ def Segments():
|
||||
yield seg.startEA
|
||||
|
||||
|
||||
def Entries():
|
||||
"""
|
||||
Returns a list of entry points
|
||||
|
||||
@return: List of tuples (index, ordinal, ea, name)
|
||||
"""
|
||||
n = idaapi.get_entry_qty()
|
||||
for i in xrange(0, n):
|
||||
ordinal = idaapi.get_entry_ordinal(i)
|
||||
ea = idaapi.get_entry(ordinal)
|
||||
name = idaapi.get_entry_name(ordinal)
|
||||
yield (i, ordinal, ea, name)
|
||||
|
||||
|
||||
def FuncItems(start):
|
||||
"""
|
||||
Get a list of function items
|
||||
@@ -475,11 +493,6 @@ class Strings(object):
|
||||
|
||||
return None
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
def GetRegisterList():
|
||||
"""Returns the register list"""
|
||||
return idaapi.ph_get_regnames()
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
def GetIdbDir():
|
||||
"""
|
||||
@@ -489,6 +502,11 @@ def GetIdbDir():
|
||||
"""
|
||||
return os.path.dirname(idaapi.cvar.database_idb) + os.sep
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
def GetRegisterList():
|
||||
"""Returns the register list"""
|
||||
return idaapi.ph_get_regnames()
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
def GetInstructionList():
|
||||
"""Returns the instruction list of the current processor module"""
|
||||
|
||||
+1
-1
@@ -7530,7 +7530,7 @@ def WriteTxt(filepath, ea1, ea2):
|
||||
def WriteExe(filepath):
|
||||
return GenerateFile(OFILE_EXE, filepath, 0, BADADDR, 0)
|
||||
|
||||
def AddConst(enum_id,name,value): return AddConstEx(enum_id,name,value,-1)
|
||||
def AddConst(enum_id,name,value): return AddConstEx(enum_id,name,value, idaapi.BADADDR)
|
||||
def AddStruc(index,name): return AddStrucEx(index,name,0)
|
||||
def AddUnion(index,name): return AddStrucEx(index,name,1)
|
||||
def OpStroff(ea,n,strid): return OpStroffEx(ea,n,strid,0)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
# -----------------------------------------------------------------------
|
||||
# IDAPython - Python plugin for Interactive Disassembler Pro
|
||||
#
|
||||
# Copyright (c) 2004-2010 Gergely Erdelyi <gergely.erdelyi@d-dome.net>
|
||||
# Copyright (c) The IDAPython Team <idapython@googlegroups.com>
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user