Leaderboard
Popular Content
Showing content with the highest reputation on 05/13/2013 in all areas
-
Introduction JSON (Javascript Object Notation) is a popular data-interchange format and supported by a lot of script languages. On AutoIt, there is already a >JSON UDF written by Gabriel Boehme. It is good but too slow, and not supports unicode and control characters very well. So I write a new one (and of course, fast one as usual). I use a machine code version of JSON parser called "jsmn". jsmn not only supports standard JSON, but also accepts some non-strict JSON string. See below for example. Important Update!! I rename the library from jsmn.au3 to json.au3. All function names are changed, too. Decoding Function Json_Decode($Json) $Json can be a standard or non-standard JSON string. For example, it accepts: { server: example.com port: 80 message: "this looks like a config file" } The most JSON data type will be decoded into corresponding AutoIt variable, including 1D array, string, number, true, false, and null. JSON object will be decoded into "Windows Scripting Dictionary Object" retuned from ObjCreate("Scripting.Dictionary"). AutoIt build-in functions like IsArray, IsBool, etc. can be used to check the returned data type. But for Object and Null, Json_IsObject() and Json_IsNull() should be used. If the input JSON string is invalid, @Error will be set to $JSMN_ERROR_INVAL. And if the input JSON string is not finish (maybe read from stream?), @Error will be set to $JSMN_ERROR_PART. Encoding Function Json_Encode($Data, $Option = 0, $Indent = "\t", $ArraySep = ",\r\n", $ObjectSep = ",\r\n", $ColonSep = ": ") $Data can be a string, number, bool, keyword(default or null), 1D arrry, or "Scripting.Dictionary" COM object. Ptr will be converted to number, Binary will be converted to string in UTF8 encoding. Other unsupported types like 2D array, dllstruct or object will be encoded into null. $Option is bitmask consisting following constant: $JSON_UNESCAPED_ASCII ; Don't escape ascii charcters between chr(1) ~ chr(0x1f) $JSON_UNESCAPED_UNICODE ; Encode multibyte Unicode characters literally $JSON_UNESCAPED_SLASHES ; Don't escape / $JSON_HEX_TAG ; All < and > are converted to \u003C and \u003E $JSON_HEX_AMP ; All &amp;amp;amp;s are converted to \u0026 $JSON_HEX_APOS ; All ' are converted to \u0027 $JSON_HEX_QUOT ; All " are converted to \u0022 $JSON_PRETTY_PRINT ; Use whitespace in returned data to format it $JSON_STRICT_PRINT ; Make sure returned JSON string is RFC4627 compliant $JSON_UNQUOTED_STRING ; Output unquoted string if possible (conflicting with $JSMN_STRICT_PRINT) Most encoding option have the same means like PHP's json_enocde() function. When $JSON_PRETTY_PRINT is set, output format can be change by other 4 parameters ($Indent, $ArraySep, $ObjectSep, and $ColonSep). Because these 4 output format parameters will be checked inside Jsmn_Encode() function, returned string will be always accepted by Jsmn_Decode(). $JSON_UNQUOTED_STRING can be used to output unquoted string that also accetped by Jsmn_Decode(). $JSON_STRICT_PRINT is used to check output format setting and avoid non-standard JSON output. So this option is conflicting with $JSON_UNQUOTED_STRING. Get and Put Functions Json_Put(ByRef $Var, $Notation, $Data, $CheckExists = False) Json_Get(ByRef $Var, $Notation) These functions helps user to access object or array more easily. Both dot notation and square bracket notation can be supported. Json_Put() by default will create non-exists objects and arrays. For example: Local $Obj Json_Put($Obj, ".foo", "foo") Json_Put($Obj, ".bar[0]", "bar") Json_Put($Obj, ".test[1].foo.bar[2].foo.bar", "Test") Local $Test = Json_Get($Obj, '["test"][1]["foo"]["bar"][2]["foo"]["bar"]') ; "Test" Object Help Functions Json_ObjCreate() Json_ObjPut(ByRef $Object, $Key, $Value) Json_ObjGet(ByRef $Object, $Key) Json_ObjDelete(ByRef $Object, $Key) Json_ObjExists(ByRef $Object, $Key) Json_ObjGetCount(ByRef $Object) Json_ObjGetKeys(ByRef $Object) Json_ObjClear(ByRef $Object) These functions are just warps of "Scripting.Dictionary" COM object. You can use these functions if you are not already familiar with it. == Update 2013/05/19 == * Add Jsmn_Encode() option "$JSMN_UNESCAPED_ASCII". Now the default output of Json_Encode() is exactly the same as PHP's json_encode() function (for example, chr(1) will be encoded into u0001). $JSON_UNESCAPED_ASCII ; Don't escape ascii charcters between chr(1) ~ chr(0x1f) == Update 2015/01/08 == * Rename the library from jsmn.au3 to json.au3. All function names are changed, too. * Add Json_Put() and Json_Get() * Add Null support * Using BinaryCall.au3 to loading the machine code. == Update 2018/01/13== (Jos) * Add JsonDump() to list all Json Keys and their values to easily figure out what they are. == Update 2018/10/01== (Jos) * Fixed JsonDump() some fields and values were not showing as discussed here - tnx @TheXman . == Update 2018/10/01b== (Jos) * Added Json_ObjGetItems, Tidied source and fixed au3check warnings - tnx @TheXman . == Update 2018/10/28== (Jos) * Added declaration for $value to avoid au3check warning - tnx @DerPensionist == Update 2018/12/16== (Jos) * Added another declaration for $value to avoid au3check warning and updated the version at the top - tnx @maniootek == Update 2018/12/29== (Jos) * Changed Json_ObjGet() and Json_ObjExists() to allow for multilevel object in string. == Update 2019/01/17== (Jos) * Added support for DOT notation in JSON functions. == Update 2019/07/15== (Jos) * Added support for reading keys with a dot inside when using a dot as separator (updated) == Update 2021/11/18== (TheXman) * Update details in below post: == Update 2021/11/20== (TheXman) * Minor RegEx update, no change to the functionality or result._Json(2021.11.20).zip1 point
-
HotStrings - String hotkeys
u0i299pg reacted to jvanegmond for a topic
HotStrings are similar to AutoIts HotKey function but they trigger on a string of characters, instead of a key or key combination. This has been built because of popular requested from the community. Instructions for use: Download the HotString.au3 (from the GitHub link) and put it in the same directory as your script. Then try out the code example below, or use the library in your own application. Please visit https://github.com/jvanegmond/hotstrings for the download (download zip in bottom right). Or get it directly from master. Example #include <HotString.au3> HotStringSet("callme{enter}", examplefunction) While 1 Sleep(10) WEnd Func examplefunction() MsgBox(0,"","You typed callme! :)") EndFunc1 point -
mesale0077 asked me whether I could code some CSS loading animations from different web sites. These are the results using GDI+ (AutoIt v3.3.12.0+ required!): _GDIPlus_MonochromaticBlinker.au3 / _GDIPlus_RotatingBokeh.au3 _GDIPlus_SpinningCandy.au3 / _GDIPlus_SteamPunkLoading.au3 _GDIPlus_IncreasingBalls.au3 / _GDIPlus_PacmanProgressbar.au3 _GDIPlus_StripProgressbar.au3 / _GDIPlus_RingProgressbar.au3 _GDIPlus_LineProgressbar.au3 / _GDIPlus_SimpleLoadingAnim.au3 _GDIPlus_TextFillingWithWater.au3 / _GDIPlus_MultiColorLoader.au3 _GDIPlus_LoadingSpinner.au3 / _GDIPlus_SpinningAndPulsing.au3 _GDIPlus_TogglingSphere.au3 / _GDIPlus_CloudySpiral.au3 _GDIPlus_GlowingText.au3 (thanks to Eukalyptus) / _GDIPlus_HypnoticLoader.au3 _GDIPlus_RotatingRectangles.au3 / _GDIPlus_TRONSpinner.au3 _GDIPlus_RotatingBars.au3 / _GDIPlus_AnotherText.au3 (thanks to Eukalyptus) _GDIPlus_CogWheels.au3 (thanks to Eukalyptus) / _GDIPlus_DrawingText.au3 (thanks to Eukalyptus) _GDIPlus_GearsAnim.au3 / _GDIPlus_LEDAnim.au3 _GDIPlus_LoadingTextAnim.au3 / _GDIPlus_MovingRectangles.au3 _GDIPlus_SpinningAndGlowing.au3 (thanks to Eukalyptus) / _GDIPlus_YetAnotherLoadingAnim.au3 _GDIPlus_AnimatedTypeLoader.au3 / _GDIPlus_Carousel.au3 Each animation function has a built-in example how it can be used. AiO download: GDI+ Animated Wait Loading Screens.7z (previous downloads: 1757) Big thanks to Eukalyptus for providing several examples. Maybe useful for some of you Br, UEZ PS: I don't understand CSS - everything is made out of my mind, so it might be different from original CSS examples1 point
-
Pastebin UDF
fede97 reacted to mrflibblehat for a topic
Hi All, Please see code attached for my first UDF Attempt, I needed some functions for pastebin so decided to clean them up a bit and share with you guys. You need to add your Pastebin Developer Key to the top of the UDF for functionality. Hope someone finds these useful. You will need the WinHttp.au3 UDF to make this work. https://code.google.com/p/autoit-winhttp/downloads/list #Include-Once #include <WinHttp.au3> ; #INDEX# ========================================================================================= ; Title .........: Pastebin UDF ; AutoIt Version : 3.3.8++ ; Language ..... : English ; Description ...: Functions for use with Pastebin.com API ; Author(s) .....: mrflibblehat (danielcarroll@gmail.com) ; ================================================================================================= ; #GLOBALS# ===================================================================================== Global Const $vPasteBin = "pastebin.com" ;~ PasteBin Website Global Const $vAPIDevKey = "" ;~ Obtain The Developer Key From Pastebin Global $vOpen = 0, $vConnect = 0 ; =============================================================================================== ; #CURRENT# ======================================================================================= ;_PB_Open ;_PB_Close ;_CreatePaste ;_DeletePaste ;_CreateAPIUserKey ;_ListUserPastes ;_ListTrendingPastes ;_UserDetails ;_GetRawPaste ; ================================================================================================= ; #FUNCTION# ==================================================================================================================== ; Name...........: _PB_Open ; Description ...: Create Session and Connection Handle ; Syntax.........: _PB_Open ; Return values .: Failure - Returns 0 and Sets @Error: ; |@error = 1 - Error Opening WinHTTP Handle ; |@error = 2 - Error Opening WinHTTPConnect Handle ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _PB_Open() $vOpen = _WinHttpOpen() if (@error) then Return SetError(1, 0, "Error Opening WinHTTP Handle") $vConnect = _WinHttpConnect($vOpen, $vPasteBin) if (@error) then Return SetError(2, 0, "Error Opening WinHTTPConnect Handle") EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _PB_Close ; Description ...: Close Session and Connection Handle ; Syntax.........: _PB_Close ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _PB_Close() _WinHttpCloseHandle($vConnect) _WinHttpCloseHandle($vOpen) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _CreatePaste ; Description ...: Creates a new paste and returns pastebin link ; Syntax.........: _CreatePaste($vPasteCode, $vPasteName[, $vPasteFormat = "text"[, $vPublicity = 1[, $vPasteExpireDate = "N" [, $vAPIUserKey = ""]]]] ) ; Parameters ....: $vPasteCode - Put Paste Code Here ; $vPasteName - Name of Your Paste ; $vPasteFormat - Set Syntax Highlighting Format (autoit, php, c, c++, vb, html etc) ; $vPublicity - Set The Publicity of Your Paste (0 = Public, 1 = Private, 2 = Unlisted) ; $vPasteExpireDate - Set The Paste Expiry Date (N = Never, 10M = 10 Minutes, 1D = 1 Day, 1W = 1 Week etc) ; $vAPIUserKey - To Paste as a User, Only if You Have Created an API User Key (See _CreateAPIUserKey) ; Return values .: Success - Returns Pastebin Paste Link ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _CreatePaste($vPasteCode, $vPasteName, $vPasteFormat = "text", $vPublicity = 1, $vPasteExpireDate = "N", $vAPIUserKey = "") Local $sData = ("api_option=paste&api_user_key=" & $vAPIUserKey & "&api_paste_private=" & $vPublicity & "&api_paste_name=" & $vPasteName & "&api_paste_expire_date= " & $vPasteExpireDate & "&api_paste_format=" & $vPasteFormat & "&api_dev_key=" & $vAPIDevKey & "&api_paste_code=" & $vPasteCode) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _CreateAPIUserKey ; Description ...: Creates an API User Key ; Syntax.........: _CreateAPIUserKey($vUsername, $vPassword) ; Parameters ....: $vUsername - Pastebin Username ; $vPassword - Pastebin Password ; Return values .: Success - Returns Pastebin API User Key ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _CreateAPIUserKey($vUsername, $vPassword) Local $sData = ("api_dev_key=" & $vAPIDevKey & "&api_user_name=" & $vUsername & "&api_user_password=" & $vPassword) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _ListUserPastes ; Description ...: List Pastes by Given API User Key ; Syntax.........: _CreateAPIUserKey($vAPIUserKey[, $vAPIResultsLimit = 50]) ; Parameters ....: $vAPIUserKey - Pastebin API User Key ; $vAPIResultsLimit - Limit Results Displayed ; Return values .: Success - Returns List of Pastebin Pastes ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _ListUserPastes($vAPIUserKey, $vAPIResultsLimit = 50) Local $sData = ("api_option=list&api_user_key=" & $vAPIUserKey &"&api_dev_key=" & $vAPIDevKey & "&api_results_limit=" & $vAPIResultsLimit) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _ListTrendingPastes ; Description ...: Creates an API User Key ; Syntax.........: _ListTrendingPastes() ; Parameters ....: ; Return values .: Success - Returns a 0 based array showing top trends ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _ListTrendingPastes() Local $vDataArr[18][10] Local $sData = ("api_option=trends&api_dev_key=" & $vAPIDevKey) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") $vPasteKey = StringRegExp($vRequest, "<paste_key>(.*?)</paste_key>", 3) $vPasteDate = StringRegExp($vRequest, "<paste_date>(.*?)</paste_date>", 3) $vPasteTitle = StringRegExp($vRequest, "<paste_title>(.*?)</paste_title>", 3) $vPasteSize = StringRegExp($vRequest, "<paste_size>(.*?)</paste_size>", 3) $vPasteExpiry = StringRegExp($vRequest, "<paste_expire_date>(.*?)</paste_expire_date>", 3) $vPastePrivate = StringRegExp($vRequest, "<paste_private>(.*?)</paste_private>", 3) $vPasteFormatL = StringRegExp($vRequest, "<paste_format_long>(.*?)</paste_format_long>", 3) $vPasteFormatS = StringRegExp($vRequest, "<paste_format_short>(.*?)</paste_format_short>", 3) $vPasteURL = StringRegExp($vRequest, "<paste_url>(.*?)</paste_url>", 3) $vPasteHits = StringRegExp($vRequest, "<paste_hits>(.*?)</paste_hits>", 3) For $i = 0 to 17 $vDataArr[$i][0] = $vPasteKey[$i] ;~ Paste Key $vDataArr[$i][1] = $vPasteDate[$i] ;~ Paste Date $vDataArr[$i][2] = $vPasteTitle[$i] ;~ Paste Title $vDataArr[$i][3] = $vPasteSize[$i] ;~ Paste Size (KB) $vDataArr[$i][4] = $vPasteExpiry[$i] ;~ Paste Expiry Time $vDataArr[$i][5] = $vPastePrivate[$i] ;~ Paste Publicity $vDataArr[$i][6] = $vPasteFormatL[$i] ;~ Paste Format Long $vDataArr[$i][7] = $vPasteFormatS[$i] ;~ Paste Formate Short $vDataArr[$i][8] = $vPasteURL[$i] ;~ Paste URL $vDataArr[$i][9] = $vPasteHits[$i] ;~ Paste Hits Next Return SetError(0, 0, $vDataArr) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _DeletePaste ; Description ...: Delete a Given Users Paste ; Syntax.........: _DeletePaste($vAPIUserKey, $vPasteKey) ; Parameters ....: $vAPIUserKey - Pastebin API User Key ; $vPasteKey - Paste Key, Obtained From _ListUserPastes Function ; Return values .: Success - Deletes Paste Returns "Paste Removed" ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _DeletePaste($vAPIUserKey, $vPasteKey) Local $sData = ("api_option=delete&api_user_key=" & $vAPIUserKey & "&api_dev_key=" & $vAPIDevKey & "&api_paste_key=" & $vPasteKey) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _UserDetails ; Description ...: Delete a Given Users Paste ; Syntax.........: _UserDetails($vAPIUserKey) ; Parameters ....: $vAPIUserKey - Pastebin API User Key ; Return values .: Success - Returns User Details ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _UserDetails($vAPIUserKey) Local $sData = ("api_option=userdetails&api_user_key=" & $vAPIUserKey & "&api_dev_key=" & $vAPIDevKey) Local $vRequest = _WinHttpSimpleRequest($vConnect, "POST", "/api/api_post.php", $WINHTTP_NO_REFERER, $sData, "Content-Type: application/x-www-form-urlencoded") if (@error) then Return SetError(3, 0, "Unable To Send Request") Return SetError(0, 0, $vRequest) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _GetRawPaste ; Description ...: Delete a Given Users Paste ; Syntax.........: _GetRawPaste($vPasteUrl) ; Parameters ....: $vPasteUrl - Pastebin URL ; Return values .: Success - Returns Paste ; Author ........: mrflibblehat (danielcarroll@gmail.com) ; =============================================================================================================================== Func _GetRawPaste($vPasteUrl) $vPasteKey = StringRegExp($vPasteUrl, "pastebin.com/(\H+)", 3) if (@error) then Return SetError(3, 0, "Unable To Read URL") Local $vRequest = _WinHttpSimpleRequest($vConnect, "GET", "/raw.php?i=" & $vPasteKey[0]) if (@error) then Return SetError(3, 0, "Unable To Connect To URL") Return SetError(0, 0, $vRequest) EndFunc Example #Include <Pastebin.au3> #include <Array.au3> _PB_Open() ;~ Create A New Paste And Return URL To Console $vPaste = _CreatePaste("This is a test paste", "Title of Test Paste") ConsoleWrite("Created Paste: " & $vPaste & @CRLF) ;~ Get Trending Pastes And Show in _ArrayDisplay $vTrends = _ListTrendingPastes() _ArrayDisplay($vTrends) ;~ Print Paste To Console $RawPaste = _GetRawPaste("http://pastebin.com/8sTHzAD7") ConsoleWrite("Raw Paste: " & $RawPaste) _PB_Close()1 point -
Reluctantly asking for some help Please.
Nilywxywml reacted to Cabler for a topic
Hi Im Ricky I have been trying set something up for a long time now many months and have done a lot of googling and reading the forums/researching gleaming info here and there before coming here and asking for some help I am of the older generation not long before I draw my pension but after a couple of heart attacks and two strokes do stuggle at times with trying to figure out some of the script stuff but I do try to keep the grey matter alive.. Ok down to buisiness.. I need access to my pc remotely when I am away from home so I use wol to start my pc remotely over the internet, the router I use I have to enable telnet mode by accessing a hidden web page on the router and log in then I have telnet access..I then set up a static arp to my pc so as it knows where to send the wol magic packet to wake it up if I dont do this then when the pc is shut down the router clears the arp cache and doesnt know where to send the magic packet..ok so far this is all well and good but if I have a power failure of the router reboots then all is lost and it goes back to default no telnet acces and no static arp route to my pc so no remote access.. Ok I decided to write a script that when the computer is auto powered on early in the am it runs a script that opens an ie windows and navigates to the enable telnet page logs in with user name and password then closes it then it calls a program/script called arse (Automatic Router Scripting Engine is a tool to send command scripts to your router automatically via telnet)written in autoit by cor a very nice utility.. which sets the static arp.. thats it.. The problem I am having is that it works fine half a dozen or so times then for some reason it seems to lose focus of the login window and does nothing unless I click anyware in the login window the it logs in and closes the ie session and then runs arse as it should do. What I was hopeing for was someone to cast an eye over the script and see if theres any faults or maybe a better way to do this so as it is reliable and doesnt loose focus on the login popup.. anyways thanks for your time heres the script regards Ricky #AutoIt3Wrapper_UseX64=N $uNAME = "user" ;Change to your username to your router username $uPASS = "pass" ;Change to your password to your router password $oIE = ObjCreate ( "InternetExplorer.Application" ) $oIE.Visible = 1 $oIE.Left = 600 $oIE.Top = 300 $oIE.Width = @DesktopWidth /4.4 $oIE.Height = @DesktopHeight /3.4 $oIE.Menubar = 0 $oIE.Toolbar = 0 $oIE.Statusbar = 0 $oIE.Resizable = 0 $uRL = "192.168.1.2/setup.cgi?todo=debug" ;Send the command to enable telnet on dgnd3700v2 $oIE.Navigate ($uRL) Sleep (800) WinWaitActive ("Windows Security", "" ,1000000) WinActivate ("Windows Security") ControlSetText("Windows Security", "", "Edit1", ($uNAME)) Sleep (500) ControlSetText("Windows Security", "", "Edit2",($uPASS)) Sleep (500) ControlClick ("Windows Security", "", "Button2") Sleep (500) controlfocus("http://192.168.1.2/setup.cgi?todo=debug - Windows Internet Explorer", "Class:IEFramehttp://192.168.1.2/setup.cgi?todo=debug - Windows Internet Explorer", "Internet Explorer_Server1");Focus on the finished ie window Sleep (100) WinClose("http://192.168.1.2/setup.cgi?todo=debug - Windows Internet Explorer") ;Close the finished ie window Sleep (600) ShellExecute("NetSet.arse") ;Set static arp Exit1 point -
Hi Ken, You also want mayo with that? Seriously: You aren't making too much sense with your 2 questions so maybe you need to start what you want to get accomplished here. Jps1 point
-
If you have built-in function at disposal then always choose that over WinAPI call.1 point
-
It doesn't make much difference. When reading PE that way you are after PointerToRawData, SizeOfRawData, etc... You get the raw picture, right? edit: The only difference between PE file that's not loaded and PE file that's loaded (in/to memory) are addresses of the data. You see, loader reads raw data and places it on different places inside virtual memory. These addresses are written inside PE file as relative values. Relative means that the only important value is the distance between two data. Once loaded you work with VirtualSize, VirtualAddress and other virtual things.1 point
-
Looking at it, you have to make two dll-calls, one ObjCreateInterface, one _WinApi call and one object call, how hard can that be? Try something, I'm sure you'll get proper help then.1 point
-
Appending specific clipboard string to a text file
mrflibblehat reacted to guinness for a topic
Working example. #include <Array.au3> Local $sString = 'DeviceName: Test1' & @CRLF & _ 'Version: 1.2' & @CRLF & _ 'DeviceSerial: 123456789' & @CRLF & _ 'Last Line: Text End' & @CRLF Local $aArray = StringRegExp($sString, 'DeviceSerial:\h+(\d+)', 3) _ArrayDisplay($aArray)1 point -
It's the only thing I haven't shared on here, I think I'm allowed this one pass.1 point
-
Danyfirex can vouch for this, the WinHttp UDF might be a good option to look into as well. You know if your purpose is to improve with AutoIt.1 point
-
Looks fine to me and I have a PasteBin application, so I have some understanding. (See my signature.) You could use InetRead and http://pastebin.com/raw.php?i= (see the API docs) to retrieve the paste id.1 point
-
1 point
-
I don't think there is any "PE For Dummies", as dummies generally don't need to even know what it is. This is the msdn guide, which is not only readable (surprise!) but also has demo code for a PE reader written in C. Using this on C++ code makes your life easier, you just need to compare the binary data of the .text sections.1 point
-
The major difference is mine just uses native AutoIt functions, whereas the one you found is a "rip off" of what is in WinAPIEx by Yashied. I would personally use the WinAPIEx version, but that's just my preference.1 point
-
Structure of an executable
JohnOne reacted to Richard Robertson for a topic
The PE header should contain either an index of sections or an indicator of where the first section starts. Then the first section would say how long it is, which indicates where the next section starts. If it's not one of those two, then I have no idea how it could work as a container.1 point -
These has credit to all authors >>1 point
-
Yes. Not really any simple way to do it off the top of my head. Are we talking about AutoIt code here? Read up on the portable executable format. It is made of sections, and it should be possible to do a comparison of .text section. If it's autoit code then I've got no idea how you'd do it.1 point
-
http://www.autoitscript.com/wiki/Adding_UDFs_to_AutoIt_and_SciTE1 point
-
Here it is... faster without a gui Global $text[7] = ["1", "2", "3", "4", "5", "6", "7"], $n = 0 $file = FileOpen(@scriptdir & "\list.txt", 1) _LetsGo("") FileClose($file) Exit Func _LetsGo($string) For $i = 0 to UBound($text)-1 If not Stringinstr($string, $text[$i]) Then FileWrite($file, $string & $text[$i] & @crlf) _LetsGo($string & $text[$i] ) EndIf Next EndFunc Ok it's sorted now1 point
-
Using Handles in C# .NET 4.5
ch1234 reacted to Richard Robertson for a topic
I had forgotten about this. To use the handle, you'll actually call it like this. AutoItX3Lib.AutoItX3 autoit = new AutoItX3Lib.AutoItX3(); string handle = autoit.WinGetHandle("[CLASS:Notepad]", "this one"); // MessageBox.Show(handle, ""); autoit.WinActivate(handle); autoit.ControlSend("[HANDLE:" + handle + "]", "", "Edit1", " test test test "); AutoItX uses a slightly different mechanism than normal AutoIt.1 point -
1 point
-
Hello This is a sample for create a QR Code using the library Quricol - QR code generator library of Serhiy Perevoznyk. First we must download a package from http://users.telenet.be/ws36637/download/quricol.zip , this file contains sources and documentation for use on Pascal-Delphi system. We need only quricol32.dll (in \quricol\Binaries directory) which must be copied in an accessible directory. I have inferred use and parameters by examining the file \Quricol.Barcode\NativeMethods.cs. The script can create a QR Code in BMP and PNG format or on the screen. I apologize, but I am not be able to insert the QR code in clipboard. In the compressed file there is: - quricol32.dll - ProvaQR.au3 the script test - formhandler.au3 - functions.au3 These last two scripts are needed for the test, in particular formhandler.au3 is a new version of a form generator, not yet inserted in the repository because is yet in test. Best regards John Rossati AutoitQRCode.zip1 point
-
Collapse all SciTe Folds Hotkey
AnonymousX reacted to Xenobiologist for a topic
View --> Toogle all ... Mega1 point