Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/19/2024 in all areas

  1. The problem has been solved, thank you very much to this friend. Danyfirex https://www.autoitscript.com/forum/profile/71248-danyfirex/ At the same time, share the code, and if there are other friends who need it, they can refer to and learn from it. Local $sSecret = "b8pW9XRUxIDdapjpLcjFte" Local $iTimeStamp= 1705638000 ConsoleWrite("HMAC-SHA256: " & @TAB & @TAB & _HashHMAC($sSecret,$iTimeStamp) & @CRLF) Func _HashHMAC($sSecret,$TimeStamp) Local $oHashHMACErrorHandler = ObjEvent("AutoIt.Error", "_HashHMACErrorHandler") Local $oHMAC = ObjCreate("System.Security.Cryptography.HMACSHA256") If @error Then SetError(1, 0, "") Local $sStrToSign =StringFormat("%s\n%s",$TimeStamp,$sSecret) $oHMAC.key = Binary($sStrToSign) Local $bHash = $oHMAC.ComputeHash_2(Binary("")) Return _Base64Encode($bHash) EndFunc ;==>_HashHMAC Func _Base64Encode($input) $input = Binary($input) Local $struct = DllStructCreate("byte[" & BinaryLen($input) & "]") DllStructSetData($struct, 1, $input) Local $strc = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($struct), _ "int", DllStructGetSize($struct), _ "int", 1, _ "ptr", 0, _ "ptr", DllStructGetPtr($strc)) If @error Or Not $a_Call[0] Then Return SetError(1, 0, "") ; error calculating the length of the buffer needed EndIf Local $a = DllStructCreate("char[" & DllStructGetData($strc, 1) & "]") $a_Call = DllCall("Crypt32.dll", "int", "CryptBinaryToString", _ "ptr", DllStructGetPtr($struct), _ "int", DllStructGetSize($struct), _ "int", 1, _ "ptr", DllStructGetPtr($a), _ "ptr", DllStructGetPtr($strc)) If @error Or Not $a_Call[0] Then Return SetError(2, 0, ""); error encoding EndIf Return DllStructGetData($a, 1) EndFunc ;==>_Base64Encode Func _HashHMACErrorHandler($oError) ;Dummy Error Handler EndFunc ;==>_HashHMACErrorHandler
    3 points
  2. This UDF isn't written by me nor do I ever use it, so any proposal for change that makes sense and is agreed upon by this community can be integrated.
    2 points
  3. I've ported some of the JavaScript 140 Bytes demos from dwitter.net to FreeBasic. Download AiO with 1000 examples (7-Zip archive): The beauty - magic of math Vol. 1 - 23 build 2024-01-14.7z (5.09 mb with source code and Windows x64 compiled executables) or have a look to my 1drive folder: _dwitter.net Some screenshots: ... Autoit is too slow for almost all of these examples. Happy watching.
    1 point
  4. #include <MsgBoxConstants.au3> HotKeySet("{ESC}", "HotKeyPressed") HotKeySet("+!d", "HotKeyPressed") ; Shift-Alt-d While 1 Sleep(100) WEnd Func HotKeyPressed() Switch @HotKeyPressed ; The last hotkey pressed. Case "{ESC}" ; String is the {ESC} hotkey. Exit Case "+!d" ; String is the Shift-Alt-d hotkey. HotKeySet("+!d") MsgBox($MB_SYSTEMMODAL, "", "This is a message.") HotKeySet("+!d", "HotKeyPressed") EndSwitch EndFunc ;==>HotKeyPressed
    1 point
  5. So far, the UDF specification has indicated that the syntax line should be wrapped. It was discussed in MVP forum because I sow how terrible it looked in very advanced UDFs (especially yours LibreOffice UDF) and considering that a lot has changed since this specification was introduced (18:33, 24 September 2012‎), I mean above all the quality and size of computer monitors solves the problem of the need to wrap text but also including AutoIt.chm for which this specification was prepared. As the last unrebutted arguments (in MVP discussion) were for removing this restriction, and considering that 2 months have passed since that discussion and nothing new has been contributed, as a result I have just made a change: https://www.autoitscript.com/w/index.php?title=UDF-spec&curid=2813&diff=14883&oldid=14099 Current version you can see here: https://www.autoitscript.com/wiki/UDF-spec
    1 point
  6. No voting needed as far as i am concerned, just post the changed code here so people can respond in case they want. I will gladly update the file after.
    1 point
  7. Hi, After application installation on x64bit machine, AutoIT adding unquoted path in uninstallation string, this is threaten as vulnerability - even tho, there is no issues with uninstallation, but this unquoting generate reports in vulnerability scanners like nessus. Here is the link to MS description: Microsoft Windows Unquoted Path Vulnerability | Mageni It will be nice to fix this in newer version of application. Thanks
    1 point
  8. #include <SendMessage.au3> Local $WM_SYSCOMMAND = 0x0112 Local $SC_MINIMIZE = 0xF020 Send('#=') WinWait('Magnifier') Sleep(2000) _SendMessage(WinGetHandle('Magnifier'), $WM_SYSCOMMAND, $SC_MINIMIZE, 0)
    1 point
×
×
  • Create New...