decalage2 / oletools

oletools - python tools to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents, for malware analysis, forensics and debugging.
http://www.decalage.info/python/oletools
Other
2.88k stars 563 forks source link

Does not install correctly on Linux Mint #98

Open bontchev opened 7 years ago

bontchev commented 7 years ago

When trying to use the oletools module on Linux Mint (and, more precisely, when trying to import the hexdump3 function), I'm getting the following error:

Traceback (most recent call last):
  File "pcodedmp.py", line 5, in <module>
    from oletools.ezhexviewer import hexdump3
  File "/usr/local/lib/python2.7/dist-packages/oletools/ezhexviewer.py", line 55, in <module>
    from thirdparty.easygui import easygui
  File "/usr/local/lib/python2.7/dist-packages/oletools/thirdparty/easygui/easygui.py", line 150, in <module>
    from Tkinter import *
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
    raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package

Not sure why you need a GUI in a hex dumper, but the solution is to install the python-tk package with apt-get:

sudo apt-get install python-tk

(Apparently, it's not a Python package, so pip install python-tk won't work.)

Perhaps you should mention this somewhere in the documentation. Even better if setup.py could handle it automatically, but I'm not sure if it could install non-Python packages.

decalage2 commented 7 years ago

You are right: on Linux, tkinter needs to be installed, otherwise olebrowse and ezhexviewer won't work. I need to mention it in the documentation.

However, since you are only using the hexdump3 function, you may simply copy its code in your script instead of importing ezhexviewer.