Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/03/2015 in all areas

  1. HotKeySet("{F1}","_SPACE") While 1 Sleep(30) WEnd Func _SPACE() Send("{SPACE}") EndFunc; _SPACEHotKeySet and _IsPressed are two diferent things; Hotkeyset interrups scrips and execute the specified function _IsPressed you get the state of the key, true = is pressed, false = is not pressed, then you need verify in a loop the state of the key to do something And also, _isPressed need include Misc, hotkeyset not need any include
    1 point
  2. No, because a function cannot be called {SPACE}, "{" is an illegal character. Re-read the help file for HotkeySet.
    1 point
  3. If $USBPlugged HotKeySet("Key", "Function") Else HotKeySet("Key") EndIf However you script it, the idea is just call HotKeySet again without giving a function.
    1 point
  4. If you look at that there are multiple ways to specify, he is using the "name" of the device. You can find the VID/PID in Win32_PNPEntity and I am sure you can cross reference this list to the one in the script.
    1 point
  5. wakillon

    StringFinder v1.2.3

    I hate the Microsoft Windows search. After trying the powerfull "Agent Ransack", i said to myself ; why not create a free alternative in AutoIt ? StringFinder replace my old TinyAu3FilesSearch utility and will be added to the next version of SciTE Hopper Unlike to TinyAu3FileSearch, you can search strings in any "Text" files. Source and compiled Version are available in the Download Section. Enjoy !
    1 point
  6. wakillon

    StringFinder v1.2.3

    Thanks to share this profound reflection.
    1 point
  7. gottygolly, I do not see why it should - ControlIDs to not vary unless you delete and recreate the associated control. This works just fine: #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $hGUI = GUICreate("Test", 500, 500) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") For $i = 0 To 9 GUICtrlCreateLabel("", 10, 10 + (30 * $i), 200, 20) GUICtrlSetBkColor(-1, 0xCCFFCC) GUICtrlSetOnEvent(-1, "_Click") Next GUISetState() While 1 Sleep(10) WEnd Func _Click() $cCID = @GUI_CtrlId GUICtrlSetBkColor($cCID, 0xFFCCCC) EndFunc Func _Exit() Exit EndFuncM23
    1 point
  8. The only thing you are buying is time, and time is cheap. Does it matter if it takes the attacker 65 years to break it if you only need it locked down for .65 seconds? RC4 is still used widely because things like compatibility and CPU overhead matter more than enhancing the encryption. So endgame and sensitivity matter. The US Government uses ONLY unpublished algorithms for Compartmentalized TS and Suite A communications. And if the government gets it's shit from the right, and tells the people to get their shit from the left, the people should tell the government to gtfo. And experts/authors question the contest and results, so much so that some very smart security-minded folk are also going Two/ThreeFish. https://threatpost.com/silent-circle-moving-away-from-nist-ciphers-in-wake-of-nsa-revelations/102452/
    1 point
  9. Rainbow tables typically deal with hashing algorithms, not encryption. They are generated by producing all possible hashes using a character set definition (alphanum, special char, and length) in a brute-force manner. Still, yes...there are other cryptanalysis findings for DES, RC and AES, but nothing that completely breaks the algorithms, rendering them insecure. AutoIt supports Triple-DES, AES128, AES192 and AES256. I'd say any of those are reasonably safe to use.
    1 point
  10. ? #include <date.au3> Run("notepad.exe") $hNotepad = WinWaitActive("[CLASS:Notepad]", "") For $iYear = 2016 To 2018 For $iMonth = 1 To 12 For $iDay = 1 To 31 If _DateIsValid($iYear & "/" & $iMonth & "/" & $iDay) Then ; $sDate = StringFormat("%02s", $iDay) & " " & _DateToMonth($iMonth) & " " & $iYear & _ " (" & _DateDayOfWeek(_DateToDayOfWeek($iYear, $iMonth, $iDay)) & ")" & @CR ControlSend($hNotepad, "", "Edit1", $sDate) ; EndIf Next Next Next
    1 point
  11. You may be right. I've thought Twofish is safer because its rainbow tables haven't been cracked yet. I don't protect classified information but I always want best of everything. AES 128 seems like the safest algorithm on AutoIt and it has 2^126 complexity for now. Should I use this?
    1 point
  12. Every encryption can be cracked that way. The problem is that the rainbow tables needed for cracking AES needs more storage space than the entire internet currently has available. You're worried over nothing. Also what makes Twofish any better in this?
    1 point
  13. I would echo what BrewMan said...but I am curious... Can you elaborate?
    1 point
  14. AES Rijndael is the standard, Twofish was one of the contenders for AES but lost out to Rijndael, so I'd be looking at the standard rather than the runner up myself.
    1 point
  15. Take a look at this post. The optimizations in this post are based on sorted arrays where you search the rows with a binary search algorithm. If your data can be sorted in the same way, so that it's possible to use binary search, your For-loops can be very optimized. If your arrays can be properly sorted it should be possible to reduce the 11 hours to a few minutes. If it's possible for you to produce some test data with about 5% of the amount of rows, then I'll try to optimize the For-loops. It's important that the test data are relatively realistic in terms of sorting options.
    1 point
  16. I haven't used SQLite myself. But I would think it a more efficient tool than scanning arrays by hand. Once you figure out how to import the excel data into the SQLite database you could run queries to generate the reports instead of rolling your own. I would search for any SQLite examples esp. involving excel.
    1 point
  17. I suggest something like this: ;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Global $aText[] = ["01_TextFile", "02_TextFile", "03_TextFile"] Global $aFound[UBound($aText)] ; Table with a flag (True) for each found file Global $iFound = 0 ; Counter for found files Global $sDirforTxtFiles = "C:\Temp\" $sUsername = @UserName ; Pulls username that is logged in ;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ ; SCRIPT START For $i = 0 To UBound($aText) - 1 $hTextFile = FileOpen($sDirforTxtFiles & $aText[$i] & ".txt", 0) $sReadText = FileRead($hTextFile) FileClose($hTextFile) If StringRegExp($sReadText, $sUsername) Then $iFound = $iFound + 1 ; Update counter $aFound[$i] = True ; Set found flag for this file EndIf Next If $iFound = 0 Then FoundNone() ; No file found If $iFound = 1 Then FoundOne() ; One file found If $iFound > 1 Then FoundMany() ; More than one file foun Func FoundNone() MsgBox(0, "", "USER NOT IN ANY TEXTFILE") EndFunc ;==>FoundNone Func FoundOne() MsgBox(0, "USER FOUND", "In following textfile: " & $aText[$i]) EndFunc ;==>FoundOne Func FoundMany() Local $sFoundFiles For $i = 1 To UBound($aFound) - 1 If $aFound[$i] = True Then $sFoundFiles = $sFoundFiles & $aText[$i] & @CRLF Next MsgBox(0, "", "USER FOUND IN " & $iFound & " FILES:" & @CRLF & @CRLF & $sFoundFiles) EndFunc ;==>FoundMany
    1 point
  18. The values of @error for each function are described in the help file.
    1 point
  19. Or try something like this (you'll have to adjust positioning, there seems to be an kind of border/offset in the control, was too lazy for that )... #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> gui_1(); ;If I do not use the $ WS_EX_COMPOSITED flashes the label. Func gui_1() Local $Form1 = GUICreate("Form1", 194, 137, 414, 452) Local $pic = GUICtrlCreatePic(_background(True), 0, 0, 194, 137) Local $Label1 = GUICtrlCreateInput("100", 0, 0, 194, 137, $ES_READONLY, $WS_EX_TRANSPARENT) GUICtrlSetColor(-1, 0xffffff) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetFont(-1, 70, 800, 0, "Arial Black") GUISetState(@SW_SHOW) For $i = 100 To 200 Sleep(20) GUICtrlSetData($Label1, $i) Next EndFunc ;==>gui_1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ; #INDEX# ======================================================================================================================= ; Title .........: _background() ; AutoIt Version.: 3.3.8.1 ; Language.......: Português (Brasil) - 0416(PTB) ; Description ...: Compressed file embedded ; Author ........: BELINI ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ; _background() ; =============================================================================================================================== ; #INTERNAL_USE_ONLY# =========================================================================================================== ; __background() ; _LZNTDecompress renamed! ; __backgroundB64() ; _Base64 renamed! ; =============================================================================================================================== ; #VARIABLES# =================================================================================================================== ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name ..........: _background() ; Description ...: Compressed file embedded in your .au3 file ; Syntax ........: _background( [ lToSave [, sPath [, lExecute ]]] ) ; Parameters ....: lToSave - [optional] If True, save the file, else, return binary data. Default is False. ; sPath - [optional] The path of the file to be save. Default is @TempDir ; lExecute - [optional] Flag to execute file saved. Default is False ; Return values .: Success - Returns decompressed fundo.bmp binary data or saved. ; Failure - Returns 0 and set @error to 1. ; Author(s) .....: João Carlos (Jscript FROM Brazil) ; Modified ......: ; Remarks .......: This function uses _LZNTDecompress() and _Base64Decode() by trancexx. ; Related .......: ; Link ..........: ; Example .......; _background() ; =============================================================================================================================== Func _background($lToSave = False, $sPath = @TempDir, $lExecute = False) Local $hFileHwnd, $bData, $sFileName = $sPath & "\fundo.bmp" ; Original: D:\JukeBel\00 Arquivos úteis\fundo.bmp $bData = "LrGgQk0cDQACADYAUIooADAhBBgBABgASAAAAOYMAAASC8cDDAJAAhD/AABdCF5g/wDA/2Nncf9KXxD/GP8Yf7b/QMinVXYK/0r/Sn8lfww/BP9fJP0Qfwx/DH8MPQR/DH8M/38Mfx37EP8H/xj/GP8Y/xD//xg/Ff8Q+RB/FD8QPRB/DP9/DH8MHwIfAR8BHwEfARUB/38MHwEfAR8BHwEXAb8BHwH/HwEfAR8BFwG/AR8BHwEfAf8fARcBvwEfAR8BHwEfARcB/78BHwEfAR8BHwEXAb8BHwH/HwEfAR8BFwG/AR8BHwEfAf8fARcBvwEfAR8BHwEfARcB/78BHwEfAR8BHwEXAb8BHwH/HwEfAR8BFwG/AR8BHwEfAf8fARcBvwEfAR8BHwEfARcBAAA=" If $lToSave Then $hFileHwnd = FileOpen($sFileName, 10) If @error Then Return SetError(1, 0, 0) FileWrite($hFileHwnd, __background(__backgroundB64($bData))) FileClose($hFileHwnd) If $lExecute Then RunWait($sFileName, "") FileDelete($sFileName) Return 1 EndIf If FileExists($sFileName) Then Return $sFileName Else Return __background(__backgroundB64($bData)) EndIf Return SetError(1, 0, 0) EndFunc ;==>_background ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __backgroundB64 ; Description ...: Base64 decode input data. ; Syntax.........: __backgroundB64($bBinary) ; Parameters ....: $sInput - String data to decode ; Return values .: Success - Returns decode binary data. ; - Sets @error to 0 ; Failure - Returns empty string and sets @error: ; |1 - Error calculating the length of the buffer needed. ; |2 - Error decoding. ; Author ........: trancexx ; Modified ......: João Carlos (Jscript FROM Brazil) ; Related .......: _Base64Encode() ; =============================================================================================================================== Func __backgroundB64($sInput) Local $struct = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _ "str", $sInput, _ "int", 0, _ "int", 1, _ "ptr", 0, _ "ptr", DllStructGetPtr($struct, 1), _ "ptr", 0, _ "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(1, 0, "") ; error calculating the length of the buffer needed EndIf Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]") $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _ "str", $sInput, _ "int", 0, _ "int", 1, _ "ptr", DllStructGetPtr($a), _ "ptr", DllStructGetPtr($struct, 1), _ "ptr", 0, _ "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(2, 0, ""); error decoding EndIf Return DllStructGetData($a, 1) EndFunc ;==>__backgroundB64 ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __background ; Original Name..: _LZNTDecompress ; Description ...: Decompresses input data. ; Syntax.........: __background($bBinary) ; Parameters ....: $vInput - Binary data to decompress. ; Return values .: Success - Returns decompressed binary data. ; - Sets @error to 0 ; Failure - Returns empty string and sets @error: ; |1 - Error decompressing. ; Author ........: trancexx ; Related .......: _LZNTCompress ; Link ..........; http://msdn.microsoft.com/en-us/library/bb981784.aspx ; =============================================================================================================================== Func __background($bBinary) $bBinary = Binary($bBinary) Local $tInput = DllStructCreate("byte[" & BinaryLen($bBinary) & "]") DllStructSetData($tInput, 1, $bBinary) Local $tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize($tInput) & "]") ; initially oversizing buffer Local $a_Call = DllCall("ntdll.dll", "int", "RtlDecompressBuffer", _ "ushort", 2, _ "ptr", DllStructGetPtr($tBuffer), _ "dword", DllStructGetSize($tBuffer), _ "ptr", DllStructGetPtr($tInput), _ "dword", DllStructGetSize($tInput), _ "dword*", 0) If @error Or $a_Call[0] Then Return SetError(1, 0, "") ; error decompressing EndIf Local $tOutput = DllStructCreate("byte[" & $a_Call[6] & "]", DllStructGetPtr($tBuffer)) Return SetError(0, 0, DllStructGetData($tOutput, 1)) EndFunc ;==>__background
    1 point
  20. I would use code line #2. It is easier to understand when you look at your code after a few months. But it depends on which result you want to get. Please check the wiki for my Excel Range page and see how UsedRange works.
    1 point
  21. The address bar in Windows Explorer on Windows 7 seems to be a hot-track enabled toolbar menu with popup listviews and a combo box. The toolbar buttons shows the folders in the current path. The popup listviews shows the child folders. The toolbar menu can be implemented as a mixture of script 6 (split buttons) and 9 (popup windows) in Hot-Track Enabled and Custom Drawn Toolbar Menu. The combo box is implemented as a combination of an input box and a listview. The picture shows the last three folders in the path. The split part of AutoIt button is clicked to open a popup listview with child folders. The toolbar is hot-track enabled. If you move the mouse cursor over the neighbour buttons, the neighbour listviews opens automatically without the need to click the buttons. The listview for the leftmost button (without a folder name) contains the folders, which doesn't fit into the toolbar, because the window is too narrow. If you increase the width of the window, folders from this listview will be moved into the toolbar. If you decrease the width, folders from the toolbar will be moved into the listview. If you click a toolbar button or a folder in a listview, this folder will become the current folder. If you click in the empty area of the toolbar between the rightmost button and the combo button, the toolbar will be replaced by an input box. Paste the full path of a folder into the input box and press Enter to make this folder the current folder. If the folder is invalid, the Enter is canceled and the input box stays open. Press Escape or click the title bar or edit box to cancel the input box. Click the combo button to the right to open a listview with previous folders. Click a folder to make this folder the current folder. When you click the combo button, the input box is opened too. Press Escape or click the combo button again to close the listview and set focus to the input box. Press down arrow in the input box to open the listview. Click the title bar or edit box to cancel listview and input box. When the script is opened, or when you paste a folder into the input box and press Enter, or when you click a folder in the combo listview, all folders and child folders along the path are extracted. While the code is running the cursor is shown as an hourglass. You'll only be able to see the hourglass, if the cursor is over the title bar or the toolbar. If the cursor is over the edit box, you'll not see the hourglass. $sFolderPath contains the full path of the current folder. The zip contains two small DLL files, WSP.dll (6 KB) and WSP_x64.dll (10 KB), by Yashied to handle Enter key in listviews. See post 16 in this thread. Windows Explorer address bar.7z Testet on XP 32 bit and Win 7 32/64 bit. Run AddressBar.au3. Edit: $sFolderPath
    1 point
  22. Encontre la solucion, va y copia archivos de Excel y los pega en el espacio que digo... I found the solution, and will copy files from Excel and paste them in the space I want ... Send("{CTRLDOWN}c{CTRLUP}") Send("{CTRLDOWN}v{CTRLUP}")
    1 point
  23. xroot

    Image to base64 code

    metis, I wrote this a while back, you select an image, it converts to base64 and puts it on the clipboard. Just paste into where ever you need. Change the path to your image dir. ;Xroot 2011 ClipPut("") $FN=FileOpenDialog("Pick The Image You Want...","C:My DocumentsImages","Images(*.*)",3) If @error Then MsgBox(4096,"","No File Selected.....",2) Exit EndIf $dat=FileRead(FileOpen($FN,16)) $objXML=ObjCreate("MSXML2.DOMDocument") $objNode=$objXML.createElement("b64") $objNode.dataType="bin.base64" $objNode.nodeTypedValue=$dat ClipPut($objNode.Text)
    1 point
×
×
  • Create New...