Flag: Tornado! Hurricane!

 Forums >>  IDA Pro  >>  Error in generating .pida file

Topic created on: February 28, 2010 01:59 CST by amitkhanna .

Hi

I'm a beginner to IDA Pro and Paimei and was practicing generating PIDA file for calc.exe using "pida_dump.py". When I run this script from IDA Pro I get the following error. Please help me in fixing this error.

-----------------------------------------------------------------------------------
Analyzing IDB...
Analyzing functions...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\IDA\python\init.py", line 65, in runscript
    execfile(script, g)
  File "C:/security/PaiMei-1.1-REV122/PaiMei-1.1-REV122/pida_dump.py", line 69, in <module>
    module = pida.module(GetInputFile(), signature, depth, analysis)
  File "C:\Python25\Lib\site-packages\pida\module.py", line 92, in __init__
    func = function(ea, self.depth, self.analysis, self)
  File "C:\Python25\Lib\site-packages\pida\function.py", line 157, in __init__
    self.__init_basic_blocks__()
  File "C:\Python25\Lib\site-packages\pida\function.py", line 224, in __init_basic_blocks__
    branches_from = self._branches_from(ea)
  File "C:\Python25\Lib\site-packages\pida\function.py", line 318, in _branches_from
    if len(xrefs) == 1 and xrefs[0] == NextNotTail(ea):
TypeError: object of type 'generator' has no len()
-----------------------------------------------------------------------------------

I'm using IDA PRo 5.5 and python 2.5 and recompiled "pydasm.pyd" as mentioned at this link
(http://www.openrce.org/forums/posts/633) but i have used libdasm-1.5.tar.gz from
(http://www.klake.org/~jt/misc/libdasm-1.5.tar.gz) instead of libdasm-1.4.tar.gz

I have downloaded Paimei 1.1-REV122 from http://www.openrce.org/downloads/download_file/208

Thanks
Amit Khanna

  amitkhanna   February 28, 2010 04:07.26 CST
I tried it again with IDA 5.1 it worked fine. But i'm not able to understand what is the problem with 5.5. Please help me.

Amit Khanna

  ero     February 28, 2010 08:50.26 CST
I'm guessing xrefs was assigned the return object from {Code/Data}Refs{From/To}, i.e.:
refs = CodeRefsFrom(x,1)
Which in the later versions of IDAPython is a generator (used to be a list).

Simply go to line 318 in "C:\Python25\Lib\site-packages\pida\function.py"

and turn xrefs into a list by doing:

if len(list(xrefs)) == 1 and list(xrefs)[0] == NextNotTail(ea)

That ought to work.

Note: Registration is required to post to the forums.

There are 28,225 total registered users.


Recently Created Topics
Reverse Engineering ...
Jan/23
Career: DoD Agency I...
Jan/22
"Disappearing&q...
Jan/17
Career: Software Sec...
Jan/11
Where is the call st...
Jan/07
IDA Pro 6.1 Breakpoi...
Jan/01
How to create data s...
Dec/30
can i search all mod...
Dec/23
IDA symbol table exp...
Dec/20
An anti-attach trick
Dec/17


Recent Forum Posts
Reverse Engineering ...
NirIzr
"Disappearing&q...
NirIzr
Reverse Engineering ...
charlie
"Disappearing&q...
charlie
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
Looking for value in...
NirIzr


Recent Blog Entries
cmathieu
Feb/07
Hacker Carnival

waleedassar
Feb/06
OllyDbg v1.10 And Hardware ...

waleedassar
Jan/31
Yet Another Anti-Debug Trick

RolfRolles
Jan/22
Finding Bugs in VMs with a ...

waleedassar
Jan/13
An OllyDbg Bug Disables Sof...

More ...


Recent Blog Comments
waleedassar on:
Feb/07
OllyDbg v1.10 And Hardware ...

NirIzr on:
Feb/07
OllyDbg v1.10 And Hardware ...

NirIzr on:
Feb/05
Yet Another Anti-Debug Trick

trolotou on:
Feb/05
Doudoune Moncler -Pennies F...

waleedassar on:
Feb/01
Yet Another Anti-Debug Trick

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit