-
Posts
215 -
Joined
-
Last visited
Everything posted by everseeker
-
Nah, it should be MUCH more direct... Perhaps an imp that pops out of the screen , smacks me on the side of my head, and points to the sticky...
-
Awww.... the code is gone
-
Fun(not) with Hashing (sha256)
everseeker replied to everseeker's topic in AutoIt General Help and Support
OK, all my prayers have been answered I have been able to use the above, in combination, to successfully create hashes for my API. Don't know what the issue is with Base64DECODE (Get a system error) but no matter... All I need to do is Encode, and that part is golden! -
Base64 Machine Code Functions + Source
everseeker replied to Beege's topic in AutoIt Example Scripts
Changed to a snippet of text. New code: #AutoIt3Wrapper_UseX64=n #include <b64.au3> ;Test to verify data encoded gets decoded back properly $sText = "qwertyuiopasdfghjklzxcvbnm" $sText = $sText & $sText & $sText ConsoleWrite(StringLen($sText) & " - " & $sText & @LF) $sEncoded = _B64Encode($sText) ConsoleWrite($sEncoded & @CRLF) $sDecoded = _B64Decode($sEncoded) $sDecoded = BinaryToString($sDecoded) ConsoleWrite($sDecoded & @CRLF) ConsoleWrite(StringLen($sDecoded) & @LF) If StringCompare($sText, $sDecoded) = 0 Then ConsoleWrite('Strings are Equal' & @LF & @LF) Else ConsoleWrite('Strings NOT Equal!!' & @LF & @LF) EndIf ConsoleWrite(StringLen($sText) & @LF) $sEncoded = _Base64Encode_MS($sText) $sDecoded = _Base64Decode_MS($sEncoded) $sDecoded = BinaryToString($sDecoded) ConsoleWrite(StringLen($sDecoded) & @LF) If StringCompare($sText, $sDecoded) = 0 Then ConsoleWrite('Strings are Equal' & @LF & @LF) Else ConsoleWrite('Strings NOT Equal!!' & @LF & @LF) EndIf ;Test time Local $timeencode, $timeencodems, $timedecode, $timedecodems, $iLoops = 10 For $i = 1 To $iLoops $time = TimerInit() $sEncode = _B64Encode($sText) $diff = TimerDiff($time) $timeencode += $diff ConsoleWrite('>_B64Encode = ' & @TAB & @TAB & $diff & @LF) $time = TimerInit() $sEncodeMS = _Base64Encode_MS($sText) $diff = TimerDiff($time) $timeencodems += $diff ConsoleWrite('_Base64Encode_MS = ' & @TAB & $diff & @LF & @LF) $time = TimerInit() $sDecode = _B64Decode($sEncode) $diff = TimerDiff($time) $timedecode += $diff ConsoleWrite('>_B64Decode = ' & @TAB & @TAB & $diff & @LF) $time = TimerInit() $sDecodeMS = _Base64Decode_MS($sEncodeMS) $diff = TimerDiff($time) $timedecodems += $diff ConsoleWrite('_Base64Decode_MS = ' & @TAB & $diff & @LF & @LF) Next ConsoleWrite('>_B64Encode avg = ' & @TAB & $timeencode / $iLoops & @LF) ConsoleWrite('_Base64Encode_MS avg = ' & @TAB & $timeencodems / $iLoops & @LF) ConsoleWrite('>_B64Decode avg = ' & @TAB & $timedecode / $iLoops & @LF) ConsoleWrite('_Base64Decode_MS avg = ' & @TAB & $timedecodems / $iLoops & @LF) Func _Base64Encode_MS($Binary, $iFlags = 0x40000001) $Binary = Binary($Binary) Local $tByteArray = DllStructCreate('byte[' & BinaryLen($Binary) & ']') DllStructSetData($tByteArray, 1, $Binary) Local $aSize = DllCall("Crypt32.dll", "bool", 'CryptBinaryToString', 'struct*', $tByteArray, 'dword', BinaryLen($Binary), 'dword', $iFlags, 'str', Null, 'dword*', Null) Local $tOutput = DllStructCreate('char[' & $aSize[5] & ']') Local $aEncode = DllCall("Crypt32.dll", "bool", 'CryptBinaryToString', 'struct*', $tByteArray, 'dword', $aSize[2], 'dword', $iFlags, 'struct*', $tOutput, 'dword*', $aSize[5]) If @error Or (Not $aEncode[0]) Then Return SetError(1, 0, 0) Return DllStructGetData($tOutput, 1) EndFunc ;==>_Base64Encode_MS Func _Base64Decode_MS($input_string) Local $tInput = DllStructCreate('char[' & StringLen($input_string) + 1 & ']') DllStructSetData($tInput, 1, $input_string & 0) Local $aSize = DllCall("Crypt32.dll", "bool", "CryptStringToBinary", "struct*", $tInput, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) Local $tDecoded = DllStructCreate("byte[" & $aSize[5] & "]") Local $aDecode = DllCall("Crypt32.dll", "bool", "CryptStringToBinary", "struct*", $tInput, "dword", 0, "dword", 1, "struct*", $tDecoded, "dword*", $aSize[5], "ptr", 0, "ptr", 0) If Not $aDecode[0] Or @error Then Return SetError(1, 0, 0) Return DllStructGetData($tDecoded, 1) EndFunc ;==>_Base64Decode_MS >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\Everseeker\Documents\AutoIT3\Projects\6Connect\b64 Tests.au3" /UserParams +>16:43:13 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0 Keyboard:00000409 OS:WIN_81/ CPU:X64 OS:X64 Environment(Language:0409) +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\Everseeker\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\Everseeker\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\Everseeker\Documents\AutoIT3\Projects\6Connect\b64 Tests.au3 +>16:43:13 AU3Check ended.rc:0 >Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Everseeker\Documents\AutoIT3\Projects\6Connect\b64 Tests.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop 78 - qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm cXdlcnR5dWlvcGFzZGZnaGprbHp4Y3Zibm1xd2VydHl1aW9wYXNkZmdoamtsenhjdmJubXF3ZXJ0eXVpb3Bhc2RmZ2hqa2x6eGN2Ym5t !>16:43:13 AutoIt3.exe ended.rc:-1073741819 +>16:43:13 AutoIt3Wrapper Finished. >Exit code: 3221225477 Time: 0.9627 But same outcome... -
Base64 Machine Code Functions + Source
everseeker replied to Beege's topic in AutoIt Example Scripts
OK, After 1. correcting my serious blunder (On comp with old version...) 2. Modifying input to take a smaller file $sFile = FileRead("Instructions.txt") 3. adding a few more consoleWrites... ConsoleWrite(StringLen($sFile) & @LF) $sEncoded = _B64Encode($sFile) ConsoleWrite($sEncoded & @CRLF) $sDecoded = _B64Decode($sEncoded) $sDecoded = BinaryToString($sDecoded) ConsoleWrite($sDecoded & @CRLF) I get this: 8568 SGVsbG8gUGF0cmljay4gIFRoZSBuZXh0IHN0ZXAgaW4gdGhlICJVbmljb3JuIFRhbWVyL1FBIEVuZ2luZWVyIiBzZWxlY3Rpb24gcHJvY2VzcyBpcyBhIHNpbXBsZSB0ZXN0IG9mIHlvdXIgbWV0dGxlLiAgQWxzbyAtIHdlIGxpa2VkIHlvdXIgcmVzcG9u <SNIPPED> !>16:34:27 AutoIt3.exe ended.rc:-1073741819 So, looks like encode may work, but it dies on decode -
Fun(not) with Hashing (sha256)
everseeker replied to everseeker's topic in AutoIt General Help and Support
OK. The first part looks like it works now. THanks. This is what I did: #include <Crypt.au3> Global Const $CALG_SHA_256 = 0x0000800c Func sha256($message) Return _Crypt_HashData($message, $CALG_SHA_256) EndFunc Func hmac($key, $message, $hash="sha256") Local $blocksize = 64 Local $a_opad[$blocksize], $a_ipad[$blocksize] Local Const $oconst = 0x5C, $iconst = 0x36 Local $opad = Binary(''), $ipad = Binary('') $key = Binary($key) If BinaryLen($key) > $blocksize Then $key = Call($hash, $key) For $i = 1 To BinaryLen($key) $a_ipad[$i-1] = Number(BinaryMid($key, $i, 1)) $a_opad[$i-1] = Number(BinaryMid($key, $i, 1)) Next For $i = 0 To $blocksize - 1 $a_opad[$i] = BitXOR($a_opad[$i], $oconst) $a_ipad[$i] = BitXOR($a_ipad[$i], $iconst) Next For $i = 0 To $blocksize - 1 $ipad &= Binary('0x' & Hex($a_ipad[$i],2)) $opad &= Binary('0x' & Hex($a_opad[$i],2)) Next Return Call($hash, $opad & Call($hash, $ipad & Binary($message))) EndFunc ConsoleWrite(hmac("key", "the", "sha256") & @CRLF) Hope that is working (LOOKS like it is, but I have no pre-post data) -
Fun(not) with Hashing (sha256)
everseeker replied to everseeker's topic in AutoIt General Help and Support
I just updated this install 2 days ago... I HAVE the latest.... let me look... ummmm JAW Drops... 3.3.8.1..... #$#@&^**#^&@@!#*&#@% Pulled the new installer, EXECUTED the old installer.... D'Oh! will get back after I confirm it is ALL in my head..... -
Is there a COMPLETED UDF for this anywhere?
-
Fun(not) with Hashing (sha256)
everseeker replied to everseeker's topic in AutoIt General Help and Support
The above implementations all miss the mark slightly. HMAC only works with MD5 and SHA1, I need SHA256 I tried to somehow get the SHA224_256.au3 functions to work, but I only succeeded in making a mess... The Base64Encode/Decode link ... well... it points to a very old "Work in progress" that devolves into a C discussion... I found another one (B64) only problem is, despite the fact that everyone is saying it's Da Bomb.... it has syntax errors that stop it in its tracks. Local $aRet = DllCallAddress('uint', DllStructGetPtr($tMem), 'struct*', $tRevIndex, 'struct*', $tSource, 'struct*', $tOutput, 'uint', (@AutoItX64 ? $iLen : $iLen / 4)) And the demo file has this: Local $aSize = DllCall("Crypt32.dll", "bool", 'CryptBinaryToString', 'struct*', $tByteArray, 'dword', BinaryLen($Binary), 'dword', $iFlags, 'str', Null, 'dword*', Null) Null huh... (Not even getting to the need for an Input file, with no info on the CONTENT requirements of this file) -
Base64 Machine Code Functions + Source
everseeker replied to Beege's topic in AutoIt Example Scripts
Downloaded the file, placed it in my local directory Executed the test (touched nothing) Got This: C:\Users\Everseeker\Documents\AutoIT3\Projects\6Connect\b64.au3(36,148) : ERROR: syntax error (illegal character) Local $aRet = DllCallAddress('uint', DllStructGetPtr($tMem), 'struct*', $tRevIndex, 'struct*', $tSource, 'struct*', $tOutput, 'uint', (@AutoItX64 ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Everseeker\Documents\AutoIT3\Projects\6Connect\b64.au3(36,150) : ERROR: unbalanced paranthesis expression. Local $aRet = DllCallAddress('uint', DllStructGetPtr($tMem), 'struct*', $tRevIndex, 'struct*', $tSource, 'struct*', $tOutput, 'uint', (@AutoItX64 ? $iLen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Everseeker\Documents\AutoIT3\Projects\6Connect\b64.au3(36,168) : ERROR: syntax error (illegal character) Local $aRet = DllCallAddress('uint', DllStructGetPtr($tMem), 'struct*', $tRevIndex, 'struct*', $tSource, 'struct*', $tOutput, 'uint', (@AutoItX64 ? $iLen : $iLen / 4)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Everseeker\Documents\AutoIT3\Projects\6Connect\b64 Tests.au3(70,153) : ERROR: syntax error Local $aSize = DllCall("Crypt32.dll", "bool", 'CryptBinaryToString', 'struct*', $tByteArray, 'dword', BinaryLen($Binary), 'dword', $iFlags, 'str', Null, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Everseeker\Documents\AutoIT3\Projects\6Connect\b64 Tests.au3(70,169) : ERROR: syntax error Local $aSize = DllCall("Crypt32.dll", "bool", 'CryptBinaryToString', 'struct*', $tByteArray, 'dword', BinaryLen($Binary), 'dword', $iFlags, 'str', Null, 'dword*', Null) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Everseeker\Documents\AutoIT3\Projects\6Connect\b64 Tests.au3 - 5 error(s), 0 warning(s) !>14:56:56 AU3Check ended.rc:2 thoughts? -
Amending the FAQ in the help file.
everseeker replied to guinness's topic in AutoIt General Help and Support
I kid... Been with it since 2004, when it was still just a wee baby. -
OK, I have to access an API. The Instructions are for PHP... Don't know PHP... This poses a problem. Here's the part I need a wee bit of help with: This gives me 2 functions to find/craft 1. Base64_Encode 2. Hash_Hmac For the Base64Encode part, I found this: ?do=embed' frameborder='0' data-embedContent> looks like it was circa 2008 an , judging by the comments in the thread, may not be stable on Win8.x Is there a more stable way to do a Base64 Encode? And, I think I am totally stumped on the second. (There IS a Crypt UDF, but I have no idea if $bHash = _Crypt_HashData("target=ipam&action=get&type=IP&mask=24&apiKey=32-5DAYTJQY2TZHOFOB", "48b278ec873bda4738923dbc467f8669", $CALG_SHA1) will do what I want) (edit to comment : nope, I think crypt hash data is a no go... No way to add the secret key...)
-
Amending the FAQ in the help file.
everseeker replied to guinness's topic in AutoIt General Help and Support
Q: is there any support for directed branching or calling procedures at all? Inserting tons of flags to control flow is wasteful and tedious A: NO. The developers heard, way back in CS101 that goto was evil and took it to heart. They have gone to extraordinary lengths to prevent directed branching. Since procedures could be used for this, that too was placed on the scrap file. -
Are my AutoIt exes really infected?
everseeker replied to JSThePatriot's topic in AutoIt General Help and Support
This only works if you have positive control of your work product. If you are say, writing code that you compile and distribute within your organization, it is not fun to get 163 messages from assorted peeps saying "zoikes, that cool desktop wigit you wrote has been infected by a mean old nasty virus!" In any event, it's not autoit, it's the av company that needs to be alerted -
Ummm... Is that a comment, complement, or request???
-
How do I scroll to the top of a browser (IE)
everseeker replied to Dazzler's topic in AutoIt GUI Help and Support
Teach a developer how to fish and you'll empty the ocean..... -
I have been working with Koda for quite a while. I have become ...used to... some of the quirks. However, I am currently designing a seriously detailed GUI with it and am wondering if some of the problems I am having can be ...fixed... by doing things differently perhaps. My main issues are: 1. Create GUI... Lots of buttons... 2. Use it for a week 3. See an issue. Load KODA, Import the AutoIT code containing the GUI 4. Koda "Sees" and loads the code... almost fine. except 1. All bozes, on all tabbed pages, is 15 pixels high & 15 pixels to the right. I have to pull everything "back" to where it needs to be.... 2. Koda does NOT like GUICtrlSetState(-1, $GUI_DISABLE) not only does it grumble, it then deletes the line! 3. Koda, in reading/importing, does NOT retain the control lines { Example: GUICtrlSetOnEvent(-1, "Btn_AutoBallastDisarmClick") }I have to reset them, every time So... If I could figure out why the shift happens... And how to get Koda to KEEP code it does not "recognize"... I would be much more comfortable with it --- Had another problem with "keeping" check boxes in s group... That was solved when I realized that the group is "done" if any checkbox is positioned "above" a preceeding one. So, If you place boxes in a control in this order: {1 2 3 5 4} when imported, you will have {1 2 3} 5 4 and then you need to go find the GUICtrlCreateGroup("", -99, -99, 1, 1) and reposition it by hand... That's the kind of thing that is simple to solve... once you figure out what's "happening"
-
I need to reset the Zoom level to 100% before loading a web page. I am unable to pass keys into this particular page, so the Cntl-* trick will not work. is there anything else?
-
I have a large number of QTP 11 scripts with AutoIT3 GUI front ends that report out to Excel tables I create "on-the-fly" Our company recently upgraded to Office 2010... Turns out, this is a BAD thing... for me. Now, If I save a .xls file with the following: $sOutFilePath = $TestPath & "Output\Output" & StringRight(@YEAR & @MON & @MDAY, 6) & ".xls" ;See if that exists. If so, great... use it. If not, make a new file $oExcel = _ExcelBookOpen($sOutFilePath, 0) If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then $oExcel = _ExcelBookNew(0) ;add new header _ExcelWriteCell($oExcel, "Date&Time", 2, 1) $oExcel.Activesheet.Columns(1).ColumnWidth = 15 _ExcelWriteCell($oExcel, "Script", 2, 2) $oExcel.Activesheet.Columns(2).ColumnWidth = 55 _ExcelWriteCell($oExcel, "Iteration", 2, 3) $oExcel.Activesheet.Columns(3).ColumnWidth = 9 _ExcelWriteCell($oExcel, "Step", 2, 4) $oExcel.Activesheet.Columns(4).ColumnWidth = 5 _ExcelWriteCell($oExcel, "Pass/Fail", 2, 5) $oExcel.Activesheet.Columns(5).ColumnWidth = 9 _ExcelWriteCell($oExcel, "Notes", 2, 6) $oExcel.Activesheet.Columns(6).ColumnWidth = 85 $oExcel.ActiveWorkbook.Sheets(1).Range("A2:F2" ).Interior.Color = 0xE29F69 ;Save the new book, so it is ready to use _ExcelBookSaveAs($oExcel, $TestPath & "Output\Output" & StringRight(@YEAR & @MON & @MDAY, 6), "xls") EndIf _ExcelBookClose($oExcel, 1)all LOOKS fine... The file is created until the file is opened by QTP, where I get a compatibility popup... which hangs QTP According to THEM, I can solve this by providing .xlsx files to QTP, However, looks like all AutoIT3 can handle is: Excel writable filetype string = "xls|csv|txt|template|html", default "xls" My questions are: 1. Is there a way to work with .XLSx files in Autoit3? 2. What is the "Template" filetype ? (Excel writable filetype string = "xls|csv|txt|template|html", default "xls"
-
I think this has been answered, but I am not allowed to SEARCH for info on color so... When I look at an RGB value in most programs say something like Visual Color Picker, I work with Hex values of RR GG BB (RGB!) When I use $oExcel.ActiveWorkbook.Sheets(1).Range("E" & $j + 1 & ":E" & $j + 1) .Interior.Color = 0x0000FF I get BB GG RR (BGR?) When I use $nColor = _ColorSetRGB( $aColor ) I get RR BB GG (RBG?) Why the variations? (The last is actually from the help topic for _ColorSetRGB)
-
How do I add Color to an excel range
everseeker replied to everseeker's topic in AutoIt General Help and Support
Perfect! Thanks! (WHY on earth is "COLOR" a banned word?) After all, the world is not simply black and white. Sometimes, there's a little blue in the mix -
Yes, I assume that this has been asked and answered. HOWEVER, the Search function does me a favor by removing the word COLOR from my search string... Gee, thanks! So I need to create a new excel file, fill it with bundles of data, then go back and color different lines different colors, based on the info on each line.. (for example, say ... if the first cell is blank, color the entire line with a red background, else color it green)
-
Having a wee problem with List Boxes
everseeker replied to everseeker's topic in AutoIt GUI Help and Support
OK. I was using the Koda help file... (Might be a nice enhancement to have that one "point" to the master help file to indicate that there's more on the topic, huh ) Anyway, thanks all (Wish I could change the topic to add "Solved" )