webqq 获得好友列表hash算法 获得最新hash的方法

webqq获得好友列表的hash算法,大约每一个月中旬会变动一次。知道怎么获得他就能够了。

js文件路径 http://web.qstatic.com/webqqpic/pubapps/0/50/eqq.all.js


加密算法为 P=function(b,i),有时候是 P=function(b,j)

直接打开这个文件后搜索P=function,有两个參数的就是。

把函数体拷贝下来后百度 js格式化工具,把内容放进去,格式化一下。


以下是2014年6月17日时的hash函数:


 

P=function(b,j){
    for (var a = j + "password error",
    i = "",
    E = [];;) if (i.length <= a.length) {
        if (i += b, i.length == a.length) break
    } else {
        i = i.slice(0, a.length);
        break
    }
    for (var c = 0; c < i.length; c++) E[c] = i.charCodeAt(c) ^ a.charCodeAt(c);
    a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
    i = "";
    for (c = 0; c < E.length; c++) i += a[E[c] >> 4 & 15],
    i += a[E[c] & 15];
    return i
}


很easy吧。

原文地址:https://www.cnblogs.com/zfyouxi/p/5350178.html