好友
阅读权限10
听众
最后登录1970-1-1
|
本帖最后由 taintitly 于 2015-7-11 12:32 编辑
.method public static b(Ljava/lang/String;)Ljava/lang/String;
.locals 5
:try_start_0
const-string v0, "MD5" //加密模式为MD5
invoke-static {v0}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/String;)Ljava/security/MessageDigest;
move-result-object v0
new-instance v1, Ljava/lang/StringBuilder;
const-string v2, "niatxqh"
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1 //在Lxxxxxxxxxxx8H6 在这段字符前加入"niatxqh"字符串,变成"niatxqhLxxxxxxxxxxx8H6"形式
const-string v2, "c2exam86"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1 //在“niatxqhLxxxxxxxxxxx8H6” 在这段字符后加入"c2exam86"字符串,变成"niatxqhLxxxxxxxxxxx8H6c2exam86"形式
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/String;->getBytes()[B
move-result-object v1
invoke-virtual {v0, v1}, Ljava/security/MessageDigest;->update([B)V
invoke-virtual {v0}, Ljava/security/MessageDigest;->digest()[B
move-result-object v2
new-instance v3, Ljava/lang/StringBuffer;//对字符串进行MD5加密,整个加密后的字符串大写压入v3中
const-string v0, ""
invoke-direct {v3, v0}, Ljava/lang/StringBuffer;-><init>(Ljava/lang/String;)V
const/4 v0, 0x0
move v1, v0
:goto_0
array-length v0, v2
if-lt v1, v0, :cond_0
invoke-virtual {v3}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;
move-result-object v0
const/4 v1, 0x4 // 取加密字符串的第5位作为开始
const/16 v2, 0x18 // 取加密字符串的第24位作为结束
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/String;->toUpperCase()Ljava/lang/String;
move-result-object v0
return-object v0 //将20位注册码返回
==================================================================
这个软件的注册算法很简单:
MD5加密"niatxqhL"+IMEI+"8H6c2exam86"组成的字符串
然后取第5位-24位的20个大写字符作为注册码
完了....
==================================================================
将上述smali代码(部分)还原了一下:
public static string b(string s)
{
int i;
int j;
object obj;
try
{
obj = messagedigest.getInstance("MD5");
((messagedigest) (obj)).update((new StringBuilder("niatxqh")).append(s).append("c2exam86").toString().getBytes());
s = ((messagedigest) (obj)).digest();
obj = new stringbuffer("");
}
catch(string s)
i = 0;
if(i >= s.length)
return ((stringbuffer) (obj)).toString().substring(4, 24).toUpperCase(); }
|
免费评分
-
查看全部评分
|