I am on the blog to publish some of my Android learning experience, I hope that everyone can help.
In the previous chapter we learned about anti-compilation.
This chapter learns two demos again.
Two demo
keygenme#1.apk crackme0a.apk
Link: http://pan.baidu.com/s/1kTs11Tt Password: DAVK
keygenme#1.apk
1, first in the simulator installation test
由于模拟器检测不到wifi mac地址,所以会报错。我们首先需要将检测代码跳过先通过dex2jar和jd-gui查看源代码进行分析
查看了main.class文件中,在public static String _activity_create(boolean paramBoolean)方法中找到了判断wifi的语句,由于模拟器不能接入wifi网络,所以必须跳过才能继续下去
使用apktool工具反编译
通过goto :cond_1来直接跳过上面if语句,跳转到label229标签处
使用apktool和signapk.jar
重新安装后又显示检测IMEI错误
重新打开,发现通过跳转代码,再查看源代码直接就跳过了wifi验证
下面继续通过上面提示的错误信息,来进行查找
错误显示由_emulator_dete1()函数产生,在main.smali中找到此函数
跳过判断语句,添加goto语句,直接跳过判断语句,修改完成后我们进行验证破解。
由于这里需要读取key.txt文件,在解压出来的apk中没找到此文件,所以最终还是进行跳转破解了 判断函数是_check_code(),我们需要其每次进行判断都是正确
修改if-eqz为if-nez,则不管输入什么都能验证成功(除了正确的验证码)
crackme0a.apk
我们第一件事情就是安装后进行初步查看
The main function is to verify by entering code
Below we see the source code through Dex2jar and Jd-gui
验证的函数是validateSerial()函数
在validateSerial()函数中,最重要的是generateIDHash()函数
下面,我自己通过generateIDHash()函数编写一个注册机代码
ImportJava.math.BigInteger;ImportJava.security.MessageDigest;ImportJava.security.NoSuchAlgorithmException; Public class Test { Public Static void Main(string[] args) {//TODO auto-generated method stubTest T =NewTest (); System.out.println (T.generateidhash ()); }PrivateStringGenerateidhash() {intK String str ="IMEI Code"; MessageDigest localmessagedigest =NULL;Try{localmessagedigest = Messagedigest.getinstance ("MD5"); }Catch(NoSuchAlgorithmException e) {//TODO auto-generated catch blockE.printstacktrace (); } localmessagedigest.update (Str.getbytes (),0, Str.length ());byte[] arrayOfByte1 = Localmessagedigest.digest ();byte[] ArrayOfByte2 =New byte[Arrayofbyte1.length];inti =0;intj =0; while(true) {if(I >= arrayofbyte1.length)return NewBigInteger (1, ArrayOfByte2). ToString ( -). SUBSTRING (0, the);if(I >=-1+ arrayofbyte1.length) K =0;Elsek=i+1; ARRAYOFBYTE2[J] = (byte) (Arrayofbyte1[i] ^ arrayofbyte1[k]); i + =2; ++j; } }}
最开始的str是输入你自己手机的IMEI码,通过计算后会得出验证code
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android learning Experience (one)---Mac under Android Anti-compilation (3)