tomliamlynch / androguard

Automatically exported from code.google.com/p/androguard
Apache License 2.0
0 stars 0 forks source link

Unpack fails while parsing the magic byte from the apk header #71

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download the attached apk, coming from a stock Sony ROM
2. Try to androlyze it

android@honeynet:~/tools/androguard$ ./androlyze.py -i VpnDialogs.apk -m . -d
Traceback (most recent call last):
  File "./androlyze.py", line 280, in <module>
    main(options, arguments)
  File "./androlyze.py", line 234, in main
    _a = AndroguardS( options.input )
  File "/home/android/tools/androguard/androguard/core/androgen.py", line 241, in __init__
    self.__orig_a = Androguard( [ filename ], raw )
  File "/home/android/tools/androguard/androguard/core/androgen.py", line 91, in __init__
    self._analyze()
  File "/home/android/tools/androguard/androguard/core/androgen.py", line 113, in _analyze
    bc = dvm.DalvikVMFormat( x.get_dex() )
  File "/home/android/tools/androguard/androguard/core/bytecodes/dvm.py", line 3985, in __init__
    self.__header = HeaderItem( 0, self, ClassManager() )
  File "/home/android/tools/androguard/androguard/core/bytecodes/dvm.py", line 573, in __init__
    self.magic = unpack("=Q", buff.read(8))[0]
struct.error: unpack requires a string argument of length 8

What version of the product are you using? On what operating system?
- Latest androguard
- Python 2.7.2
- Android Reverse Engineering VM

Original issue reported on code.google.com by thomas.d...@gmail.com on 15 Aug 2012 at 11:28

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by anthony....@gmail.com on 16 Aug 2012 at 7:52

GoogleCodeExporter commented 8 years ago
There is no classes.dex in your APK !

Original comment by anthony....@gmail.com on 2 Sep 2012 at 8:36

GoogleCodeExporter commented 8 years ago
If the apk is copied from any phone that is build on lollipop and uses Android 
Runtime Environment instead of DVM, this issue occurs. 

Original comment by rs.luck...@gmail.com on 8 Apr 2015 at 7:51