McGod Posted May 7, 2008 Share Posted May 7, 2008 I have a function in both Actionscript and C++, but I have no idea on how exactly to convert to autoit. function getStringHashBase(s, hash) { var __reg3 = undefined; var __reg2 = undefined; __reg2 = 0; while (__reg2 < s.length) { hash = (hash << 4) + s.charCodeAt(__reg2); if (__reg3 = hash & 4.02653e+009) { hash = hash ^ __reg3 >> 24; hash = hash ^ __reg3; } ++__reg2; } return hash; } C++: DWORD GetStringHashBase(CHAR* szString, DWORD dwHash) { DWORD dwLoc3 = NULL; for(UINT i = 0; i < strlen(szString); i++) { dwHash = (dwHash << 4) + szString[i]; dwLoc3 = dwHash & 4,026532E+009; if(dwHash & 4,026532E+009) { dwHash = dwHash ^ dwLoc3 >> 24; dwHash = dwHash ^ dwLoc3; } } return dwHash; } As far as I have gotten on Autoit Func GetStringHashBase($String, $Hash) Local $sSplit = StringSplit($String, "") For $n = 1 To $sSplit[1] Step 1 $dwHash = BitShift($dwHash, -4) Next EndFunc [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
Greenhorn Posted May 8, 2008 Share Posted May 8, 2008 Hmmm, maybe like this here ... expandcollapse popupFunc GetStringHashBase($sString, $dwHash) ; null terminated C string. Local $dwLoc3, $szSplit = StringSplit($sString & Chr(0), "") For $i = 1 To $szSplit[1] $dwHash = BitShift($dwHash, -4) + $szSplit[$i] $dwLoc3 = BitAND($dwHash, 4, 026532E+009) If BitAND($dwHash, 4, 026532E+009) Then $dwHash = BitXOR($dwHash, BitShift($dwLoc3, 24)) $dwHash = BitXOR($dwHash, $dwLoc3) EndIf Next Return $dwHash EndFunc #cs DWORD GetStringHashBase(CHAR* szString, DWORD dwHash) { DWORD dwLoc3 = NULL; for(UINT i = 0; i < strlen(szString); i++) { dwHash = (dwHash << 4) + szString[i]; dwLoc3 = dwHash & 4,026532E+009; if(dwHash & 4,026532E+009) { dwHash = dwHash ^ dwLoc3 >> 24; dwHash = dwHash ^ dwLoc3; } } return dwHash; } #ce Greetz Greenhorn Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now