Flag: Tornado! Hurricane!

 Forums >>  IDA Pro  >>  IDA + IDA Python on wine/Linux

Topic created on: May 2, 2007 01:47 CDT by gera .

As you may know (or not), I've been using the windows version of IDA on linux using wine for quite a few years now. I've been always so happy with this, that I tried to make everybody around me also use it this way.

A few weeks ago I said that I was able to use most plugins, but I had not tried to make IDA Python work (on wine/Linux). Today, I couldn't sleep, so I tried it. Result: it's working now.

It actually turned out to be simpler than what I thought (I didn't want to have lots of python instalations on my linux though).

steps to repro:

copy python25.dll and msvcr71.dll from a windows box to your IDA directory on wine (~/.wine/drive_c/Program Files/IDA on mine)
install python.plw (ida python plugin) to ~/.wine/drive_c/Program Files/IDA/plugins)

this will be enough to make the plugin load. but it'll complain about missing idc.py, etc.

now you need to place th python directory from IDA python in IDA/python

with this IDA Python will load but complain with errors on init.py. If you load idag.exe from a shell you'll see the following error message on the console:

Traceback (most recent call last):
  File "C:\Program Files\IDA\python\init.py", line 17, in <module>
    import os, os.path, traceback, warnings
ImportError: No module named os

So, what I did here was to just rename init.py to something else, and create an empty init.py

now, IDA Python will load without errors, and if you bring an IDA Python box (Alt-8 by default), you can try print "hola", and you'll see hola in the text console.

IDA Python is working, but we can't access IDA's features yet... to make a longer story short, just modify 1 line of the original init.py. The line looking:

import sys, os, os.path, traceback, warnings

must now look like:

import sys
sys.path.append('Z:/usr/lib/python2.5')
import os, os.path, traceback, warnings

where Z: is the default wine drive to map all the unix drive, and /usr/lib/python2.5 is where the files for you unix python distro are stored.

et voila! you have IDA Python working on wine/Linux with Windows' IDA version... I love it sooo much!

and of course, this is python, so if you still want to write to IDA's standard output, you can do:

import os
os.write(1,'hola manola!\n')

   gera

PS: I'm so happy that I'll zpost to datarescues' forums

  gera     May 2, 2007 01:55.44 CDT
I forgot to say that I also managed to make IDA load .pdb files (from the server or locally), and also managed to use Alex Sotirov's PDB loading plugin on wine/Linux. I had to move  /usr/lib/wine/dbghelp.dll.so out of the way (renamed it to *.old) and copied the real dbghelp.dll to IDA's directory

  gera     May 2, 2007 09:27.08 CDT
Oh well... I sent an email to Gergely Erdelyi, who maintains IDA Python, and he kindly replied back saying that using python this way we'll find problems with the native modules, most notable, _socket. If you still want to try it, because like me you hate the need to install yet another python, just copy _socket.pyd from windwos to IDA/python. This will be enough for socket. Do the same with other native modules.

Of course, you could take the less adventurous but more safe path of installing a windows version python 2.5 on wine/Linux. And this will more than likely make everything magically work. (you'll also need to install a windows version of pyMySQL, etc. when you need it)

  abuse007     May 3, 2007 20:53.51 CDT
When I run the Windows IDA GUI in WINE a lot of text does not display properly. The text is clipped and cannot be read.  I'm not sure what the issue is.

Maybe its a font issue?

Has anyone else had this problem?

I'm running IDA Pro Advanced v5.1

  gera     May 3, 2007 22:54.19 CDT
change the font to a monospaced/fixed size font. And then save de desktop as default desktop. That should fix it

  abuse007     May 7, 2007 10:54.56 CDT
Thanks Gera, I changed the font and it worked.

I have two other issues.
  1. When I hover the mouse over things in the graph view, and the popup box is empty.
  2. When changing between functions etc, occasionally I get a error message dialog box come up with the message "Cannot change Visible in OnShow or OnHide".

Do you (or anyone esle) have the same problems?
I'm using Wine version 0.9.15.

I'd love to be able to use the GUI withing Linux free of these issues.

Please let me know if I should start a new topic.

  gera     May 9, 2007 17:59.30 CDT
I have the same two problems. The second is related to the graph overview Window. If the focus is on the small window showing the graph, then you get that error, otherwise you shouldn't. If the windows is not shown, then you won't get it. At least that's what I found. I couldn't find a way to solve the problem.

The first problem bothers me a lot too, and I couldn't find a decent solution. If you can, please share!. My workaround, which only works when the yellow popped up window is small, is to scroll down with the wheel, enlarging the yellow window. If you can enlarge it until it's 100% shown, then you'll get to see the text. Otherwise the text blinks, and if you can "see fast", then you'll see the text.

sorry for the stupid answers, but I have the same problems, and this is what I found :-(

  gera

  abuse007     May 12, 2007 06:30.12 CDT
Hi Gera,

Its unfortunate that you also have the problem, but its reassuring to know I'm not the only one. If I find a solution, I'll be sure to let you know.

You are probably correct about the Graph Overview window having focus being the cause of the second error. If I come across any further information I'll let you know.

Thanks for the information.

- abuse

Note: Registration is required to post to the forums.

There are 31,026 total registered users.


Recently Created Topics
Ultimate Hacking Cha...
Jun/21
CreateMutex
May/31
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
Immunity Debugger Re...
Aug/03


Recent Forum Posts
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
OOP_RE tool available?
van7hu
Should binaries be n...
Kolisar
Problem with ollydbg
nullx42
!findtrampoline Immu...
skycrack


Recent Blog Entries
crystalwade
Jul/20
test

nieo
Mar/22
Android Application Reversing

halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

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

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