crackdonalds Posted February 25, 2022 Share Posted February 25, 2022 (edited) The code below gives different output for the first and second consolewrite. I would expect them to be the same. anyone know why? #include <crypt.au3> Global $trash = _Crypt_DecryptData("0x79C031100AB21FCCA613C0ECBCDF498E", "A3D2E1F021BB095", $CALG_AES_256) ConsoleWrite($trash) funcy() func funcy() ConsoleWrite(@crlf & $trash) EndFunc Edited February 25, 2022 by Melba23 Amended title Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2022 Moderators Share Posted February 25, 2022 crackdonalds, Nothing to do with the Crypt library. The return value from _Crypt_DecryptData is binary and should be converted to a string before being written to the console. It would seem that for some reason ConsoleWrite is being extra-nice in the first call and doing the translation for you - even though the Help file says: Quote Binary data is written as-is. It will not be converted to a string. To print the hex representation of binary data, use the String() function to explicitly cast the data to a string. If you do the conversion explicitly you do get matching returns: #include <crypt.au3> Global $trash = _Crypt_DecryptData("0x79C031100AB21FCCA613C0ECBCDF498E", "A3D2E1F021BB095", $CALG_AES_256) ConsoleWrite(BinaryToString($trash) & @CRLF) funcy() func funcy() ConsoleWrite(BinaryToString($trash) & @CRLF) EndFunc M23 crackdonalds 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
crackdonalds Posted February 25, 2022 Author Share Posted February 25, 2022 Thanks. I thought remembering i had to do a step extra. consolewrite got on the the wrong path then so yea, its mostly just a little weirdness indeed. thx again. 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