Leaderboard
Popular Content
Showing content with the highest reputation on 09/14/2012 in all areas
-
Last updated 9/10/21 * Image may not represent current product Features Simple Integrated countermeasures against file and memory analysis based decompilers. Add basic types of resources into the interpreter or other types as raw data. Define multiple programs to execute pre and post build. Create and include pe version information. User defined patches that can be implemented globally on the interpreter and compiler or selectively. Handles its own basic macro's as well as environment variables in most fields for easier path finding. Drag and drop configs (script bound or separate) to the input edit box or to the icon to load them. Configuration settings can be copied to the clipboard or saved as config files or Au3 scripts. Settings can now be saved directly to an AutoIt3 script. Subsystem independant, can act as a gui or console tool. And much more. See next post for update information. A3C_97.16b.7z A3C_98_18_b.zip1 point
-
DropboxEX - Hardlinks Dorpbox is getting more and more versatile ! Most of you know it as a file sharing tool for different OS's and Mobile platforms . By the way I use 8 / 9 and 10, just amazing, but that's a different story. Anyhow the feature that is missing is, can I sync files and folders which are outside of the Dropbox area. And not to use a seperate sync tool that copies / duplicates all the files ? The answer was given here : Ok let's see what we can do with AutoIT to help a hand. I created 2 versions to create hard links to the dropbox folder called EXTERNAL. 1 version is using native AutoIT commands The second version is using the _WinAPI commands. ( Downside on this one is that you needs full administrator rights :-( Not so elegant of course ! ) Enjoy, ptrex DropboxEx Folder Sync.au3 DropboxEx Folder Sync_WinAPI.au31 point
-
Hi, I have worked on a project for a friend and it needed to retreive some data in UDP packets, it was a challenge because I didn't know anything about that packets, and after few days of work I have managed to do what I wanted. The hardest part was to set a very strict filter for the cpu usage and for the script optimisation, so here is one : ;use filters with _PcapStartCapture ;retreive only tcp packets containing AABBCCDD, at the start of 8 and with a length of 4; like the StringMid func. tcp[8:4] == 0xAABBCCDD ;8th byte from the beginning of the tcp DATA, 4bytes length; always include the 0x to specify you are dealing with hex. And some funcs to split the different data from packets : ;$hCapture is the handle returned by _PcapStartCapture ; #FUNCTION# ==================================================================================================================== ; Name...........: _TCP_Recv ; Description ...: Retreives a TCP Packet and returns its data splitted ; Syntax.........: _TCP_Recv($hCapture, $iInstance = 0, $iTimeOut = 3000) ; Parameters ....: $hCapture - Capture handle ; $iInstance - Instance of the packet to retreive ; $iTimeOut - Timeout ; Return values .: Success - Array containing the packet data ; Failure - -1 (timedout) ; Author ........: FireFox (d3mon) ; Modified.......: ; Remarks .......: ; Related .......: _UDP_Recv ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TCP_Recv($hCapture, $iInstance = 0, $iTimeOut = 3000) Local $blPacketCaptured = False, $iTimer_Capture, $aPacket, $iPacket $iTimer_Capture = TimerInit() While (TimerDiff($iTimer_Capture) < $iTimeOut Or $iTimeOut = -1) $aPacket = _PcapGetPacket($hCapture) If IsArray($aPacket) Then If $iPacket = $iInstance Then Local $aTCPPacket[21] $aTCPPacket[0] = StringMid($aPacket[3], 3, 12) ;Destination Mac Address $aTCPPacket[1] = StringMid($aPacket[3], 15, 12) ;Source Mac Address $aTCPPacket[2] = StringMid($aPacket[3], 27, 4) ;Type $aTCPPacket[3] = StringMid($aPacket[3], 31, 2) ;Version & Header length $aTCPPacket[4] = StringMid($aPacket[3], 33, 2) ;Differientiated Services Field $aTCPPacket[5] = StringMid($aPacket[3], 35, 4) ;Total Length $aTCPPacket[6] = StringMid($aPacket[3], 39, 4) ;Identification $aTCPPacket[7] = StringMid($aPacket[3], 43, 4) ;Fragment offset $aTCPPacket[8] = StringMid($aPacket[3], 47, 2) ;Time to live $aTCPPacket[9] = StringMid($aPacket[3], 49, 2) ;Protocol $aTCPPacket[10] = StringMid($aPacket[3], 51, 4) ;Header checksum $aTCPPacket[11] = StringMid($aPacket[3], 55, 8) ;Source IP Address $aTCPPacket[12] = StringMid($aPacket[3], 63, 8) ;Destination IP Address $aTCPPacket[13] = StringMid($aPacket[3], 71, 4) ;Source port $aTCPPacket[14] = StringMid($aPacket[3], 75, 4) ;Destination port $aTCPPacket[15] = StringMid($aPacket[3], 79, 8) ;Sequence number $aTCPPacket[16] = StringMid($aPacket[3], 87, 8) ;Acknowledgment number $aTCPPacket[17] = StringMid($aPacket[3], 95, 4) ;Flags $aTCPPacket[18] = StringMid($aPacket[3], 99, 4) ;Window size value $aTCPPacket[19] = StringMid($aPacket[3], 103, 4) ;Checksum ;107 to 110 = NULL data $aTCPPacket[20] = StringTrimLeft($aPacket[3], 110) ;Data Return $aTCPPacket EndIf $iPacket += 1 EndIf Sleep(50) WEnd Return -1 EndFunc ;==>_TCP_Recv ; #FUNCTION# ==================================================================================================================== ; Name...........: _UDP_Recv ; Description ...: Retreives an UDP Packet and returns its data splitted ; Syntax.........: _UDP_Recv($hCapture, $iInstance = 0, $iTimeOut = 3000) ; Parameters ....: $hCapture - Capture handle ; $iInstance - Instance of the packet to retreive ; $iTimeOut - Timeout ; Return values .: Success - Array containing the packet data ; Failure - -1 (timedout) ; Author ........: FireFox (d3mon) ; Modified.......: ; Remarks .......: ; Related .......: _TCP_Recv ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _UDP_Recv($hCapture, $iInstance = 0, $iTimeOut = 3000) Local $blPacketCaptured = False, $iTimer_Capture, $aPacket, $iPacket $iTimer_Capture = TimerInit() While (TimerDiff($iTimer_Capture) < $iTimeOut Or $iTimeOut = -1) $aPacket = _PcapGetPacket($hCapture) If IsArray($aPacket) Then If $iPacket = $iInstance Then Local $aUDPPacket[18] $aUDPPacket[0] = StringMid($aPacket[3], 3, 12) ;Source Mac Address $aUDPPacket[1] = StringMid($aPacket[3], 15, 12) ;Destination Mac Address $aUDPPacket[2] = StringMid($aPacket[3], 27, 4) ;Type $aUDPPacket[3] = StringMid($aPacket[3], 31, 2) ;Version & Header length $aUDPPacket[4] = StringMid($aPacket[3], 33, 2) ;Differientiated Services Field $aUDPPacket[5] = StringMid($aPacket[3], 35, 4) ;Total Length $aUDPPacket[6] = StringMid($aPacket[3], 39, 4) ;Identification $aUDPPacket[7] = StringMid($aPacket[3], 43, 4) ;Fragment offset $aUDPPacket[8] = StringMid($aPacket[3], 47, 2) ;Time to live $aUDPPacket[9] = StringMid($aPacket[3], 49, 2) ;Protocol $aUDPPacket[10] = StringMid($aPacket[3], 51, 4) ;Header checksum $aUDPPacket[11] = StringMid($aPacket[3], 55, 8) ;Source IP Address $aUDPPacket[12] = StringMid($aPacket[3], 63, 8) ;Destination IP Address $aUDPPacket[13] = StringMid($aPacket[3], 71, 4) ;Source port $aUDPPacket[14] = StringMid($aPacket[3], 75, 4) ;Destination port $aUDPPacket[15] = StringMid($aPacket[3], 79, 4) ;Length $aUDPPacket[16] = StringMid($aPacket[3], 83, 4) ;Checksum $aUDPPacket[17] = StringTrimLeft($aPacket[3], 86) ;Data Return $aUDPPacket EndIf $iPacket += 1 EndIf Sleep(50) WEnd Return -1 EndFunc ;==>_UDP_Recv ;for example convert the packet's source/dest IP Address to text ; #FUNCTION# ==================================================================================================================== ; Name...........: _HexIPAddressToText ; Description ...: Converts Hex IP Adress to text ; Syntax.........: _HexIPAddressToText($vhexIPAddress) ; Parameters ....: $vIPAddress - IP Address v4 (string, int) ; Return values .: Success - Converted IP Address ; Author ........: FireFox (d3mon) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _HexIPAddressToText($vhexIPAddress) Local $sIPAddress For $iOffset = 1 To 8 Step 2 $sIPAddress &= Dec(StringMid($vhexIPAddress, $iOffset, 2)) & "." Next Return StringTrimRight($sIPAddress, 1) EndFunc ;==>_UDP_DecodeIPAddress Ops, almost forgot the Winpcap UDF available here : http://opensource.grisambre.net/pcapau3/ PS : If you find this helpful, please "like"/rate this post. Enjoy1 point
-
Quick function for validating IPV6. It's not advanced, but can validate several notations. ; Default example If _ISIPV6IP('3ffe:1900:4545:3:200:f8ff:fe21:67cf') Then MsgBox(0, '', 'Valid IPV6 address!') ; Leading zeroes If _ISIPV6IP('2001:db8:85a3:0:0:8a2e:370:7334') Then MsgBox(0, '', 'Valid IPV6 address!') ; Groups of zeroes If _ISIPV6IP('2001:db8:85a3::8a2e:370:7334') Then MsgBox(0, '', 'Valid IPV6 address!') Func _ISIPV6IP($Addr) Return StringRegExp($Addr, "(([\da-f]{0,4}:{0,2}){1,8})") EndFunc1 point
-
Nice, I see a great opportunity to use in my project, thank you for sharing with us! Regards, João Carlos.1 point
-
Dunno, the patterns I linked to are pretty complex. I'd do it with StringReplace however: Func _ISIPV6IP($sAddr) StringReplace($sAddr, '::', '_') If @extended > 1 Then Return False Return StringRegExp($sAddr, "^(?i)([da-f]{1,4}|::)((:{0,2}[da-f]{0,4}){0,7})$") EndFunc With this addition it passes 359 of the 486 tests.1 point
-
A window's handle will change every time a program is run, you should be trying to get the window's handle before you run the pixelsearch instead of hardcoding the incorrect number in your script.1 point
-
Add Label to an *EXISTING* window
Mechaflash reacted to JLogan3o13 for a topic
You're missing guinness' point. Your "existing program window" was not created in AutoIt, so you can't change the GUI controls with AutoIt.1 point -
Add Label to an *EXISTING* window
Mechaflash reacted to guinness for a topic
AutoIt 'GUI native' controls can only modify AutoIt native controls. Your best option is to contact the developer to add the label.1 point -
I had an idea like this a couple of years ago, I opted to just use GUIRegisterMsg() and make functions and stick them inside the the regular WM command functions I created. However, looking over your code, I noticed a few things ( I didn't look to much, and probably went on a tangent with it ). Where you have the below: (This is just a thought, off the top of my head right this second, I haven't thought of total consequences, but I'd think you might want to do something like: I also noticed this in your callback function Example of why it wouldn't work: However, I'd probably re-write the function more like: I'd also look at maybe putting another global or 2, 1 to know the total number of indexes currently for your $avGRM_MSGIDS, and 1 for the max number of indexes to start with for sure so maybe you can get rid of that ReDim Example: Then somewhere where you'd have your Redims, create a function or insert code. Maybe something like: Having a higher index count to start and with fewer ReDims, you'll see a faster creation process.1 point
-
I would do it like this (simpler ): #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <WinAPI.au3> #include <GUIComboBox.au3> Global $hComboMenu, $hComboMenu_GUI _Main() Func _Main() Local $hForm, $iEdit $hForm = GUICreate("ComboBox like a Context Menu!", 400, 300) GUICtrlCreateButton("Button", 150, 250, 100, 25) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_SECONDARYUP If IsHWnd($hComboMenu_GUI) Then GUIDelete($hComboMenu_GUI) EndIf $tPoint = _WinAPI_GetMousePos() If _WinAPI_WindowFromPoint($tPoint) <> $hForm Then ContinueLoop EndIf $iLeft = MouseGetPos(0) $iTop = MouseGetPos(1) $hComboMenu_GUI = GUICreate('ComboMenu', 100, 25, $iLeft, $iTop, $WS_POPUP, -1, $hForm) $hComboMenu = GUICtrlGetHandle(GUICtrlCreateCombo("", 0, 0, 100, 30, BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))) _GUICtrlComboBox_AddString($hComboMenu, "Open file") _GUICtrlComboBox_AddString($hComboMenu, "Save As...") _GUICtrlComboBox_AddString($hComboMenu, "Close and save") _GUICtrlComboBox_AddString($hComboMenu, "Exit") _GUICtrlComboBox_SetCurSel($hComboMenu, 0) GUISetState(@SW_SHOWNOACTIVATE, $hComboMenu_GUI) _GUICtrlComboBox_ShowDropDown($hComboMenu, True) Case $GUI_EVENT_PRIMARYDOWN If Not IsHWnd($hComboMenu_GUI) Then ContinueLoop EndIf $tPoint = _WinAPI_GetMousePos() If _WinAPI_GetAncestor(_WinAPI_WindowFromPoint($tPoint), $GA_ROOT) <> $hForm Then $iSel = _GUICtrlComboBox_GetCurSel($hComboMenu) GUIDelete($hComboMenu_GUI) Switch $iSel Case 0 FileOpenDialog("Select to open image files...", @WindowsDir & "", "Images (*.jpg;*.bmp)", 1 + 4, "", $hForm) Case 1 FileSaveDialog("Choose a name.", "::{450D8FBA-AD25-11D0-98A8-0800361B1103}", "Scripts (*.aut;*.au3)", 2, "", $hForm) Case 3 Exit EndSwitch Else GUIDelete($hComboMenu_GUI) EndIf EndSwitch WEnd EndFunc1 point
-
Nice idea, but i thought that there is one main reason why this could be useful, and it's the scrolling option. You are using only $CBS_DROPDOWNLIST as combobox style, this one disables the scrolling option. Replace it with this: BitOr($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST) and now you can see that this kind of context menu is useful . P.S. And also i think you should pull out the File*Dialog functions from WM_COMMAND, because as docs states:1 point
-
Don't believe me? Here >> Local $aArray[4] = [3] $aArray[1] = 'AutoIt Test(1.26a) (243)' $aArray[2] = 'Some Text(new Version) (21)' $aArray[3] = 'Blah Blah(Blah Blah Blah)(8)' ; This will work on all. For $i = 1 To $aArray[0] ConsoleWrite(StringStripWS(StringLeft($aArray[$i], StringInStr($aArray[$i], '(', 2, -1) - 1), 3) & @CRLF) Next1 point
-
this can help explaining it1 point