SomeoneHere Posted September 17, 2009 Share Posted September 17, 2009 (edited) sup everyone... ok so i found this site . . . http://www.cryptosys.net/manapi/api_BLF_BytesMode.html and i'm trying to do that sample encryption in AutoIt, but i'm not getting the same results . . . $dll = DllOpen("diCryptoSys.dll") MsgBox(0,"",$dll) $strInput = "0123456789ABCDEF" $strKey = "FEDCBA9876543210" $sCorrect = "0ACEAB0FC6A0A28D" ; Set strOutput to be same length as strInput $strOutput = String(StringLen($strInput)) ConsoleWrite("KY= " & $strKey & @CR) ConsoleWrite("PT= " & $strInput & @CR) ; Encrypt in one-off process $nRet = DllCall($dll, "long", "BLF_Hex", "String", $strOutput, "String", $strInput, "String", $strKey, "Boolean", True) ConsoleWrite("CT= " & $strOutput & @CR) ConsoleWrite("OK= " & $sCorrect & @CR) ; Now decrypt back to plain text $strInput = $strOutput $nRet = DllCall($dll, "long", "BLF_Hex", "String", $strOutput, "String", $strInput, "String", $strKey, "Boo", False) ConsoleWrite("P'= " & $strOutput & @CR) the results i get are... KY= FEDCBA9876543210 PT= 0123456789ABCDEF CT= 16 OK= 0ACEAB0FC6A0A28D P'= 16 i'm not sure what the problem is... i put the diCryptoSys.dll in the same folder . . . Edited September 17, 2009 by SomeoneHere Link to comment Share on other sites More sharing options...
dantay9 Posted September 17, 2009 Share Posted September 17, 2009 (edited) If i'm not mistaken, DllOpen("diCryptoSys.dll") refers to "C:\Windows\System32\diCryptoSys.dll". Try putting in the full path of the dll (@ScriptDir & "\diCryptoSys.dll"). Edited September 17, 2009 by dantay9 Link to comment Share on other sites More sharing options...
SomeoneHere Posted September 17, 2009 Author Share Posted September 17, 2009 If i'm not mistaken, DllOpen("diCryptoSys.dll") refers to "C:\Windows\System32\diCryptoSys.dll". Try putting in the full path of the dll (@ScriptDir & "\diCryptoSys.dll").the problem isn't that it doesn't find the DLL (i checked it returns a value of 1)... it's somethine else which i don't know Link to comment Share on other sites More sharing options...
trancexx Posted September 17, 2009 Share Posted September 17, 2009 the problem isn't that it doesn't find the DLL (i checked it returns a value of 1)... it's somethine else which i don't knowDid you write the code from the first post? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
SomeoneHere Posted September 18, 2009 Author Share Posted September 18, 2009 Did you write the code from the first post?yes, it was my attempt at converting VB6 to AutoIt... which i "think" there's no errors in, or at least can't find it? Link to comment Share on other sites More sharing options...
trancexx Posted September 18, 2009 Share Posted September 18, 2009 (edited) yes, it was my attempt at converting VB6 to AutoIt... which i "think" there's no errors in, or at least can't find it? Try this: $hDLL = DllOpen("diCryptoSys.dll") $sInput = "0123456789ABCDEF" $sKey = "FEDCBA9876543210" $sCorrect = "0ACEAB0FC6A0A28D" ConsoleWrite("KY= " & $sKey & @CRLF) ConsoleWrite("PT= " & $sInput & @CRLF) $aCall = DllCall($hDLL, "int", "BLF_Hex", "str", "", "str", $sInput, "str", $sKey, "int", 1) ; ...check for errors here... $sOutput = $aCall[1] ConsoleWrite("CT= " & $sOutput & @CRLF) ConsoleWrite("OK= " & $sCorrect & @CRLF) $sInput = $sOutput $aCall = DllCall($hDLL, "int", "BLF_Hex", "str", "", "str", $sInput, "str", $sKey, "int", 0) ; ...check for errors here... ConsoleWrite("P'= " & $aCall[1] & @CRLF) Edited September 18, 2009 by trancexx ♡♡♡ . eMyvnE 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