Leaderboard
Popular Content
Showing content with the highest reputation on 09/19/2016 in all areas
-
Network Connections Viewer
SkysLastChance and one other reacted to trancexx for a topic
There are situation when you know something is going off from or to your computer and you have no idea what that is or who's doing that. On the other hand, sometimes you are just curious to know (I know I am) what's cooking. Scrip below is analyzing every connection that your machine have. Either TCP or UDP. It'll give you port numbers, IP addresses, names of the processes issuing connections, their PIDs, locations on HD, user names, connection statuses, and hints on protocols for used ports (so that you know roughly what that connection is or could be). Also you will be given an ability to disable desired connection. Script: ConnView.au3 edit: new script2 points -
Tell me again how I am just a user of my Enterprise Win10 Build 14926.rs_prerelease.160910-1529 and you are the 'owner' of your Win98se, just because you are in prison does not mean that you run the place. I am going to say confidently, that you have close to ZERO first-hand knowledge of the way the new Win10 builds actually function and are spouting the telemetry and wares FUD from early releases. My current box phones home on exactly one occasion, and that's when i submit a comment to the WindowsInsiders. There are inherent flaws in win98se that will not be patched (not even if you are on MSFN every day of the week downloading every new hacked and backported patch) that are exposing you to literally hundreds of drive-bys from every kiddie scripter with the latest metasploit or kali packages. Also you have a metric shit ton of obsolete certs and crypto packages that can still be force negotiated even if better/newer/shinier are available. Just because your box is completely uninteresting does not mean it is not open wider than goatse. And I dont care if anyone takes offense, espousing the benefits of Win98SE is relegated to how great CS1.5 runs. The security is bollocks.1 point
-
Hello. try the call this way Local $aRet = DllCall( $hdllOleacc, "int", "AccessibleObjectFromWindow", "hwnd", $hWnd, "dword", $iObjectID, "struct*", $tRIID, "ptr*", 0 ) Saludos1 point
-
Hi @Mr_cooper I found a old forum thread from 2007. I did a test with the code on Windows XP. It ran. Not sure it will work on Windows 7-10 but you can give it a try: Easy Shell Hooking Example1 point
-
Yep, seems even a 100ns sleep is enough to reduce the cpu usage to pretty much zero. It doesn't seem to impact too badly on the accuracy of the loop. #include <Array.au3> Local $sum, $loops = 10000 Local $hDll_ntdll = DllOpen("ntdll.dll") Local $prev = 0 Local $i = 1, $diff $hTimer = TimerInit() While 1 Do DllCall($hDll_ntdll, "dword", "NtDelayExecution", "int", 0, "int64*", -1) $diff = TimerDiff($hTimer) Until $diff > $i ; 1ms loop $sum += $diff - $prev $prev = $diff If $i >= $loops Then ExitLoop $i += 1 WEnd MsgBox(0, "Finished.", "Mean loop time: " & ($sum / $loops))1 point
-
Here is an example of using a timer to fix your loop time manually. You might find your cpu usage is very high if you run this constantly. This example stores the timer in an array for 100 iterations, and it was sometimes out by 10% but was usually pretty close. #include <Array.au3> Local $a[100] Local $i = 1 $hTimer = TimerInit() While 1 Do Until TimerDiff($hTimer) > $i ; 1ms loop $a[$i] = TimerDiff($hTimer) If $i >= 99 Then ExitLoop $i += 1 WEnd _ArrayDisplay($a) Mat1 point
-
You could try a workaround : put the pixel coordinates into a 2D array and then sort this array Pseudo-code : Local $aResult[8][2], $n = 0 $pixel = PixelSearch(...) If not @error Then ; to avoid the "non-accessible variable" error $aResult[$n][0] = $pixel[0] $aResult[$n][1] = $pixel[1] $n += 1 EndIf ;...etc Redim $aResult[$n][2] _ArraySort($aResult, ...) ; sort the array on column 0 (x coordinates) ; $track should be $aResult[0][0], $aResult[0][1]1 point
-
need Excel Read and Write
232showtime reacted to water for a topic
Use _Excel_SheetList to enumerate all sheets of the workbook. Then loop throught the returned array and use _Excel_RangeRead to read all data of the worksheet into an array. Means: You will get as many arrays as there are sheets in your workbook.1 point -
autoit problem i can't read this script
232showtime reacted to JohnOne for a topic
Try soaking your hard drive in salty water over night.1 point -
Another workaround: #include <Array.au3> #include <File.au3> Global $aArray[1] $sFile='lorem.txt' ;note: if origin file is needed work with a copy _ReplaceStringInFile($sFile,@CRLF,'|') _ReplaceStringInFile($sFile,'@@|',@CRLF) _FileReadToArray($sFile,$aArray) _ArrayDisplay($aArray,'"|" = @CRLF') For $i = 1 To UBound($aArray)-1 $aArray[$i]=StringReplace($aArray[$i],'|',@CRLF) Next _ArrayDisplay($aArray) But you can use StringSplit for getting same result: #include <Array.au3> #include <File.au3> Global $aArray[1] $sFile='lorem.txt' $sData=FileRead($sFile) $aSplit=StringSplit($sData,'@@'&@CRLF, $STR_ENTIRESPLIT) _ArrayDisplay($aSplit)1 point
-
OutlookEX UDF
George-Peterson reacted to water for a topic
This should do the trick (untested): $aRecurrence = _OL_ItemRecurrenceGetEX($oOL, $vItem) ; $vItem = EntryId or Object of the appointment item $oRecurrencePattern = $aRecurrence[14].GetRecurrencePattern $oRecurrenceItem = $oRecurrencePattern.GetOccurrence("3/12/2003 3:00:00 PM") $oRecurrenceItem.Display Func _OL_ItemRecurrenceGetEX($oOL, $vItem, $sStoreID = Default) If Not IsObj($vItem) Then If StringStripWS($vItem, 3) = "" Then Return SetError(1, 0, "") $vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID) If @error Then Return SetError(2, @error, "") EndIf ; Recurrence object of the appointment If $vItem.IsRecurring = False Then Return SetError(3, 0, "") Local $oRecurrence = $vItem.GetRecurrencePattern If Not IsObj($oRecurrence) Or @error Then Return SetError(4, @error, "") Local $aPattern[15] = [14] $aPattern[1] = $oRecurrence.DayOfMonth $aPattern[2] = $oRecurrence.DayOfWeekMask $aPattern[3] = $oRecurrence.Duration $aPattern[4] = $oRecurrence.EndTime $aPattern[5] = $oRecurrence.Instance $aPattern[6] = $oRecurrence.Interval $aPattern[7] = $oRecurrence.MonthOfYear $aPattern[8] = $oRecurrence.NoEndDate $aPattern[9] = $oRecurrence.Occurrences $aPattern[10] = $oRecurrence.PatternEndDate $aPattern[11] = $oRecurrence.PatternStartDate $aPattern[12] = $oRecurrence.RecurrenceType $aPattern[13] = $oRecurrence.StartTime $aPattern[14] = $oRecurrence Return $aPattern EndFunc ;==>_OL_ItemRecurrenceGetEX1 point -
Suggestion/workaround - test 6 DCs, with the first being one you DON'T want to measure. Ie: DC75, DC1, DC2,DC3,DC4,DC5 That way the delay only affects a DC you don't care about. Another option is to run the script 5 times, with a different DC in the first position each time, thus they all get affected by the slow connection equally (which could be important if the latency is what you're trying to measure).1 point
-
corgano, I use an Accelerator key to do this: #include <GUIConstantsEx.au3> #include <WinAPI.au3> $hGUI = GUICreate("Test", 500, 500) $cInput_1 = GUICtrlCreateInput("", 10, 10, 100,20) $cInput_2 = GUICtrlCreateInput("", 10, 50, 100,20) $cDummy = GUICtrlCreateDummy() GUISetState(@SW_SHOW) ; Set accelerator for Enter to action the Dummy code Dim $AccelKeys[1][2]=[["{ENTER}", $cDummy]] GUISetAccelerators($AccelKeys) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $cDummy ; Check input has focus If _WinAPI_GetFocus() = GUICtrlGetHandle($cInput_1) Then $sText = GUICtrlRead($cInput_1) MsgBox(0,"test", "You typed " & $sText & " in Input 1") EndIf EndSwitch WEndM231 point
-
Greetings. I'm running in to a problem with my second AutoIt script and can't seem to figure it out. The script is supposed to loop through every disk listed and capture the disk detail to a text file named with disk id (disk 0.txt, disk 1.txt, etc). Then it searches each text file for the string "Type : USB" and if found, deletes that file leaving only text files relating to fixed disks. Finally it uses the remaining file names as without the .txt extension for the "select disk" command before performing the rest of the commands in diskpart to repartition and format the drives. Each function performs as expected but when I run the script, the function FormatFixedDisks() seems to execute before the text files containing the "USB" string get deleted so it ends up formatting all disks connected to the system. In the code below I've commented out the diskpart formatting commands and leaving only "select disk" output to a message box to test. I've tried messing around with sleep functions to no avail and besides, i don't think thats the root cause here. Reason I want to avoid USB disk types is because I'm running a disk wipe tool bundled with MS Diagnostics and Recovery Toolset in WinPE on servers via USB stick and don't want to wipe the stick obviously. After blowing out the RAID config I was having to manually reformat each disk in diskpart before executing the wipe process. What am I missing? Thanks! #include <Constants.au3> #include <File.au3> #include <Array.au3> DirCreate("Disks") $diskIDs = GetDiskListings() GetDiskDetails($diskIDs) DeleteDiskTypeUSBFiles() FormatFixedDisks() Func GetDiskListings() Local $diskPart = "" Local $listDisk = "" Local $listOfDisks = "" Local $diskPart = Run("diskpart.exe", "C:\Windows\System32\", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($diskPart, "list disk") StdinWrite($diskPart) ;Read from child's STDOUT and show Local $listDisk While True $listDisk &= StdoutRead($diskPart) If @error Then ExitLoop Sleep(25) WEnd $listOfDisks = StringRegExp($listDisk, '(Disk\s\d)', 3) ;Returns array of all disks from list disk output. Return $listOfDisks EndFunc Func GetDiskDetails($listOfDisks) Local $disks = "" Local $diskPart = "" Local $diskDetails = "" $disks = $listOfDisks For $disk In $disks $diskPart = Run("diskpart.exe", "C:\Windows\System32\", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($diskPart, "select " & $disk & @CRLF & "detail disk") StdinWrite($diskPart) While True $diskDetails &= StdoutRead($diskPart) If @error Then ExitLoop Sleep(25) WEnd ;Create new file using $disk as filename and write diskpart output to file. FileOpen("Disks\" & $disk & ".txt", 1) FileWrite("Disks\" & $disk & ".txt", $diskDetails) FileClose("Disks\" & $disk & ".txt") $diskDetails = "" Next EndFunc Func DeleteDiskTypeUSBFiles() Local $error = False Local $files = "" If FileExists(".\Disks") Then $files = _FileListToArray("Disks", "*") _ArrayDelete($files, 0) ;Delete first element because it's only number of rows. For $file In $files ;Read all lines in $diskFile and search for string "USB". Local $arrDiskContents _FileReadToArray("Disks\" & $file, $arrDiskContents) ;Write each line in array to new string variable because _ArraySearch for ;string would not work. Local $strDiskContents For $line In $arrDiskContents $strDiskContents &= $line & @CRLF Next If StringInStr($strDiskContents, "Type : USB") Then FileDelete("Disks\" & $file) EndIf $strDiskContents = "" Next Else MsgBox(0, "Error", "The Disks directory could not be found." & @LF & _ "The script cannot continue.") $error = True Exit EndIf Return $error EndFunc Func FormatFixedDisks() Local $error = False Local $files = "" Local $diskPart = "" Local $diskDetails = "" If FileExists(".\Disks") Then $files = _FileListToArray("Disks", "*") _ArrayDelete($files, 0) ;Delete first element because it's only number of rows. _ArrayTrim($files, 4, 1) ;Trim file extension for select disk input. For $file In $files $diskPart = Run("diskpart.exe", "C:\Windows\System32\", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($diskPart, "select " & $file); & @CRLF & "clean" & @CRLF & "create partition primary" & @CRLF & "format fs=ntfs quick" & @CRLF & "assign") StdinWrite($diskPart) While True $diskDetails &= StdoutRead($diskPart) If @error Then ExitLoop Sleep(25) WEnd MsgBox(0, "DiskPart Results", $diskDetails, .500) $diskDetails = "" Next EndIf EndFunc1 point
-
HI is there a way I can get the serial from cmd to a variable? if you go to cmd and type: vol you get the serial number for (c:\) C:\Users\mac>vol Volume in drive C has no label. Volume Serial Number is E497-2EDC I want to make a hwid authentication system, however I am not sure that this number is changed, if you reinstall.1 point
-
You could always do it the long yet effective way of "Vol" works in the cmd for you then try outputting the display text for cmd.exe C:Usersmac> vol > C:vol.txt This would output the drive id and serial number to C:vol.txt afterwards use the following code. #Include <File.au3> Local $File = 'C:Vol.txt' For $n = 1 To _FileCountLines( $File ) Step + 1 $Line = FileReadLine( $File, $n ) If StringinStr( $Line, 'Volume Serial Number is' ) Then $Line = StringReplace( $Line, 'Volume Serial Number is', '' ) $Line = StringReplace( $Line, ' ', '' ) $DriveID = $Line EndIf Next The code checks the lines in the file for Volume Serial.... Removes it and all blank whitespaces and leaves the code in the variable $DriveID1 point