Leaderboard
Popular Content
Showing content with the highest reputation on 09/22/2021 in all areas
-
Searching how to access javascript find few code by @genius257 & @Danyfirex and this link https://www.autoitscript.com/forum/topic/156794-oo_jsonudf-jsonpath-oo-using-javascript-in-auto-it/ #include "Json2.au3" ;__Example_2() ;__Example_3() __Example_4() ;__Example_5() ;__Example_6() ;__Example_7() Func __Example_2() Local $Js_String = '{"name":"John","cars":{"A": "Ford","B": "BMW","C": "Fiat","D": "Chevy"}}' Local $JsObj = __JsonObject() Local $ParseJson = __JsonParse($JsObj, $Js_String) If @Error Then Exit Local $0_Carsobj = $ParseJson.cars ConsoleWrite('1st item(A)-> ' & $0_Carsobj.item("A") & @Crlf) ConsoleWrite('1st item(B)-> ' & $0_Carsobj.item("B") & @Crlf) ConsoleWrite('1st item(C)-> ' & $0_Carsobj.C & @Crlf) ConsoleWrite('1st item(D)-> ' & $0_Carsobj.D & @Crlf) EndFunc Func __Example_3() Local $Js_String = '{"Company":"ABC","Model":[{"Car":"Ford","Color":"Red"},{"Car":"BMW","Color":"Blue"},' & _ '{"Car":"Fiat","Color":"Green"},{"Car":"Chevy","Color":"Black"}],"Price":0.00}' Local $JsObj = __JsonObject() Local $ParseJson = __JsonParse($JsObj, $Js_String) If @Error Then Exit Local $Get_Model = $ParseJson.Model For $i = 0 To $Get_Model.length - 1 ConsoleWrite($i & ': ' & $Get_Model.item($i).Car & @Tab) ConsoleWrite($Get_Model.item($i).Color & @CRLF) Next EndFunc Func __Example_4() Local $Js_String = '{"Company":"ABC","Data":[["A1",0.70],["B1",0.80],["C1",0.90],["D1",1.00]],"Plot":"No"}' Local $JsObj = __JsonObject() Local $ParseJson = __JsonParse($JsObj, $Js_String) If @Error Then Exit Local $Get_Model = $ParseJson.Data Local $oData For $i = 0 To $Get_Model.length - 1 $oData = $Get_Model.item($i) For $j = 0 To $oData.length - 1 ConsoleWrite($oData.item($j) & @Tab) Next ConsoleWrite(@CRLF) Next EndFunc Func __Example_5() Local $Js_String = '{"status":"OK","data":["156,195.75,265","157,295.95,365","158,395.95,465"]}' Local $JsObj = __JsonObject() Local $ParseJson = __JsonParse($JsObj, $Js_String) If @Error Then Exit Local $Get_Data = $ParseJson.data For $i = 0 To $Get_Data.length - 1 ConsoleWrite($Get_Data.item($i) & @Crlf) Next EndFunc Func __Example_6() Local $Js_String = '{"status":200,"payload":{"Name":"ABC","data":[[156,131,187],[157,132,188],[158,133,189]]}}' Local $JsObj = __JsonObject() Local $ParseJson = __JsonParse($JsObj, $Js_String) If @Error Then Exit Local $Get_Data = $ParseJson.payload.data Local $oData For $i = 0 To $Get_Data.length - 1 $oData = $Get_Data.item($i) For $j = 0 To $oData.length - 1 ConsoleWrite($oData.item($j) & @Tab) Next ConsoleWrite(@CRLF) Next EndFunc Func __Example_7() Local $Js_String = '{"status":"ok", "data":{ "Value":[["2019-04-04",712,146],["2019-04-05",713,147],["2019-04-06",714,148]]}}' Local $JsObj = __JsonObject() Local $ParseJson = __JsonParse($JsObj, $Js_String) If @Error Then Exit Local $Get_Data = $ParseJson.data.Value Local $oData For $i = 0 To $Get_Data.length - 1 $oData = $Get_Data.item($i) For $j = 0 To $oData.length - 1 ConsoleWrite($oData.item($j) & @Tab) Next ConsoleWrite(@CRLF) Next EndFunc important note: https://www.autoitscript.com/forum/topic/206694-json2-parse/?do=findComment&comment=1497016 Version 1: Json2.au3 Version 2: Json2.au31 point
-
Microsoft.XMLHTTP setproxy problem
beginner10 reacted to Zedna for a topic
Use WinHttpRequest: $o_http = ObjCreate("winhttp.winhttprequest.5.1") If $ini_proxy <> '' Then $o_http.SetProxy($HTTPREQUEST_PROXYSETTING_PROXY, $ini_proxy, "") ; 209.127.191.111:9279 If $ini_proxy_name <> '' Then $o_http.SetCredentials($ini_proxy_name, $ini_proxy_pwd, $HTTPREQUEST_SETCREDENTIALS_FOR_PROXY) EndIf $o_HTTP.Open('GET', $url, False) $o_HTTP.Send() ;If $o_HTTP.Status <> '200' Then ... $ret = $o_HTTP.Responsetext Global Const $HTTPREQUEST_PROXYSETTING_DEFAULT = 0 Global Const $HTTPREQUEST_PROXYSETTING_PRECONFIG = 0 Global Const $HTTPREQUEST_PROXYSETTING_DIRECT = 1 Global Const $HTTPREQUEST_PROXYSETTING_PROXY = 2 Global Const $HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0 Global Const $HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 11 point -
Reverse engineering is possible as soon as you can get your hands on the software and have enough knowledge of the hardware platform it's intended to run on. Limited knowledge of the hardware can be compensated by educated guesswork. Tamper-resistant hardware is expensive but many (if not most, given sufficient money) attempts have failed and have been successfully tampered with. Look: you're powerful and want to develop a proprietary CPU to resist reverse-engineering. You must have a team of fully trusted specialized CPU/peripherals design engineers, have your own silicon foundry again with fully trusted specialized engineers and have a team of fully trusted system/application programmers. That's a very large number of people that you've to trust long-term for not leaking any internal secrets until they die or till when reverse engineering the thing has no remnant value. Moreover you need to avoid huge mistakes in the design in the first place (remember the Clipper chip!) As an elementary example of how easy a non-trivial device can be reverse-engineered, look at how fast *one* resourceless retired hobbist is doing with a low-end (~120 US$) oscilloscope tablet: today about 85% of the thing is back to fixed running C source. https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/1000/ This effort (only one guy actually working on that) arose with this guy receiving a DOA device and he decided to fix it. The device uses an oldish ARM CPU without available datasheet so you don't know its architecture nor its instruction set, a large FPGA and a handful of unmarked chips. He started rev-engineering hardware around mid-February (circa page 26 of the thread) and he's now almost done with most of the software functions, thanks to Ghidra. He's even writen his own emulator for this particular ARM processor to "speed up his understanding of how things work". I'm following the thread as I own such a device and I expect we have a fixed and enhanced open-source version by the end of the year. Give this task to a dozen hungry motivated young engineers working 18h/day with some good resources and you get the whole thing wide open in 1 - 2 weeks. White-, grey-, black-hat conferences regularly show the power of teams fully involved and knowledgeable in rev-engineering of potentially "anything with software inside".1 point
-
[Solved]Close Multiple GUI
abdulrahmanok reacted to spudw2k for a topic
The AutoIt help file has a very helpful article for using it. Enum I use it particularly when working with arrays to help myself keep the indexes straight in my mind.1 point -
[Solved]Close Multiple GUI
abdulrahmanok reacted to spudw2k for a topic
I used those just to make it more human readable friendly when accessing the sub-indexes of the $FoundPixs array. $FoundPixs[index#][$ePIXELLOCATION] = the pixel coordinates $FoundPixs[index#][$eGUIHANDLE] = the handle returned by the GUICreate() function I never used the $ePIXELLOCATION constant later in the script, but I did use the $eGUIHANDLE constant in the GUIDelete() function.1 point -
I would even go one step further. 99.9% of all scripts created with AutoIt accomplish ordinary (daily) tasks. No one would ever think of using AutoIt to develop the control software for a Warp Drive, and so there is no serious motivation to decompile scripts at all .1 point
-
My favorite oddball behaviour: Incorrect vars being set
Leendert-Jan reacted to Tripredacus for a topic
so far so good.1 point -
AutoIt Snippets
Exit reacted to argumentum for a topic
I needed _DateDiff() to include milliseconds. ConsoleWrite('>>> ' & _DateDiffMs('2021/08/16 13:25:08.727', '2021/08/16 13:25:08.729') & @CRLF) Func _DateDiffMs($sDate1st, $sDate2nd) Local $iDate1st, $aDate1st = StringSplit($sDate1st, ".") ReDim $aDate1st[3] Local $iDate2nd, $aDate2nd = StringSplit($sDate2nd, ".") ReDim $aDate2nd[3] Local $iDate1st = _DateDiff('s', '1970/01/01 00:00:00', $aDate1st[1]) Local $iDate2nd = _DateDiff('s', '1970/01/01 00:00:00', $aDate2nd[1]) $iDate1st &= "000" $iDate2nd &= "000" $iDate1st += Int($aDate1st[2]) $iDate2nd += Int($aDate2nd[2]) Return ( $iDate2nd - $iDate1st ) / 1000 EndFunc1 point -
It is not too difficult just do the following: Local $sCommand = 'Local $sMsg = "Hello", $Dummy = MsgBox(0,"Debug", $sMsg)' $sCommand = Stringreplace($sCommand,'"', '""') $sCommand = '"' & $sCommand & '"' Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $sCommand) Jos1 point
-
Shikuri, Welcome to the AutoIt forums. You could do it like this: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cButton = GUICtrlCreateCheckbox("On", 10, 10, 80, 30, $BS_PUSHLIKE) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton Switch GUICtrlRead($cButton) Case $GUI_CHECKED GUICtrlSetData($cButton, "Off") MsgBox($MB_SYSTEMMODAL, "Button", "ON") Case Else GUICtrlSetData($cButton, "On") MsgBox($MB_SYSTEMMODAL, "Button", "OFF") EndSwitch EndSwitch WEnd As you are a complete beginner to AutoIt (and we all were at one point, so no problem at all) reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at this excellent tutorial - you will find other tutorials in the Wiki (the link is at the top of the page). M231 point
-
I hope you like it. #Region _GuiCtrlSetFont.au3 ;Copyrights to funkey !! #include <WinAPI.au3> OnAutoItExitRegister("_FontCleanUp") Global $ahFontEx[1] = [0] Func _GuiCtrlSetFont($controlID, $size, $weight = 400, $attribute = 0, $rotation = 0, $fontname= "", $quality = 2) Local $fdwItalic = BitAND($attribute, 1) Local $fdwUnderline = BitAND($attribute, 2) Local $fdwStrikeOut = BitAND($attribute, 4) ReDim $ahFontEx[UBound($ahFontEx) + 1] $ahFontEx[0] += 1 $ahFontEx[$ahFontEx[0]] = _WinAPI_CreateFont($size, 0, $rotation * 10, $rotation, $weight, _ $fdwItalic, $fdwUnderline, $fdwStrikeOut, -1, 0, 0, $quality, 0, $fontname) GUICtrlSendMsg($controlID, 48, $ahFontEx[$ahFontEx[0]], 1) EndFunc Func _FontCleanUp() For $i = 1 To $ahFontEx[0] _WinAPI_DeleteObject($ahFontEx[$i]) Next EndFunc #EndRegion Global $hGui1 = GuiCreate("AutoIt Main-GUI", 300, 340, 100, 100, -1, 0); For $i = 0 To 350 Step 30 GUICtrlCreateLabel("This is rotating", 50, 0, 300, 220, 0x201) _GuiCtrlSetFont(-1, 15, 1000, 1, $i) GUICtrlSetBkColor(-1, -2) Next GUICtrlCreateLabel("This is a vertical label", 10, 30,200, 200, 0x001) _GuiCtrlSetFont(-1, 15, 400, 1, -90) GUICtrlSetBkColor(-1, -2) GUICtrlCreateLabel("This too!!", 130, 50, 200, 200, 0x202) _GuiCtrlSetFont(-1, 15, 400, 1, 90) GUICtrlSetBkColor(-1, -2) GuiCtrlCreateButton("This is a cool button text", 10, 220, 275, 60, 0x0800); _GuiCtrlSetFont(-1, 20, 1000, 1, 8) GuiCtrlCreateCombo("Hello", 10, 290, 275, 80, 0x3, -1); _GuiCtrlSetFont(-1, 15, 1000, 1, -3) GUICtrlSetData(-1, "Item2|Item3") GuiSetState(@SW_SHOW, $hGui1); Do Until GUIGetMsg() = -31 point
-
Even then, a little play with Ghidra will ruin the hope of a software secret.0 points