Open GoogleCodeExporter opened 8 years ago
I found the problem: in Androguard 1.9, CkCert.LoadFromBinary() is called, but
LoadFromBinary2() is the correct method. This seems to be fixed in the
repository already.
Original comment by kabb...@googlemail.com
on 22 Jun 2013 at 11:09
I cloned the latest repository and the LoadFromBinary2() is used, but another
TypeError occured:
TypeError Traceback (most recent call last)
/usr/lib/python2.7/site-packages/androguard-1.5-py2.7.egg/EGG-INFO/scripts/andro
lyze.py in <module>()
----> 1 a.get_certificate('META-INF/CERT.RSA')
/usr/lib/python2.7/site-packages/androguard-1.5-py2.7.egg/androguard/core/byteco
des/apk.pyc in get_certificate(self, filename)
563 cert = chilkat.CkCert()
564 f = self.get_file(filename)
--> 565 success = cert.LoadFromBinary2(f, len(f))
566
567 return success, cert
/usr/lib/python2.7/site-packages/chilkat.py in LoadFromBinary2(self, *args)
1972 def LoadFromBase64(self, *args): return _chilkat.CkCert_LoadFromBase64(self, *args)
1973 def LoadFromBinary(self, *args): return _chilkat.CkCert_LoadFromBinary(self, *args)
-> 1974 def LoadFromBinary2(self, *args): return
_chilkat.CkCert_LoadFromBinary2(self, *args)
1975 def LoadFromFile(self, *args): return _chilkat.CkCert_LoadFromFile(self, *args)
1976 def LoadPfxData(self, *args): return _chilkat.CkCert_LoadPfxData(self, *args)
TypeError: in method 'CkCert_LoadFromBinary2', argument 2 of type 'unsigned
char const *'
Original comment by shangu...@gmail.com
on 28 Jan 2014 at 11:42
I got the same error as #2
Original comment by shaoy...@gmail.com
on 5 Feb 2014 at 9:01
[deleted comment]
I think we can fix the problem as following :
def get_certificate(self, filename):
558 """
559 Return a certificate object by giving the name in the apk file
560 """
561 import chilkat
562
563 cert = chilkat.CkCert()
564 f = self.get_file(filename)
565 data = chilkat.CkByteData()
566 data.append2(f, len(f))
567 success = cert.LoadFromBinary(data)
568
569 return success, cert
Original comment by shangu...@gmail.com
on 10 Feb 2014 at 7:34
It works! Thanks!
Original comment by miles.li...@gmail.com
on 11 Feb 2014 at 4:20
I tried modifying apk.py under <androguard-dir>/androguard/core/bytecodes/ but
I think the modified code is not getting into effect.
Still in the error, I can see the lines shown from old apk.py
What am I doing wrong ?
Do I have to rebuild androguard for modified code to get into effect ? If yes,
then how ?
I am using Linux system. Executing "locate apk.py" through terminal gives me
more than one apk.py.
I tried modifying all but still the error persists.
Any help is appreciated.
TIA
Original comment by shivang....@gmail.com
on 20 Aug 2015 at 11:49
Original issue reported on code.google.com by
kabb...@web.de
on 6 Jun 2013 at 4:23