-
Posts
92 -
Joined
-
Last visited
About JohnMC
- Birthday 08/31/1985
Profile Information
-
Location
US
-
WWW
https://johnscs.com
Recent Profile Visitors
338 profile views
JohnMC's Achievements
Wayfarer (2/7)
0
Reputation
-
If the archiving processes are started simultaneously you should provide an example of how your calling 7za.exe as that's likely where the problem lies. You could probably fix it so that the script it paused until the process finishes with something like RunWait or a loop to check to see if the process with specified ProccessID still exists. If you are using RunWait or a loop to wait for the process to close, It's also possible 7za.exe is starting a separate process and closing the original causing the script to continue although I don't think 7za does this but you should still check. If you do want to run multiple instances of 7za.exe you would have to use the Run function so the script continues (like it is now from what you say) but keep track of each PID it returns and then create a loop to check that none of the PIDs exist before the script will continue to the cleanup. Also, AutoIT is in fact not capable of forking or multi-threading in the proper sense of it, it is however capable of starting other processes just like you are with 7za.exe, it could also start another process that is itself if you explicitly told it to. If you have files that are locked either the autoit or 7za.exe process are likely still running even if you cant see a terminal or gui, make sure you check task manager. If you still cant figure it out you can use other tools like like Process Explorer to see what process is locking a file https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer
-
So I noticed the other day that haveibeenpwned.com provides a downloadable list of the password hashes they have so that you can more securely check a password, obviously if you use the their website to check a password you would then have to consider that password less secure compared to If you check it locally on your machine. The password list is about 21GB of SHA1 hashes along with what I believe is the count of breaches the password has been found in and then a line break, looking like this: 0ADE7C2CF97F75D009975F4D720D1FA6C19F4897:9 1B6453892473A467D07372D45EB05ABC2031647A:4 356A192B7913B04C54574D18C28D46E6395428AB:1 77DE68DAECD823BABBB58EDB1C8E14D7106E83BB:3 902BA3CDA1883801594B6E1B452790CC53948FDA:7 AC3478D69A3C81FA62E60F5C3696165A4E5E6AC4:5 B1D5781111D84F7B3FE45A0852E59758CD7A87E5:10 C1DFD96EEA8CC2B62785275BCA38AC261256E278:6 DA4B9237BACCCDF19C0760CAB7AEC4A8359010B0:2 FE5DBBCEA5CE7E2988B8C69BCFDFDE8904AABC1F:8 I was surprised I couldn't find a function to efficiently search a large file like this, general googling for how to best search a large file of ordered data turned up nothing ... and when i searched for methods to search the haveibeenpwned.com text file specifically all I got was a number of linear search methods which again surprised me. I'm probably just missing something and I'd love for anyone to share what they know of for doing this. So mostly for fun I've created a function that I believe you could say is just a basic binary search and it is extremely fast and would be even on a file that was 22TB... I ran in to difficulty related to the precision of moving the file pointer and how much data to read from the file at once but so far my solutions have worked and all my tests have returned perfect accuracy. I'd love if someone can give me feedback on it so I can make improvements and feel more confident in it's accuracy, I'm also trying to adapt it to work with other types of data, especially where the individual data points being searched through are variable length but i haven't figured that out yet. Test data (hashes of 1-10 ) can be copied from above but is also attached to the post (script expects testdata.txt). #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <FileConstants.au3> #include <Crypt.au3> Opt("TrayIconHide", 1) ; This is a test script of a way to do a binary search on a large file, specificly made for the file of sha1 hashes (hash ordered) provided by https://haveibeenpwned.com/Passwords ; The loop below provides an input to enter a password that will then be hashed and passed to the main function _FileBinarySearch where it will check pwned.txt for the hash ; You can also leave the input blank to loop through a set of test data which by default will check testdata.txt $Message = "" While 1 $SearchText = InputBox("Pwned File Search",$Message&@CRLF&@CRLF&"What do you want to search for? (leave blank for test data)","") If @error Then Exitloop endif If $SearchText = "" Then ;loop through $TestSamples[] and do a search for each ConsoleWrite(@CRLF&"Testing") Local $TestSamples = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "0", "11"] $sFilePath = "testdata.txt" ;Local $TestSamples = ["passwd1", "passwd1234", "123456", "1234567", "12345678", "safdsadg3423547fgjh45", "sddsj439j23hkjh3gh4KJH3", "sdfsdkjh38saklj1jh7jdh"] ;$sFilePath = "pwned.txt" For $i = 0 To UBound($TestSamples)-1 $Message = $Message & _FileBinarySearch($sFilePath, StringTrimLeft(_Crypt_HashData($TestSamples[$i], $CALG_SHA1),2)) & "," next Else ;use the provided text and do a search $Message = _FileBinarySearch("pwned.txt", StringTrimLeft(_Crypt_HashData($SearchText, $CALG_SHA1),2)) EndIf Wend Func _FileBinarySearch($sFilePath, $Search, $Delimiter = @CRLF) Local $Size = FileGetSize($sFilePath) Local $hFileOpen = FileOpen($sFilePath, $FO_READ) Local $RangeStart = 0 Local $RangeEnd = $Size Local $EstimatedSearchSize = StringLen($Search) + StringLen($Delimiter) + 4 Local $FileReadSize = $EstimatedSearchSize*2 Local $Iterations = 1 Local $IterationsLimit = Floor(Log($Size) / Log(2)) ;the maximum expected difficulty to search the given data Local $Return = False ;ConsoleWrite(@CRLF&@CRLF&"Search: "&$Search&" ReadSize: "&$FileReadSize&" IterationsLimit: "&$IterationsLimit) while 1 ;Get pointer position for middle of given range offset by our read size $PointerPos = Floor(($RangeEnd - $RangeStart) / 2 + $RangeStart - ($FileReadSize / 2)) If $PointerPos < 0 Then $PointerPos = 0 ;Read the file FileSetPos ($hFileOpen, $PointerPos, 0) $Data = FileRead ($hFileOpen,$FileReadSize) If @extended < $FileReadSize Then $Data = $Data&$Delimiter ;end of file? add delimiter to make it easy If $PointerPos = 0 Then $Data = $Delimiter&$Data ;start of file? add delimiter to make it easy ;ConsoleWrite(@CRLF&@CRLF&"Raw Read: "&StringReplace(StringReplace($Data,@LF,"@"),@CR,"%")) ;Clean up the data we read ; an issue will arise in other sets of data with variable length where the data read might not contain delimiters $DataStart = StringInStr($Data,@CRLF) + StringLen($Delimiter) $Data = StringMid($Data, $DataStart, StringInStr($Data, $Delimiter, 0, 2) - $DataStart) ;Update pointer pos with precise start point of the data we are comparing $PointerPos = $PointerPos + $DataStart ;ConsoleWrite(@CRLF&"Data: "&$Data&" Range: "&$RangeStart&"/"&$RangeEnd&" Pointer: "&$PointerPos&" Iterations: "&$Iterations) If StringInStr($Data, $Search) Then ;found the string string ConsoleWrite(@CRLF&"Match Found At "&$PointerPos) $Return = $PointerPos Exitloop ElseIf $RangeEnd - $RangeStart < $EstimatedSearchSize Then ;nothing left to search ConsoleWrite(@CRLF&"No Match") Exitloop ElseIf $Iterations > $IterationsLimit Then ;exceeded the expected difficulty ConsoleWrite(@CRLF&" Error With Too Many Iterations") SetError(1) Exitloop ElseIf $Data < $Search Then ;the found string is lesser ;ConsoleWrite(" Result: Under") $RangeStart = $PointerPos + StringLen($Data) ElseIf $Data > $Search Then ;the found string is greater ;ConsoleWrite(" Result: Over") $RangeEnd = $PointerPos EndIf $Iterations += 1 WEnd FileClose($hFileOpen) Return $Return EndFunc pwned.au3 testdata.txt
-
I have a project that uses the _IECreateEmbedded() method of embedding a browser in my autoit GUI. As i understand this is actually called "Shell.Explorer.2". The webpages that i need to use in the GUI no longer display correctly (never really did, just no longer tolerable). Im trying to figure out what other options i have, i've noticed that it might be possible to embed firefox but last time i looked at it firefox had to be installed on the system and that's not an option, my program needs to be treated as 'portable'. My other thought was to embed the REAL internet explorer but i cant find information about this thanks for any ideas!
-
Scite and Scite4Autoit not playing well together
JohnMC replied to JohnMC's topic in AutoIt General Help and Support
You kinda made my point, scite4autoit should have its own environment variable and scite should use its own. Scite is purpose built for autoit in this case so if another copy of scite (vanilla or another purpose built scite that doesnt play well) comes along they would conflict, right? -
Scite and Scite4Autoit not playing well together
JohnMC replied to JohnMC's topic in AutoIt General Help and Support
from http://www.scintilla.org/SciTEDownload.html Didnt realise i grabed this isntalled, didnt think much of it i guess because its linked from scintilla.org =/ Taking a quick look it seems that when the linked version of scite is installed env "SciTE_HOME" is set to "C:ProgramDataSciTE" when its not installed its not set at all. Well thanks for stickin with me on this, this is plenty of information to come up with a fix, however it does seem like it would be wise to have scite4autoit ignore that environment setting as its doesnt seem to use/need it anyway. Thanks! -
Scite and Scite4Autoit not playing well together
JohnMC replied to JohnMC's topic in AutoIt General Help and Support
Ill try to explain it better... like i said before scite4autoit becomes 'vanilla' scite once 'vanilla' scite is installed on the same system. So i have autoit and scite4autoit installed on my pc like i always have, scite4autoit works great with all its customizations and build options and syntax coloring. I install Scite on the same system and while scite works as expected, scite4autoit does not anymore... all the customizations, build options and syntax coloring that make it 'scite4autoit' are gone and all i see is a vanilla scite. This is all regardless of if i re-install scite4autoit or if i launch scite4autoit directly from the autoit directory. As soon as i uninstall scite, scite4autoit returns to normal. Thanks for the help, i can make a quick video if im still not explaining it right -
It seems to me that a method should exist without logging keys (sounds like that part isnt your issue) is this a web application or a windows application? I think if its a windows application you might be able to create a tight loop that checks the status of the button, if its pressed or not, you would be very time limited however because i assume that once the button is depressed the gui with the information goes away just a thought edit: just reread title, my guess is this idea could possibly work, you'll have to sort through the related functions of getting the status of a control, i think it guictrlread(), ill play around and see if i figure something out. also (again assuming you are already capturing the password/form data) why not monitor the data in a loop and then choose the final data based on when the gui disapears
-
Scite and Scite4Autoit not playing well together
JohnMC replied to JohnMC's topic in AutoIt General Help and Support
I guess i wasn't aware i could use scite4autoit as a general purpose code editor, i don't see things like php or html listed under language so i asume your saying i can add them.. Regardless it doesn't seem right that scite4autoit becomes inoperable if scite is installed on the same system. Its not not about running them at the same time... just having vanilla installed causes the issue. i' ve confirmed this on 2 different win7x64 systems, when scite (scintilla.org) is installed on the same system as scite4autoit, scite4autoit becomes vanilla, regardless of install order or launch method. If i had to guess they must be sharing some sort of registry key or a config file someplace, but that doesn't explain why simply uninstalling vanilla scite corrects the issue, unless its priority based (ie use registry if settings exist, look for ini file if they dont) -
I use a vanilla scite for general purpose text editing and ive some how ended up with an issue that causes scite4autoit to become 'vanilla' when scite is installed at the same time on my system. ive tried executing the scite.exe directly from the autoit program directory with no luck, still just vanilla scite. Ive tried re-installing scite4autoit after vanilla scite is installed and still no luck. as soon as i uninstall vanilla scite everything is fine. I dont know enough about scite configuration to track down the cause and i'm hoping someone can help, thanks!
-
For the few XP systems i deal with im typically using a VM image to copy to the system then a driver/migration tool to get it to boot on the system, This leaves me with a system that boots but often has no functioning keyboard and mouse because of drivers not being installed, the driver installation prompt is on the screen but cant be advanced due to lack of input. What ive done is setup my VM image to automatically log in to a temporary user, this temporary user has the below script in there startup folder, the script advances through all scenarios of the driver installation prompt in hopes that it will advance to the point your USB/input drivers are automatically setup, when this happens, i shutdown the script, remove it from the startup folder and continue on with my setup. $title="Found New Hardware Wizard" sleep(20000) while 1 if WinExists($title) then sleep(3000) WinActivate($title) sleep(3000) $text=WinGetText ($title) if StringInStr($text,"Can Windows connect to Windows Update to search for software?") then ControlCommand ($title,"","[ID:8104]","Check", "") sleep(500) ControlClick("Found New Hardware Wizard","","[ID:12324]") sleep(1000) endif $text=WinGetText ($title) if StringInStr($text,"Cannot Install this Hardware") then ControlCommand ($title,"","[ID:1030]","UnCheck", "") sleep(500) ControlClick("Found New Hardware Wizard","","[ID:12325]") sleep(1000) endif $text=WinGetText ($title) if StringInStr($text,"What do you want the wizard to do?") then ControlCommand ($title,"","[ID:1049]","Check", "") sleep(500) ControlClick("Found New Hardware Wizard","","[ID:12324]") sleep(1000) endif $text=WinGetText ($title) if StringInStr($text,"Click Finish to close the wizard.") then ControlClick("Found New Hardware Wizard","","[ID:12325]") sleep(1000) endif endif wend
-
Browser GUI object - IE not displaying correct, firefox?
JohnMC replied to JohnMC's topic in AutoIt General Help and Support
still searching for solution, hope its ok i bump this, i'm really surprised this issue hasn't been encountered before -
Hi, i use an embedded IE browser as part of a portable web server app. The embedded IE seems not to process some css elements correctly among other things, i checked what version of IE the embedded object uses, i was surprised to find its IE7. can anyone offer me a way to use the current version of IE installed on the system instead of IE7? alternatively ive been trying to find how to embed firefox, i dont see a ton of information on this so i was curious if its possible to embed firefox into a portable application (carry the required Firefox components with the portable app)
-
GUI Embedded IE and $oIE.GoBack issue
JohnMC replied to JohnMC's topic in AutoIt General Help and Support
Just to update anyone who ran into the same thing i did: the method of capturing the error instead of avoiding it is probably the best way of doing this but i wanted to try and come up with an alternative so here it is: In this method you would create a different "start" url and "home" url, the start url will have any unique string at the end of it as long as it wont interfere with the page loading. $URL_HOME="http://www.autoitscript.com" $URL_HOME_START=$URL_HOME&"/#START" Your initial navigation of the embedded IE will be with $URL_HOME_START and then any home operation would navigate it to $URL_HOME Then before you perform your back operation you check to make sure the current page isnt $URL_HOME_START. The trick is to also make sure the browser isnt busy to avoid issues with multiple back operations becoming queued and resulting in the error. If $oIE.LocationURL<>$URL_SI_START AND NOT $oIE.Busy Then $oIE.GoBack -
GUI Embedded IE and $oIE.GoBack issue
JohnMC replied to JohnMC's topic in AutoIt General Help and Support
can you recommend a resource/examples for methods to gather details about what the error is and what it came from -
GUI Embedded IE and $oIE.GoBack issue
JohnMC replied to JohnMC's topic in AutoIt General Help and Support
Thanks Dale! I wanted to figure out why this works so i sorted over the UDF and it apears this is the magical line (Modified for my use): $objError = ObjEvent("AutoIt.Error", "_ErrorHandlerFunction") It appears that the UDF doesn't deal with the problem it just deals with the error, thats ok with me, and i assume registering that event will work for all autoit errors so thats kinda cool. thanks again