Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named __builtin__ #3

Closed
icepng opened this issue Mar 15, 2017 · 8 comments
Closed

ImportError: No module named __builtin__ #3

icepng opened this issue Mar 15, 2017 · 8 comments

Comments

@icepng
Copy link

icepng commented Mar 15, 2017

error like this, but it's ok when i run the sample bin "who".
files generate by BB-weightv4.py

rg@rg-virtual-machine:~/vuzzer$ python runfuzzer.py -s '/home/rg/vuzzer/bin/vlc %s' -i 'datatemp/vlc/' -w 'idafiles/vlc.pkl' -n idafiles/vlc.names -o '0x00000000'
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "runfuzzer.py", line 623, in main
    gau.prepareBBOffsets()
  File "/home/rg/vuzzer/gautils.py", line 523, in prepareBBOffsets
    tdata=pickle.load(tFD)
  File "/usr/lib/python2.7/pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "/usr/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/usr/lib/python2.7/pickle.py", line 1090, in load_global
    klass = self.find_class(module, name)
  File "/usr/lib/python2.7/pickle.py", line 1124, in find_class
    __import__(module)
ImportError: No module named __builtin__

and i can "import builtin " in the python command.

@icepng
Copy link
Author

icepng commented Mar 16, 2017

i try to generate who.names and who.pkl by BB-weightV4 in IDA, and got the same error.
is the version of IDA pro make sense, my IDA is 6.6

@tosanjay
Copy link
Contributor

We are using IDA 6.8. Can you please send me your generated .pkl/.names files?

@icepng icepng closed this as completed Mar 16, 2017
@Mizari
Copy link

Mizari commented Mar 21, 2017

Got the same problem, was using IDA 6.8. Here are .pkl/.names files. Files were generated on IDA Windows though

https://transfer.sh/UJRs7/file.names
https://transfer.sh/uo0B2/file.pkl
https://transfer.sh/PpDJ1/libmagic.so.names
https://transfer.sh/11Q6Tz/libmagic.so.pkl

@tosanjay
Copy link
Contributor

As you created pickle files on Windows and then opened them on linux, this issue will pop up. See the link: http://stackoverflow.com/questions/1849523/is-pickle-file-of-python-cross-platform
I will try to update this part in the next release.
thanks

@Mizari
Copy link

Mizari commented Mar 21, 2017

So, one has to make .names/.pkl files with IDA6.8 (not really a linux thing), and use them in Ubuntu, is that correct?..

Still http://stackoverflow.com/questions/1849523/is-pickle-file-of-python-cross-platform says that pickle is cross-platform (my versions are even the same on Windows and on Linux). After removing trailing \r's the bug still remains.

@Mizari
Copy link

Mizari commented Mar 21, 2017

Changed __builtins__ to builtins in .names files (and removed \r's) -> problem solved.
command "import __builtins__" failed in python, but "import builtins" didnt.
I used standart environment: Ubuntu 14.04, kernel 3.16.0-33-generic, python 2.7.6

@Mizari
Copy link

Mizari commented Mar 21, 2017

Although now I've got this one:
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "runfuzzer.py", line 625, in main
gau.prepareBBOffsets()
File "/home/mizari/progs/vuzzer/gautils.py", line 510, in prepareBBOffsets
tBB=pickle.load(pFD)
File "/usr/lib/python2.7/pickle.py", line 1378, in load
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 858, in load
dispatch[key](self)
KeyError: '\n'

I think I did something wrong with removing \r's here

@lzyplayer
Copy link

The problem would be the file's difference between Linux(Unix) and windows .
.pkl and .names are generated in win ,which makes its space and enter different with linuxs' .
however , use linux apt dos2unix to change the format of .pkl .names .
the problem is gone.
It maybe the solution to this Issue.But still, i'm not sure if other problem would cause the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants