deycrypt / idapython

Automatically exported from code.google.com/p/idapython
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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%zynamics.com@gtempaccount.com on 28 Aug 2009 at 2:07

Attachments:

GoogleCodeExporter commented 8 years ago
Patch tested and applied. Thanks!

Original comment by gergely.erdelyi on 28 Aug 2009 at 5:13