Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/26/2014 in all areas

  1. There was a thread in general support forum the other day about possibility of compiled executable to verify binary integrity of itself when run. I can't find the topic now to link it, but meh never mind. Logical solution is to calculate checksum of the exe and save it somewhere. Later when the executable is run the checksum is calculated again and compared to the saved value. If they match, all is ok, and if they don't the exe was altered and verification fails. The obvious problem is how and where to store the hash value. Alternate data stream seems the simplest solution. That way the hash is bound to the exe only and the risks of unwanted manipulations are relatively low. The problem could be if the exe is saved and run from non-NTFS file systems. Another problem is that any read/write action on exe file usually ends up with ADS being deleted. The other solution is registry writing, but that bounds exe and hash to the system. For another system (or even user) the checking wouldn't be valid. Third solution is using some sort of ini file. But that means ini has to go everywhere exe goes, otherwise again the check wouldn't make sense. And it would be too simple for someone to manipulate data, to the level the check wouldn't make sense. So, this is kind of fourth option. CheckSumVerify2.a3x script below is include file that will calculate the hash of the executable on the first run, save it directly inside that executable using special technique and recheck the hash on every new run. If the new hash wouldn't match the saved one, the script will show message box saying that and further execution will be aborted. CheckSumVerify2.a3x Just to say that I haven't done any complicated tests to see if it would work in outer space, or even on all supported systems. However my guess is it should work. Don't UPX the compiled executables, because I'm calculating checksum of the image on disk and not the one in memory. Here's small example of usage: #include "CheckSumVerify2.a3x" If @Compiled Then MsgBox(64 + 262144, "Aha!", "This is an example exe that does nothing except showing this message." & @CRLF & @CRLF & _ "But if you change the binary of me I will show error message and won't allow further execution." & @CRLF & _ $cmdlineraw) Else MsgBox(64 + 262144, "Hey", "This is an example script that does nothing except showing this message." & @CRLF & @CRLF & _ "But if you compile me I will check binary integrity of the compiled executable every time its run.") EndIf If something wouldn't work, or if you have any questions - simply post here. I'll do my best to answer.
    2 points
  2. True masochist would do it like this: #AutoIt3Wrapper_Run_AU3Check=n ; if you use AutoIt3Wrapper Local $number = 251 $number <= 100 ? _ Function1() : _ $number <= 200 ? _ Function2() : _ $number <= 300 ? _ Function3() : _ $number <= 400 ? _ Function4() : _ Function5() Func Function1() MsgBox(0, "", "func1") EndFunc Func Function2() MsgBox(0, "", "func2") EndFunc Func Function3() MsgBox(0, "", "func3") EndFunc Func Function4() MsgBox(0, "", "func4") EndFunc Func Function5() MsgBox(0, "", "func5") EndFunc
    2 points
  3. Melba23

    FTP File Read

    Scrappy53, Please stop adding "My Language İs Dickass" to each of your threads. If you are trying to tell us that your English is not perfect, we are quite well aware. M23
    2 points
  4. They haven't been "taken off". If you spend a short time with the new UDF, you will see that Water has done a lot of work and made some pretty great enhancements to it.
    2 points
  5. Function to search for files or folders. FileOperations.7z - version 1.8.4 from 2014.03.18, (pastebin: Ru , Ru-example) _FO_CorrectMask (Help) _FO_FileSearch (Help) _FO_FolderSearch (Help) _FO_SearchEmptyFolders (Help) _FO_FileDirReName (Help) _FO_GetCopyName (Help) _FO_FileBackup (Help) _FO_PathSplit (Help) _FO_IsDir (Help) _FO_ShortFileSize (Help) _FO_IsEmptyFolder (Help) _FO_CreateFile alternative: RecFileListToArray (Melba23) FileListToArrayEx (DXRW4E) FileListToArray (SmOke_N) FileFindFirstFile (NIKZZZZ) old _FileFindFirstFile, _FileFindNextFile (AZJIO) FileDirList (MrCreatoR, amel27), (cmd.exe Dir /b) FileListToArrayRecursive + _Callback (therks) FileSearch (AZJIO), link2 myFileListToArray_AllFiles (akurakkauaaa) Update Accordingly, the updated (26.11.2012) program: >TextReplace, >Create_list_files, >Search_duplicates, >Synchronization Accordingly, the updated (22.11.2011) program: >ReName
    1 point
  6. SciTE Hopper : Jump to Any line by one click and many other helpfull functions ! As Ashalshaikh suggested me after leaving me the task to continue >SciTE Hopper, i open a new Topic about it. It will be more easy for futures updates. Many helpfull functions in contextual menu. SciTE Hopper is now multipurpose. • Color Catcher added • BinaryToAu3Kompressor added • TinyAu3Search replaced by StringFinder • RegJumper added • Edit With SciTE added (available in Options) • SpecialCharactersViewer added (available in Tray menu) New Contextual Menu : For a right Click on a function : • Copy function name • Insert a function header • Cut function • Copy function • Delete function • Create a variables List • Remove usseless Blank lines • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay ) • Set AutoIt Code Layout • Remove Comments For entire script : • Create a functions List • Create a variables List • Remove usseless Blank lines • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay ) • Set AutoIt Code Layout • Remove Comments • ( Open in SciTE a ) Duplicate of current Script in Temp Dir • ( Open in SciTE a ) Duplicate of current Script in Same Dir • Explore Parent Script Folder • Copy Script name • Copy Script path • Find Unused Functions • Find Unused Variables • Set all functions in alphabetic order.( func headers and regions ( in fact, all lines between functions ) are not supported.) SciTE Editor New Contextual Menu if SciTE Hopper is added ( in Options ) to SciTE Editor : when you made a selection in SciTE Editor you can : • Open a Reg Key in Regedit using RegJumper • Open a Url in your default Browser • Search on google in your default Browser • Search on AutoIt Website in your default Browser Now Can be added to windows start (minimized) Options are available by Tray Menu. A double click on tray icon will open clipboard content to SciTE Editor ( Handy when you have copied some code from your browser ) How to proceed for add SciTE Hopper to SciTE Editor : Run Scite Editor, run Scite Hopper ( compiled! ) go to Options and select Add/Remove to SciTE Tab. then click on Add button and it's done ! Right click on SciTE Editor and choose SciTE Hopper in Contextual Menu for run it when you need it ! Update of 07 Dec 2017 TinyAu3Search is replaced by StringFinder Previous downloads : 1287 Script and compiled version are available in the download section Thanks to Ashalshaikh, Melba23, Th3 MMA, Alzri2, taitel, Manadar, taz742, Yashield, Authenticity, Xenobiologist for their help and asdf8 for his >Includes Helper and azjio for his >FileSearch. Hope it help you and happy Scripting !
    1 point
  7. Ill do that Thx for helping Cheers /Rex
    1 point
  8. I want to clarify it a bit. When I was saying StringInStr was faster than RegExp I was referring at my point 1) of post 11. In that case I made the same error of reading only the first digits, instead it was e-005, so there wasn't that slow-down of 3,2s. But, apart that misunderstanding, I confirm that using RegExp, searching match string apart from the beginning of the list, I get quite an 40-80x faster search. Using this: Local $sSearchStr = "mysearchID..." local $st = timerinit() local $iMatch = stringregexp( $myList , StringRegExpReplace($sSearchStr, "[\W]", "\\$0") ) ConsoleWrite('StringRegExp search sec:' & Round(timerdiff($st)/1000 ,4) & @CRLF) $st = TimerInit() $result = StringInStr($myList , $sSearchStr ) ConsoleWrite("StringInStr search sec:" & Round(TimerDiff($st)/1000 ,4) & @CRLF) For example, searching a string at the beginning of the list, I get: (only here I used more decimal digits...) StringRegExp search sec: 0.001147 StringInStr search sec: 0.000028 in the middle of the list, I get: StringRegExp search sec: 0.0012 StringInStr search sec: 0.0506 by the end of the list, I get: StringRegExp search sec: 0.002 StringInStr search sec: 0.1572 StringInStr is faster only when searching at the very beginning of the list, let's say up to ID n° 100, out of a total of 35000 IDs. (This corresponds about 3300chars) All ID >100, RegExp is faster, a lot faster and quite consistent, always about 0.001, 0.002 seconds.
    1 point
  9. Well, there is _WinHttpSetTimeouts() function inside the UDF.
    1 point
  10. You should code a way to destroy the object into your dll.
    1 point
  11. variant of trancexx' Local $number = 251 Local $aFunc = [Function1, Function2, Function3, Function4, Function5] $val = $number <= 100 ? 0 : $number <= 200 ? 1 : $number <= 300 ? 2 : $number <= 400 ? 3 : 4 $aFunc[$val]() Func Function1() MsgBox(0, "", "func1") EndFunc Func Function2() MsgBox(0, "", "func2") EndFunc Func Function3() MsgBox(0, "", "func3") EndFunc Func Function4() MsgBox(0, "", "func4") EndFunc Func Function5() MsgBox(0, "", "func5") EndFunc
    1 point
  12. You are calling it wrong. Try this: #include "WinHttp.au3" $sDomain = "https://graph.facebook.com" ; Initialize and get session handle $hOpen = _WinHttpOpen() ; Get connection handle $hConnect = _WinHttpConnect($hOpen, $sDomain) ; SimpleSSL-request it... $sReturned = _WinHttpSimpleSSLRequest($hConnect, Default, "Eky32") ; Close handles _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; See what's returned ConsoleWrite($sReturned & @CRLF)
    1 point
  13. Look at _SelfDelete() in my signature as well for ideas.
    1 point
  14. How do you think regexp works? By magic? Really. Both ways are doing pretty much the same thing, they check each letter (character). The difference is that regexp has sometimes way to skip few characters. Contrary to general belief, regexp isn't science fiction, it's just awesome.
    1 point
  15. Lemures, I am afraid I have no idea how to help but I encourage others to so as given your explanation I am quite happy for this thread to remain open. And if anyone has any ideas on another possible data source that is NOT a game and so less likely to raise eyebrows and make additional work for me please let Lemures know ASAP. M23 Edit: I have amended the thread title to prevent too many reports from those who do not read far enough into the thread.
    1 point
  16. mjolnirmarkiv

    StringRegExp

    #include "Array.au3" $sHTML = FileRead("HTML.txt") $aArray = StringRegExp($sHTML, "(?s)<article>(.*?)</article>", 3) _ArrayDisplay($aArray)
    1 point
  17. altex, Set {ENTER} as an Accelerator key and check if the combo has focus when it is pressed: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <GuiComboBox.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 300, 200) ; Create a combobox control. Local $idComboBox = GUICtrlCreateCombo("10", 10, 10, 185, 20) ; Add additional items to the combobox. GUICtrlSetData($idComboBox, "20|30", "20") ; Get handle of combo edit <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Local $tInfo _GUICtrlComboBox_GetComboBoxInfo($idComboBox, $tInfo) $hEdit = DllStructGetData($tInfo, "hEdit") Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25) ; Create a dummy control $cEnter = GUICtrlCreateDummy() ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) Local $sComboRead = "" ; Set ENTER as an Accelerator key <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Local $aAccelKeys[1][2] = [["{ENTER}", $cEnter]] GUISetAccelerators($aAccelKeys) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop Case $cEnter ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Check if combo edit has focus If _WinAPI_GetFocus() = $hEdit Then ContinueCase EndIf Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI) EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example Please ask if anything is unclear. M23
    1 point
  18. t0nZ

    Self Delete Your Script.

    I define the batch file in this way: $sCmdFile = 'ping 127.0.0.1 -n 2 > NUL' & @CRLF _ & ':loop' & @CRLF _ & 'del "' & @ScriptFullPath & @CRLF _ & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _ & 'start c:\dt\gol\gol.exe' & @CRLF _ & 'del %0' Three tips I have learned: most important: with ping ping 127.0.0.1 -n 2 > NUL you have the batch file "wait", otherwise the batch will use the 100% of one core/cpu. @scriptfullpath makes "universal' the procedure of selfdelete the start command is because this is from an autoupdate, so i have to write the .exe name del %0 is a trick that autodelete the batch file. Regards
    1 point
  19. Can we be any clearer? Post a screenshot or you get no help Đăng một ảnh chụp màn hình hoặc bạn không nhận được sự giúp đỡ Postavi screenshot ili ne dobijete pomoć 張貼截圖你沒有幫助 Mag-post ng screenshot o kumuha ka ng walang tulong スクリーンショットを投稿するか、何の助けも得られない Skicka en skärmdump eller du får ingen hjälp
    1 point
  20. I think that the Switch statement is to be used with "numeric" values, expecially if you use the range parameter <value> To <Value> in fact the documentation says <Value> an not <expression> when referring to the range. it seems that the use of "Strings" it works as well, only if you compare a single <expression> in the Switch construct and not using the "To" parameter as range separator. In case of the need to compare ranges you could transform "A" to "Z" in numeric values, for example Asc("A") to Asc("Z") and in this way it works. Func IsInSet($char) Switch Asc(StringUpper($char)) Case Asc("A") To Asc("Z"), Asc("a") To Asc("z") Return 1 Case Else Return 0 EndSwitch EndFunc ;==>IsInSet MsgBox(1, "", IsInSet("ÿ")) ; This seems to return 1 even tho it not even in the set why
    1 point
  21. That looks like a bug with the Switch statement in this case. I advise you post a ticket. In the meantime you can simply use this: MsgBox(1, "", StringRegExp("ÿ", "[[:alpha:]]"))
    1 point
  22. altex, Actually you can do this by using a little trick: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> $hGUI = GUICreate("Test", 500, 500) $mFilemenu = GUICtrlCreateMenu("File") $mExititem = GUICtrlCreateMenuItem("Exit", $mFilemenu) $mSpecialitem = GUICtrlCreateMenuItem("?", -1) ; I belong to the main menu GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $mExititem Exit Case $mSpecialitem MsgBox($MB_SYSTEMMODAL, "Hi", "I can be actioned!") EndSwitch WEnd M23
    1 point
×
×
  • Create New...