Last year's whim, the use of leisure time to do a webqq desktop software, the basic ability to achieve, then put there. WEBQQ protocol constantly updated, resulting in some parameter encryption method to update, today, a friend in the group to provide a new webqq hash js, I turned into a C # method, recorded here, I hope to be doing webqq friends help.
JS method
p=Getqqhsahs (b,j) { for(varA = 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(varc = 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]; returni}
Turn into C # method
Public stringGethash (UINTBstringj) {varA = j +"Password Error"; vari =""; varE =Newlist<int>(); while(true) { if(I.length <=a.length) {i+=b; if(I.length = =a.length) Break; } Else{i= I.substring (0, a.length); Break; } } Char[] Ichars =I.tochararray (); Char[] Achars =A.tochararray (); for(varc =0; c < i.length; C++) E.add ( (int) Ichars[c] ^ (int) (Achars[c])); string[] A1 =New string[] {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F" }; I=""; for(varc =0; c < E.count; C++) {i+ = a1[(int) E[c] >>4& the]; I+ = a1[(int) E[c] & the]; } returni; }
The return data of the code has been compared with JS, can be used; Since my own webqq has not been updated for a long time, this method has not been tested in the WEBQQ project, and the data that is encountered and JS processed in the use is inconsistent, please leave a message to inform.