From 06f0ff19d5278fa90b90ba43612f94299eb39903 Mon Sep 17 00:00:00 2001 From: "elias.bachaalany@gmail.com" Date: Fri, 2 Dec 2011 15:42:36 +0000 Subject: [PATCH] bugfixes: - op_t.is_reg() was buggy - build.py: build.py was putting duplicate files into the .zip - added backed wrapped version of get_ascii_contents() - misc changes... --- CHANGES.txt | 3 ++- build.py | 3 ++- swig/bytes.i | 25 +++++++++++++++++++++++++ swig/typeinf.i | 1 + swig/ua.i | 2 +- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 4ccdb92..f3c549a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,7 @@ Please see http://code.google.com/p/idapython/source/list for a detailed list of Changes from version 1.5.2 to 1.5.3 ------------------------------------ +- IDA Pro 6.2 support - added set_idc_func_ex(): it is now possible to add new IDC functions using Python - added visit_patched_bytes() (see ex_patch.py) - added support for the multiline text input control in the Form class @@ -13,7 +14,7 @@ Changes from version 1.5.2 to 1.5.3 - added register_timer()/unregister_timer(). Check ex_timer.py - added the IDC (Arrays) netnode manipulation layer into idc.py - added idautils.Structs() and StructMembers() generator functions -- removed the "Run Python Statment" menu item. IDA now has a unified dialog. +- removed the "Run Python Statement" menu item. IDA now has a unified dialog. Use RunPlugin("python", 0) to invoke it manually. - better error messages for script plugins, loaders and processor modules - bugfix: Dbg_Hooks.dbg_run_to() was receiving wrong input diff --git a/build.py b/build.py index 64aca0f..330cbbf 100644 --- a/build.py +++ b/build.py @@ -418,7 +418,8 @@ def build_binary_package(ea64, nukeold): binmanifest = [] if nukeold: binmanifest.extend(BINDIST_MANIFEST) - binmanifest.extend([(x, "python") for x in "python/init.py", "python/idc.py", "python/idautils.py", "idaapi.py"]) + if not ea64 or nukeold: + binmanifest.extend([(x, "python") for x in "python/init.py", "python/idc.py", "python/idautils.py", "idaapi.py"]) binmanifest.append((plugin_name, "plugins")) build_distribution(binmanifest, BINDISTDIR, ea64, nukeold) diff --git a/swig/bytes.i b/swig/bytes.i index 2cbbe1b..425d58b 100644 --- a/swig/bytes.i +++ b/swig/bytes.i @@ -97,6 +97,7 @@ %rename (unregister_custom_data_type) py_unregister_custom_data_type; %rename (register_custom_data_type) py_register_custom_data_type; %rename (get_many_bytes) py_get_many_bytes; +%rename (get_ascii_contents) py_get_ascii_contents; %rename (get_ascii_contents2) py_get_ascii_contents2; %{ // @@ -800,6 +801,30 @@ static PyObject *py_get_ascii_contents2( qfree(buf); return py_buf; } +//--------------------------------------------------------------------------- +/* +# +def get_ascii_contents(ea, len, type): + """ + Get contents of ascii string + This function returns the displayed part of the string + It works even if the string has not been created in the database yet. + + @param ea: linear address of the string + @param len: length of the string in bytes (including terminating 0) + @param type: type of the string + @return: string contents (not including terminating 0) or None + """ + pass +# +*/ +static PyObject *py_get_ascii_contents( + ea_t ea, + size_t len, + int32 type) +{ + return py_get_ascii_contents2(ea, len, type); +} diff --git a/swig/typeinf.i b/swig/typeinf.i index f250a88..576701a 100644 --- a/swig/typeinf.i +++ b/swig/typeinf.i @@ -152,6 +152,7 @@ %ignore append_type_name; %ignore for_all_types_ex; +%ignore fix_idb_type; %ignore pdb2ti; %include "typeinf.hpp" diff --git a/swig/ua.i b/swig/ua.i index 76ec6c2..6656715 100644 --- a/swig/ua.i +++ b/swig/ua.i @@ -858,7 +858,7 @@ class op_t(py_clinked_object_t): def is_reg(self, r): """Checks if the register operand is the given processor register""" - return self.type == _idaapi.o_reg and self == r + return self.type == o_reg and self.reg == r def has_reg(self, r): """Checks if the operand accesses the given processor register"""