Coder Social home page Coder Social logo

idapython's People

Watchers

 avatar

idapython's Issues

the procedure entry point func_item_iterator_decode_prev_insn could not be located in the dynamic link library ida.wll

What steps will reproduce the problem?
1. installed the ida pro 4.9 free
2. dropped the python.plw to the plugin folder
3. moved the python folder
4.started the ida pro

What is the expected output? What do you see instead?
Error during the start of the ida

What version of the product are you using? On what operating system?
ida 4.9 free , windows xp sp2

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 16 Mar 2008 at 5:24

Implement persistent data storage

Implement a facility to store data that persists between IDA runs.
Could easily be implemented by storing a pickled Python dictionary
as a netnode in the IDB.

Original issue reported on code.google.com by gergely.erdelyi on 27 Sep 2008 at 1:42

SetColor(ea, CIC_FUNC, color) doesn't work

The following code should color all functions green, but does nothing:

code_seg = FirstSeg()
for addr in Functions(SegStart(code_seg), SegEnd(code_seg)):
    SetColor(addr, CIC_FUNC, 0x00FF00)

This seems to be fixed by adding a call to idaapi.update_func. The 
CIC_SEGM case should probably be modified as well?

-----

def SetColor(ea, what, color):
    """
    Set item color

    @param ea: address of the item
    @param what: type of the item (one of CIC_* constants)
    @param color: new color code in RGB (hex 0xBBGGRR)

    @return: success (True or False)
    """
    if what not in [ CIC_ITEM, CIC_FUNC, CIC_SEGM ]:
        raise ValueError, "'what' must be one of CIC_ITEM, CIC_FUNC and 
CIC_SEGM"

    if what == CIC_ITEM:
        return idaapi.set_item_color(ea, color)

    if what == CIC_FUNC:
        func = idaapi.get_func(ea)
        if func:
            func.color = color
            return bool(idaapi.update_func(func))
        else:
            return False

    if what == CIC_SEGM:
        seg = idaapi.getseg(ea)
        if seg:
            seg.color = color
            return True
        else:
            return False

Original issue reported on code.google.com by [email protected] on 14 Nov 2008 at 7:47

GetOpType and GetOperandValue are destructive

The functions GetOpType and GetOperandValue affect the DB. This is
unexpected of 'Get' functions.

The problem is that these functions call ua_code, which creates an
instruction. This is obviously a problem if the desired address is not a
code at all, but can also cause undesired result when the address already
contains an instruction.

The problem can be easily fixed by using ua_ana0 instead. It sets the 'cmd'
variable, thus allowing 'get_current_instruction' to work properly, but
without changing anything in the DB.

What version of the product are you using? On what operating system?
IDAPython 1.0.0

Original issue reported on code.google.com by [email protected] on 29 Jan 2009 at 12:35

Building idapython crashes

What steps will reproduce the problem?
1. patch --verbose -p0 <idapython/patches/ida51.patch
2. cd idapython; python build.py (attached log file)
3.

What is the expected output? What do you see instead?
Expected idaPython to build sucessful, get error instead:
"../swigsdk-versions/5.1/include/typeinf.hpp:446: Error. Non-optional 
argument 'type' follows an optional argument.
../swigsdk-versions/5.1/include/typeinf.hpp:447: Error. Non-optional 
argument 'size' follows an optional argument."

What version of the product are you using? On what operating system?
gcc version: 4.2.2
python version: 2.3.4
idaadv <IDA pro 5.1 sdk>
Linux #4 SMP Mon May 29 17:23:00 BST 2006 x86_64 x86_64 x86_64 GNU/Linux
Dual Opteron machine

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 Mar 2008 at 2:39

Attachments:

Rerunning script from the recent script box (Alt-7) does not do so through init.py's runscript()



You can see that if the recent script box is used, the c++ module executes
the file directly:

http://code.google.com/p/idapython/source/browse/trunk/python.cpp#284

What it should do, like is done via Alt-9, is call runscript() in init.py:


http://code.google.com/p/idapython/source/browse/trunk/python.cpp#219
and
http://code.google.com/p/idapython/source/browse/trunk/python.cpp#221





The problem is that customizations made to runscript() will fail, and even
if (for example) issue 42 is fixed, it will still fail if the user used
Alt-7 instead of Alt-9

Original issue reported on code.google.com by [email protected] on 20 Dec 2009 at 7:57

STDOUT / STDERR replacement fails at unicode

I recently did something like 'print var' from my script. var contained a
unicode string. I don't recall the exact effect, but IDA's message window
did not like it at all.

I updated MyStdOut in init.py:

class MyStdOut:
    """
    Dummy file-like class that receives stout and stderr
    """
    def write(self, text):
        if isinstance(text, unicode):
            text = text.encode('ascii', "replace")
        _idaapi.msg(text.replace("%", "%%"))

This fixes it, at the cost of converting unicode to ascii, ignoring
extended characters.

Original issue reported on code.google.com by [email protected] on 19 Jul 2009 at 1:26

MakeFrame doesn't work for modifying sizes

The IDC MakeFrame method doesn't seem to work for the purposes of modifying
the sizes of the various frame sections (local vars, saved registers,...).

What is the expected output? What do you see instead?
It should either create the frame, or modify an existing frame.

What version of the product are you using? On what operating system?
0.9.54

Please provide any additional information below.
A solution should probably use idaapi.set_frame_sizes().
eg:
def MakeFrame(ea, lvsize, frregs, argsize):
"""
Make function frame

@param ea: any address belonging to the function
@param lvsize: size of function local variables
@param frregs: size of saved registers
@param argsize: size of function arguments

@return: ID of function frame or None
If the function did not have a frame, the frame
will be created. Otherwise the frame will be modified
"""
func = idaapi.get_func(ea)

if not func:
    return None

if idaapi.add_frame(func, lvsize, frregs, argsize):
    return 0
else:
    return idaapi.set_frame_size(func, lvsize, frregs, argsize)

Original issue reported on code.google.com by [email protected] on 22 Oct 2007 at 5:29

[PATCH] init.py patch for Python 2.6.2 (patch for rev. 218)

Hi there,

I had some problems with the runscript() function in python/init.py.
At least on my Python version (Python 2.6.2 compiled for i386), the globals
object does not have a key named "__file__". Thus, any script run from IDA
via File|Load file|Python failed with a KeyError.

What steps will reproduce the problem?
1. Run a script from IDA via File|Load file|Python

What is the expected output? What do you see instead?
I expect to be able to run Python script files. I see a KeyError instead.

What version of the product are you using? On what operating system?
IDAPython 1.2.0, SVN-rev. 218 on Linux x86_64 with a i386-compiled Python
2.6.2.

Please provide any additional information below.
I have attached a micro-patch to fix the issue (just checks if the key is
there and uses it, otherwise sets the assigned variable to '').

Btw, while I'm at it: I also have created a Debian package for IDAPython.
It installs under the /opt hierarchy and integrates itself nicely with an
existing IDA Pro. Interested?

Regards,

-- 
Christian Blichmann

========================================================================
zynamics GmbH - Address: Grosse Beckstrasse 3, 44787 Bochum, Germany
              - Phone: +49 (234) 6 87 07 86 - Fax: +49 (234) 57 00 02 00
              - UstId: DE814229418 - Trade Register: HRB 9626
========================================================================
E-mail Confidentiality Notice and Disclaimer
This e-mail and any files transmitted with it are confidential and are
intended solely for the use of the individual or entity to which they
are addressed. Access to this e-mail by anyone else is unauthorized. If
you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited. E-mail messages are not necessarily secure. Zynamics
GmbH does not accept responsibility for any changes made to this message
after it was sent.
========================================================================

Original issue reported on code.google.com by christian.blichmann%[email protected] on 28 Aug 2009 at 2:07

Attachments:

Chooser bad column name

What steps will reproduce the problem?
1. Create any chooser.
2.
3.

What is the expected output? What do you see instead?
The column name in the list should be a parameter for the chooser.
Instead the name of last item in the list is chosen as the column
name.
To overcome this I add a dummy item and ignore if it is chosen. 

What version of the product are you using? On what operating system?
0.9.0

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 2 Jul 2008 at 7:49

FindBinary() with SEARCH_UP doesn't work?

What steps will reproduce the problem?
1. Use a database on something common like notepad.exe
2. Select an address and pick out some bytes up above to search for
  (I picked "8b 0d b4 9a").
3. Try an IDC and an IDApython FindBinary() and compare results

What is the expected output? What do you see instead?

IDC version:

  auto f;
  f = FindBinary(ScreenEA(), SEARCH_UP, "8b 0d b4 9a");
  Message("f: %#x\n", f);

Output:
  f: 0x1007434

Python version:

  f = FindBinary(ScreenEA(), SEARCH_UP, "8b 0d b4 9a")
  print "f: %#x"% f

Output:
  f: 0xffffffff


What version of the product are you using? On what operating system?
0.9.56_ida5.1_py2.5, ida 5.2

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 18 Apr 2008 at 7:00

Support for IDA Pro 5.3

What steps will reproduce the problem?
1. changed 5.1 patch to apply to 5.3 (see attached patch)
2. applied 5.3 patch to 5.3 sdk
3. cd idapython; python build.py

What is the expected output? What do you see instead?
Expected output is a successful build of idapython, but what I get is this
error message:

swig -modern -python -c++ -w451 -shadow -D__GNUC__ -Iswig -o idaapi.cpp
-I../swigsdk-versions/5.1/include idaapi.i
../swigsdk-versions/5.1/include/pro.h:1613: Warning(314): print is a python
keyword, symbol will be renamed as '_print'
../swigsdk-versions/5.1/include/expr.hpp:102: Warning(362): operator= ignored
../swigsdk-versions/5.1/include/typeinf.hpp:801: Error: Syntax error in
input(1).

This is the whole output of python build.py.

Do you have any idea what it means?

What version of the product are you using? On what operating system?
I am using IDA Python 0.9.61 with IDA Pro Standard 5.3. The operating
system is Fedora Core 6 running on an Xeon processor in 32-bit mode. 


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 23 Sep 2008 at 11:17

Attachments:

idaapi doesn't support hook_to_notification_point and unhook_from_notification_point

idaapi.py (0.9.54) doesn't implement the following IDA exports:

enum hook_type_t
{
  HT_IDP,         // Hook to the processor module.
                  // The callback will receive all idp_notify events.
                  // See file idp.hpp for the list of events.
  HT_UI,          // Hook to the user interface.
                  // The callback will receive all ui_notification_t events.
                  // See file kernwin.hpp for the list of events.
  HT_DBG,         // Hook to the debugger.
                  // The callback will receive all dbg_notification_t events.
                  // See file dbg.hpp for the list of events.
  HT_IDB,         // Hook to the database events.
                  // These events are separated from the HT_IDP group
                  // to speed up things (there are too many plugins and
                  // modules hooking to the HT_IDP). Some essential events
                  // are still generated in th HT_IDP group:
                  // make_code, make_data, undefine, rename, add_func,
del_func.
                  // This list is not exhaustive.
                  // A common trait of all events in this group: the kernel
                  // does not expect any reaction to the event and does not
                  // check the return code. For event names, see the
idp_event_t
                  // in idp.hpp
  HT_LAST
};

idaman bool ida_export hook_to_notification_point(hook_type_t hook_type,
                                hook_cb_t *cb,
                                void *user_data);


// The plugin should unhook before being unloaded:
// (preferably in its termination function)
// Returns number of unhooked functions.
// If different callbacks have the same callback function pointer
// and user_data is not NULL, only the callback whose associated
// user defined data matchs will be removed.

idaman int ida_export unhook_from_notification_point(hook_type_t hook_type,
                                    hook_cb_t *cb,


What version of the product are you using? On what operating system?
0.9.54


Original issue reported on code.google.com by [email protected] on 21 Oct 2007 at 9:03

Extra parameter in Get{First|Last}Member()

GetFirstMember() and GetLastMember() pass an unnecessary 'offset' parameter to
the lower layer functions.


Original issue reported on code.google.com by gergely.erdelyi on 15 Dec 2007 at 9:07

build.py fails on Windows Vista

What steps will reproduce the problem?
1. Build idapython on Windows Vista.

What is the expected output? What do you see instead?
EXPECTED RESULTS:
Successful build.

ACTUAL RESULTS:
  File "build.py", line 343, in build_plugin
    res = builder.compile("idaapi",
UnboundLocalError: local variable 'builder' referenced before assignment

What version of the product are you using? On what operating system?
IDA 5.4, idapython 1.1.90 (svn #170), python 2.5.1.1, Windows Vista SP1.

Additional information:
This is caused by a python problem, regarding the change in the output of 
the windows "ver" command (see: http://bugs.python.org/issue1082 & 
http://bugs.python.org/issue1726668).

The fix is to change build.py line 312 from:
if system == "Windows":
to:
if system == "Windows" or system == "Microsoft":

Allowing the build script to work in both Windows XP and Windows Vista.

l8er
Itai Shaham


Original issue reported on code.google.com by [email protected] on 20 Apr 2009 at 9:58

Attachments:

GetMemberStrId() missing idaapi. and should use member's fullname

What steps will reproduce the problem?
1. Call GetMemberStrId( GetFrame( here() ), 0 )



What is the expected output? What do you see instead?
Unknown name for get_member_struc


What version of the product are you using? On what operating system?
IDAPython 0.9.56, Python 2.5.1, IDA Pro Advance 5.2

Please provide any additional information below.

Change idc.py line 4496 from: -

        cs = get_member_struc(m)

to: -

    mn = idaapi.get_member_fullname(m.id)
    if not mn:
        return -1

    cs = idaapi.get_member_struc(mn)


Original issue reported on code.google.com by [email protected] on 16 Apr 2008 at 5:24

insn_t wrapper doesn't allow access to the auxpref structure member

What steps will reproduce the problem?
1. idaapi.uana0(idaapi.get_screen_ea())
2. an_insn = idaapi.get_current_instruction()
3. print an_insn.auxpref

What is the expected output? What do you see instead?
A representation of the auxpref member is desired; however, attribute
errors are thrown.

What version of the product are you using? On what operating system?
IDAPython 0.9.0 / Python 2.5.0 on Windows

Please provide any additional information below.
ua.hpp: 399
  union
  {
    ushort auxpref;             // processor dependent field
    struct
    {
      uchar low;
      uchar high;
    } auxpref_chars;
  };

Original issue reported on code.google.com by [email protected] on 11 Dec 2007 at 9:28

Bug in idc.py:GetDebuggerEvent

What steps will reproduce the problem?
1. Just look to idc.py file
2. The function GetDebuggerEvent has an small bug:

def GetDebuggerEvent(wfne, timeout):
(...)
    return idaapi.wait_for_next_even(wfne, timeout)

It should be:

def GetDebuggerEvent(wfne, timeout):
(...)
    return idaapi.wait_for_next_event(wfne, timeout)

Original issue reported on code.google.com by [email protected] on 12 Feb 2009 at 9:36

idautils.py Functions() logic error

What steps will reproduce the problem?
1. Functions(start_addr, end_addr)
2.
3.

What is the expected output? What do you see instead?
If start_addr is not code
#################################
    func = idaapi.get_func(start)
    while func and func.startEA < end:
        yield func.startEA
        func = idaapi.get_next_func(func.startEA)
#################################
func is None, the result is empty

What version of the product are you using? On what operating system?
IDA5.5

Please provide any additional information below.
the right logic should follow 5.4 version, i.e, add current if it's code, 
and find next function if possible
OR
func = idaapi.get_next_func(start-1) # if start >= 1

Original issue reported on code.google.com by [email protected] on 14 Jul 2009 at 7:28

Different datatypes on Linux and Windows

Hey there,

Just encountered a strange problem with version 1.2.0 (again SVN rev. 218).
We use the wrapped op_t class from Python and encounter different datatypes
for the dtyp member (I guess also for the other signed char members).

Windows 32-bit, IDA 5.5, IDAPython 1.2.10 with Python 2.5.2 (binary from
the web site):
type(op.dtyp) == 'str'

Linux 64-bit, IDA 5.5, IDAPython 1.2.10 with 32-bit Python 2.6.2
(self-built binary):
type(op.dtyp) == 'int'

I figure the SWIG bindings in ua.i could be the culprit, specifically the
first lines starting with '%appy unsigned char { char XXX }'. I believe
they are wrapped correctly on Linux but not on Windows.
It is intended for the operand dtyp member to be wrapped to an 8-bit
unsigned integer value, right?
Btw, I'm using SWIG 1.3.36 on Debian Squeeze.

Regards,

-- 
Christian Blichmann

========================================================================
zynamics GmbH - Address: Grosse Beckstrasse 3, 44787 Bochum, Germany
              - Phone: +49 (234) 6 87 07 86 - Fax: +49 (234) 57 00 02 00
              - UstId: DE814229418 - Trade Register: HRB 9626
========================================================================
E-mail Confidentiality Notice and Disclaimer
This e-mail and any files transmitted with it are confidential and are
intended solely for the use of the individual or entity to which they
are addressed. Access to this e-mail by anyone else is unauthorized. If
you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited. E-mail messages are not necessarily secure. Zynamics
GmbH does not accept responsibility for any changes made to this message
after it was sent.
========================================================================


Original issue reported on code.google.com by christian.blichmann%[email protected] on 28 Aug 2009 at 4:12

Abount Functions()

I used to follwing statement to get a all function list

for funcea in Functions(SegStart(self.seg_start),SegEnd(self.seg_start)):
    ...
    MakeNameEx(funcea,self.funcList[i+1],0x100)
    ...

but sometimes It don't get a all functions with MakeNameEX()

What version of the product are you using? On what operating system?

idapython 1.2 with IDA 5.5



Original issue reported on code.google.com by [email protected] on 29 Dec 2009 at 1:28

Modules imported from scripts will not reload when script is rerun

What steps will reproduce the problem?
1. Run script.py from Alt-9, which has 'import mymodule'
2. Observe output
3. Modify mymodule.py
4. Run script.py from Alt-9, which has 'import mymodule'

What is the expected output? What do you see instead?

Expected: import mymodule rereads mymodule.py
Actual: because mymodule is in sys.modules, it skips reading it from the disk

What version of the product are you using? On what operating system?

IDAPython 1.2.0

Please provide any additional information below.


To fix, edit init.py as follows:

At the bottom of the file, add:

class ModuleCleaner(object):
    def __init__(self):
        self.path = sys.path
        self.std = [sys.stdin, sys.stdout, sys.stderr]
        self.baseModules = sys.modules.copy()

    def revert(self):
        for moduleName in sys.modules.keys():
            if not self.baseModules.has_key(moduleName):
                del(sys.modules[moduleName]) #forcibly unload the module
        sys.stdin, sys.stdout, sys.stderr = self.std
        sys.path = self.path

_mc = ModuleCleaner()

as the first thing inside of def runscript(), add:

    global _mc
    _mc.revert()

Original issue reported on code.google.com by [email protected] on 20 Dec 2009 at 7:21

isByte/isWord/... are wrong

Found this when I couldn't get isAlign to work.

isByte and friends are implemented as:
def is...(F):     return (isData(F) & (F & DT_TYPE) == FF_...)

That really means ((isData(F) & F & DT_TYPE) == FF_...) which is 
completely wrong.

They should all be
def is...(F):     return (isData(F) and (F & DT_TYPE) == FF_...)

Also, FF_ALIGN is defined as -0x50000000 in IDAPython, but GetFlags 
returns an unsigned number just like in IDC. FF_* should probably be 
unsigned as well. I fixed this by hacking idaapi.py since I can't be 
bothered to learn SWIG right now.

Original issue reported on code.google.com by [email protected] on 9 Dec 2008 at 11:35

Compiling IDAPython for IDA Pro 5.2 Advanced 64 bit

I want to use IDAPython with IDA Pro 5.2 Advanced for 64bit (running on
32bit Windows).

First of all I haven't found the patch for 5.2 sdk and changing it manually
is relatively hard work.
Furthermore I would like to know if there are special steps I should take
in order to compile it for 64bit. I see that in build.py the output binary
is plw 32bit plugin. I need p64 plugin.

Are you planning to release an update of the build.py or x64 compatible plugin?

Cheers,
Evgeny

Original issue reported on code.google.com by [email protected] on 15 Sep 2008 at 1:33

[PATCH] build.py improvements for building on linux-x86_64 (patch for rev. 170)

Hi there,

I just made some small changes to the build.py to make it compile with a
custom 32-bit Python 2.6.1 on my AMD64 Debian.
Since I thought my changes might be beneficial for anyone with a
non-standard environment - they shouldn't hurt everybody else either.
Basically I just added "-m32" to the "g++" command (since IDA is 32-bit on
all Linux builds) and extract the library path from the Python version that
is used to run build.py (namely python_libpath which is already used a few
lines earlier).

Have fun,

-- 
Christian Blichmann

========================================================================
zynamics GmbH  - Address: Grosse Beckstrasse 3, 44787 Bochum, Germany
               - Phone: +49(234) 6 87 07 86 - Fax: +49(201) 55 89 26 01
               - UstId: DE814229418 - Trade Register: HRB 9626
========================================================================

Original issue reported on code.google.com by christian.blichmann%[email protected] on 2 Apr 2009 at 2:28

Attachments:

add_menu_item and other GUI callback functions don't work

Here is a patch against the latest SVN (r84) that allows 
add_menu_item to work as expected.  If you are comfortable 
with the this patch works, then I'll work on some of the other
gui functions that require callbacks.

Example:

def callback( arg1, arg2 ):
  print "You clicked here %r, %r" % ( arg1, arg2 )
idaapi.add_menu_item( "File/IDC command...", "Foo...", "Alt-2", 1,
callback, ("Hello", "World") )


Original issue reported on code.google.com by [email protected] on 15 Aug 2008 at 8:14

Attachments:

Which SDK version did you use to generate interface files?


I like to use 'Choose' class to draw general list viewer in IDA,
but it doesn't support multi-column view.
After reading 'kernwin.hpp' files in IDA SDK, I realized that
I should use choose2() instead of choose().

However, idapython do not have choose2() function, 
because 'kernwin.i' doesn't have the prototype for that function. 
Which SDK Version did you use to generate interface files ?


Original issue reported on code.google.com by [email protected] on 27 Mar 2008 at 5:37

GetFchunkAttr does not work properly



What steps will reproduce the problem?

1. Place cursor to one of the function chunks.
2. run an IDC expression Message("%x\n", GetFchunkAttr(ScreenEA(),
FUNCATTR_END));
3. run a python expression print "%x" % GetFchunkAttr(ScreenEA(),
FUNCATTR_END) 

What is the expected output? What do you see instead?

The result ought to be the same, but the python expression resturns
function start(end) instead of a chunk start(end) for every chunk.

What version of the product are you using? On what operating system?

IDA 5.2, idapython 1.0.0. Windows XP SP3.





Original issue reported on code.google.com by [email protected] on 23 Jan 2009 at 9:38

GetLocalType truncated to 1024 chars

1. In IDA Create a "Local Type" that is really bigger than 1024 chars (e.g. by 
importing a 
.h file) - Ctrl-F9
2. Write a python script that calls GetLocalType(n, PRTYPE_MULTI|PRTYPE_TYPE)
3. Observer that it is truncated.

MAXSTR is 1024. But I have plenty of huge structures.

Original issue reported on code.google.com by [email protected] on 18 Apr 2009 at 1:01

idautils.Functions() makes incorrect assumption

If MinEA() does not reside in a function then the following (equivalent)
calls will return nothing:

idautils.Functions()
idautils.Functions(idc.MinEA(), idc.MaxEA())

The problem is on line 218:

http://code.google.com/p/idapython/source/browse/trunk/python/idautils.py#218
func = idaapi.get_func(start)

This needs to be encapsulated in a loop to find the start of the first
function:

func = None
while not func:
    func = idaapi.get_func(start)
    start += 1

Original issue reported on code.google.com by pedram.amini on 5 Nov 2009 at 9:09

GetFirstMember/GetLastMember broken

What steps will reproduce the problem?
1. make a python script using GetFirstMember(ea)

What is the expected output? What do you see instead?
The first offset returned

What version of the product are you using? On what operating system?
0.9.0

Please provide any additional information below.

 Dumping function disassembly
Got what we were looking for
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\IDA\python\init.py", line 55, in runscript
    execfile(script, globals())
  File "C:/getdisas.py", line 25, in <module>
    first = GetFirstMember(id)
  File "C:\Program Files\IDA\python\idc.py", line 4267, in GetFirstMember
    return idaapi.get_struc_first_offset(s, offset)
NameError: global name 'offset' is not defined

Original issue reported on code.google.com by [email protected] on 20 Aug 2008 at 2:48

Problem with AddStrucMember when member is a reference and implementation

What steps will reproduce the problem?
1. Create some structure
2. Invoke AddStrucMember with FF_DWRD | offflag() in the "flag" param. I
tried using FF_DWRD | FF_0OFF | FF_1OFF with the same result.
3. Convert some data to this structure

What is the expected output? What do you see instead?

The field flagged as offset should be treated as such, but appears just as
simple DWORD.

What version of the product are you using? On what operating system?

Using IDA 5.1 on Windows XP SP2

Please provide any additional information below.

The problem is related to the implementation of AddStrucMember in
IDAPython, which does not initialize correctly the typeinfo structure
before invoking add_struc_member. There is a diff file attached to solve
this problem.

The diff also provides the implementation of SetType function, which was
not implemented.

For more information contact me at: [email protected]

Congratulations for the good job! IDAPython is a very useful tool.

Original issue reported on code.google.com by [email protected] on 28 Nov 2007 at 4:52

Attachments:

build.py tries to copy the deleted file patches/ida53.patch

What steps will reproduce the problem?
1. Build idapython.

What is the expected output? What do you see instead?
EXPECTED RESULTS:
Successful build.

ACTUAL RESULTS: 
IOError: [Errno 2] No such file or directory: 'patches/ida53.patch'

What version of the product are you using? On what operating system?
IDA 5.4, idapython 1.1.90 (svn #170), python 2.5.1.1, Windows Vista SP1.

Additional information:
The file /trunk/patches/ida53.patch was deleted in revision #170 since the 
"5.4 SDK does not need any special patches" (see: 
http://code.google.com/p/idapython/source/detail?r=170).

However the file "patches/ida53.patch" wasn’t removed from the list of 
files for the source distribution at line 119, failing the copy operation.

To fix, remove the no longer necessary  line.

l8er 
Itai Shaham


Original issue reported on code.google.com by [email protected] on 20 Apr 2009 at 10:14

Attachments:

Maintaining compatability with versions < 5.4

Are you dropping compatibility with IDA versions (and thus sdk versions)
below 5.4?

Is there any particular reason for this? Would you accept patches to
maintain old version compatibility, for example via #ifdefs in the
interface files?

Original issue reported on code.google.com by [email protected] on 19 Jul 2009 at 4:18

Missing function get_name_value

from name.hpp

simply not implemented. Here's the patch:

in swig\name.i:
- %ignore get_name_value;
+ # This is for get_name_value
+ %apply unsigned long *OUTPUT { uval_t *value };

[ Your port is great stuff :) I would enjoy an entry at the end of your
credits list ;) but well... just provided a simple patch ]

Original issue reported on code.google.com by [email protected] on 9 Dec 2007 at 9:00

libpython exports not available to python plugins

What steps will reproduce the problem?
1. Compile current version (1.1.91) on linux against IDA Pro 5.4
2. Install MySQLdb python extension (although other extensions also suffer)
3. Open python script box (Alt-8), execute 'import _mysql'

What is the expected output? What do you see instead?

Expected output is nothing, Actual output is an ImportError exception
because _mysql.so depends on Py_* symbols in libpython[X.Y].so but these
are not exported due to the way IDA Pro loads python.plx, and implicitly
loads libpython[X.Y].so

What version of the product are you using? On what operating system?

See above.

Please provide any additional information below.

A patch is available which solves this issue for me. It works by calling
dlopen() explicitly on libpython[X.Y].so and updating the flags to export
symbols from the library.

I do not know if a similar issue exists on MacOS X, and I am unable to test
this presently.

Original issue reported on code.google.com by [email protected] on 7 May 2009 at 2:03

Call to GetStringType is failing

here's the code from idc.py:
> def GetStringType(ea):
>     """
>     Get string type
>
>     @param ea: linear address
>
>     @return: One of ASCSTR_... constants
>     """
>     ti = idaapi.typeinfo_t()     <<<--------------------  should we wrap
in try, except to return none?
>
>     if idaapi.get_typeinfo(ea, 0, GetFlags(ea), ti):
>         return ti.strtype
>     else:
>         return None
>
>
>
> here is the code from instruction.py:
>   if opnum:
>             op0 = idaapi.get_instruction_operand(instruction, opnum)
>
>             if op0.value and op0.type == o_imm and GetStringType(self.ea) ==
> None:   <<---- we're looking for none
>                 return op0.value
>

Original issue reported on code.google.com by [email protected] on 26 Jan 2010 at 7:20

op_t::n field is exposed as str; should be int

What steps will reproduce the problem?
0. Click an x86 instruction.
1. idaapi.decode_insn(idaapi.get_screen_ea())
2. op = idaapi.get_instruction_operand(idaapi.cvar.cmd, 0)
3. print op.n, type(op.n)

What is the expected output? What do you see instead?
Expected: 0 <type 'int'>
Actual: <type 'str'>

SWIG seems to be confused by the use of type char for the n field. I have a 
wrapper class that fixes the problem:
class Operand(object):
  '''An operand.
  Thin wrapper to work around an IDAPython bug: SWIG thinks the "n" field 
of
  op_t is a string because it has type char.
  '''
  def __init__(self, op):
    self.op = op
    self.n = ord(op.n)

  def to_ida(self):
    return self.op

  def __getattr__(self, attribute):
    return getattr(self.op, attribute)

  def __cmp__(self, op):
    return cmp(self.op, op.op)

What version of the product are you using? On what operating system?
IDAPython 1.1.92 shipped with 32-bit IDA 5.5.0.925 on Windows 7.

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 13 Jul 2009 at 5:22

GetOperandValue() doesn't return the same result as the IDC version

What steps will reproduce the problem?
1. Use, for example, a database on notepad.exe
2. Select an instruction with a memory reference in operand 0
3. Run the command shown below both from IDC and idapython.

What is the expected output? What do you see instead?

I expect GetOperandValue(ScreenEA(), 0) in idapython to
return the same result as it does in IDC.  Instead the
idapython version returns 0, far as I can tell.  It doesn't matter
what the operand number is (as long as you specify the correct
operand number to go with the instruction you selected).

What version of the product are you using? On what operating system?
Version 0.9.56, ida 5.2

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 18 Apr 2008 at 6:51

Chooser gets garbage collected(access violation)

What steps will reproduce the problem?
1. Create a chooser(not dialog box). and immediately call choose
2. Press on the items in the list
3.

What is the expected output? What do you see instead?
Not access violation :)

What version of the product are you using? On what operating system?
0.9.0

Please provide any additional information below.
Example code:
Choose(['aaa','bbb'], 'dd',0).choose() # this should crash IDA

If you write:
c = Choose(['aaa','bbb'], 'dd',0)
c.choose()

It will work(probably because the reference in c), but after
some time it will crash if you try to press the list(This only
happened when I created a complex chooser).

Original issue reported on code.google.com by [email protected] on 2 Jul 2008 at 7:47

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.