Leaderboard
Popular Content
Showing content with the highest reputation on 08/31/2021 in all areas
-
SciTE Editor works, but running from .exe does not?
JockoDundee and one other reacted to Jos for a topic
Let me guess: you called the script notepad.au3 , hence the compiled script is called notepad.exe? Get it?2 points -
@Jos Your crystal ball has returned from the repair shop as I can see...1 point
-
Hello @Mateocedillo first let me tell you that you're amazing. I try to think how you solve programming task and problem, It makes my brain collapse. It's very hard to help due to we probably don't share same perspective of the things. But I'll try to help you with a small explanation of the option Opt("GUICoordMode", 2) usage. #include <GUIConstantsEx.au3> Example() Func Example() Opt("GUICoordMode", 2) ;relative to cell mode GUICreate("My GUI Set Coord") ;~ GUISetCoord(0, 0) ;this is default position start at 0,0 left top corner for that reason It's commented maybe not needed at this point ;Imagine this as table of cell (we add 3 checkboxes one on the right side of the other) in the first imaginary row GUICtrlCreateCheckbox("Checkbox #1", 20, 10) ;at position 0,0 we Add checkbox1 - parameter 20 means x position and 10 means y position, both relative to GUISetCoord setted GUICtrlCreateCheckbox("Checkbox #2", 10, -1) ;at position 0,1 we add CheckBox2 - parameter 10 means space in pixel between last control and new one, parameter -1 means add in same y position like my last control GUICtrlCreateCheckbox("Checkbox #3", 10, -1) ;at position 0,2 we add CheckBox3 - parameter 10 means space in pixel between last control and new one, parameter -1 means add in same y position like my last control GUISetCoord(20, 60) ;this defines where my other rwo will start 20 means the x relative position and 60 my y relative postion. ;very important y position to avoid new controls over last added control try to set to a value greater than the sum of the height or the last controls. like we added just one row before, it will be ok height of a checkbox plus a number of pixel for separate let's say checkbox height was 20 and we sum 40 as space between last rwo and new one ;lets add two button one on the right side of the other GUICtrlCreateButton("OK #1", -1, -1) ;at position 0,0 first parameter -1 means default x position previous defined by GUISetCoord it was 20, second parameter means default y position defined by GUISetCoord it was 60 GUICtrlCreateButton("Cancel #2", 10, -1);at position 0,1 first parameter 10 means 10 space between last button and new one and parameter -1 mean keep y position GUISetState(@SW_SHOW) ; will display an empty dialog box ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>Example I hope it helps you. I speak Spanish too so Maybe I could help you by private message or maybe I could add you in WhatsApp. Send me private message. Saludos1 point
-
IUIAutomation MS framework automate chrome, FF, IE, ....
Earthshine reacted to junkew for a topic
Just another simple spy in powershell that helps in automating and trying out different patterns Usage Open powershell ISE (5.1 is fine) Run the script it will extend the ISE environment with a new menu (but more importantly a hotkey) Hover your mouse to your object of interest Press ctrl+shift+w You should see some output in your ISE window Play with your $ae automation element from the cmdline Extend the get-elementInfo function to your own ideas (run only function as it will reload directly) #region load the most important GUI assemblies Add-Type –AssemblyName UIAutomationClient Add-Type –AssemblyName UIAutomationTypes Add-Type –AssemblyName UIAutomationProvider Add-Type –AssemblyName UIAutomationClientsideProviders Add-Type -AssemblyName System.Windows.Forms [void] [System.Reflection.Assembly]::LoadWithPartialName("'Microsoft.VisualBasic") #endregion #region addons $spyName='Spy' $MyEntry = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus | ?{$_.DisplayName -eq $spyName} if ($myEntry -ne $null) {$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Remove($MyEntry)} $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add( $spyName, { get-elementInfo }, "CTRL+SHIFT+W") #endregion function get-elementInfo() { $Mouse = [System.Windows.Forms.Cursor]::Position $global:ae = [System.Windows.Automation.AutomationElement]::FromPoint([system.windows.point]::new($mouse.x,$mouse.y)) $ae.current } So you could hover over your browser addressbar to get it "selected" And then play around with the different patterns from the blue cmdline ise window $ae.getcurrentpattern([Windows.Automation.ValuePattern]::Pattern).setvalue("Hello world") and to click if its a button $ae.GetCurrentPattern([Windows.Automation.InvokePattern]::Pattern).Invoke()1 point -
FWIW, I don't know Python either. I just found discussions like this one and then attempted to code it in AutoIt.1 point
-
1 point
-
Here's an initial attempt at decoding a protobuf. Anyone is welcome to make improvements / corrections -- $sData = "CgNQQ0cVH4UvQRiQvr/a4lsqA05ZUTAIOAFFKBlXQUj61YQeZWhmpj/YAQQ=" ;~ Results from https://protogen.marcgravell.com/decode ;~ Field #1: 0A String Length = 3, Hex = 03, UTF8 = "PCG" ;~ Field #2: 15 Fixed32 Value = 1093633311, Hex = 1F-85-2F-41 ;~ Field #3: 18 Varint Value = 3153232650000, Hex = 90-BE-BF-DA-E2-5B ;~ Field #5: 2A String Length = 3, Hex = 03, UTF8 = "NYQ" ;~ Field #6: 30 Varint Value = 8, Hex = 08 ;~ Field #7: 38 Varint Value = 1, Hex = 01 ;~ Field #8: 45 Fixed32 Value = 1096227112, Hex = 28-19-57-41 ;~ Field #9: 48 Varint Value = 62991098, Hex = FA-D5-84-1E ;~ Field #12: 65 Fixed32 Value = 1067869800, Hex = 68-66-A6-3F ;~ Field #27: D8-01 Varint Value = 4, Hex = 04 $bData = _Base64Decode($sData) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $bData = ' & $bData & @CRLF) ;### Debug Console $iPos = 1 $iLen = BinaryLen($bData) While $iPos <= $iLen $bTag = BinaryMid($bData, $iPos, 1) $bField = BitShift($bTag, 3) $iWire = BitAND($bTag, 7) ;~ ConsoleWrite("+> $iPos = " & $iPos & " - $bTag = " & $bTag & " - $bField = " & $bField & " - $iWire = " & $iWire & @crlf) If BitAND($bField, 16) Then $bTag = BinaryMid($bData, $iPos + 1, 1) & BitAND($bField, 16) $iPos += 1 EndIf Switch $iWire Case 0 ; VarInt $iEnd = $iPos + 1 While $iEnd <= $iLen $bCompare = BinaryMid($bData, $iEnd, 1) If Not BitAND($bCompare, 128) Then ExitLoop $iEnd += 1 WEnd $sResult = BinaryToString(BinaryMid($bData, $iPos + 1, $iEnd - $iPos)) ConsoleWrite("(" & $iPos & ") " & $bField & " - " & Binary($sResult) & @crlf) $iPos = $iEnd Case 1 ; Fixed64 Case 2 ; Length-delimited $bLen = BinaryMid($bData, $iPos + 1, 1) $sResult = BinaryToString(BinaryMid($bData, $iPos + 2, $bLen)) ConsoleWrite("(" & $iPos & ") " & $bField & " - " & $sResult & @crlf) $iPos += Number($bLen) + 1 Case 3 ; start group Case 4 ; end group Case 5 ; Fixed32 $sResult = BinaryToString(BinaryMid($bData, $iPos + 1, 4)) ConsoleWrite("(" & $iPos & ") " & $bField & " - " & Binary($sResult) & @crlf) $iPos += 4 EndSwitch $iPos += 1 WEnd Func _Base64Decode($input_string) Local $struct = DllStructCreate("int") $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _ "str", $input_string, _ "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", $input_string, _ "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 ;==>_Base64Decode1 point
-
1 point