📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








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 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit