Ascend4nt Posted July 29, 2009 Posted July 29, 2009 (edited) _DLLStructDisplayWhile working on debugging a project a while back, I was looking for better ways to debug the code. And voila, here it is.Anyway, this function displays the contents of your DLLStruct's in a ListView format (placing the items in an array and utilizing _ArrayDisplay).IMPORTANT: You must supply the string EXACTLY as it was used to set up the structure (although you can add descriptions after the datatypes if they aren't already there). The string requirement might seem like one more extra step, but without it the function wouldn't work (and you're debugging would be much harder).The code is smart enough to split items into subitems (based on [#]'s found), and will display the description with {sub item #x}).Also - the behaviour with GINORMOUS pieces of data is unknown - this is best used with smaller structures!NOTE: One thing you might notice about structures is alignment has alot to do with where items are placed in the structure. The default is '8', which means that everything is aligned on a boundary equally divisible by itself (char being 1 byte is aligned anywhere, int's being 4 bytes, are aligned on offsets divisible by 4, double's and int64's both are aligned on offsets equally divisible by 8)HOWEVER: a prefix of 'align ##' can change this behavior so that the data can be 'misaligned' so to speak, to the specified alignment # (see AutoIT Help info for DLLStructCreate)Update Log:5/27/2011: Small fixes, ability to use multiple 'align' directivesFixed: initial 'align (##);' check code failed in certain circumstances (align on its own, spaces after #) Fixed: 'char' & 'byte' can now be part of description of all array objectsAdded/Fixed: 'align (##);' can now appear anywhere in a structure, now properly handled (extra ones are reported in display)5/26/2011: Updated to new structure alignment directives (as of AutoIt v3.3.7.2beta)Added: Structure size information, End-of-Structure Padding InfoAdded: Struct/EndStruct support, these show up in list with C-style curly braces { }; 3/18/2010: Updated to all new supported types as of AutoIT v3.3.6.0Added: Index, Offset, Size Columns, Base Pointer & Alignment Type info (in Title Bar and in 'Offset' column)Fixed: subitem listings, items with labels, alignment override being read as a type, subitem offsets, fixed case-sensitivityAdjusted: stripped unnecessary whitespace, added options to display Strings (char[#]/wchar[#]) and Binary string data (ubyte[#],byte[#]) as one concatenated stringDownload the ZIP HereAscend4nt's AutoIT Code License agreement:While I provide this source code freely, if you do use the code in your projects, all I ask is that:If you provide source, keep the header as I have put it, OR, if you expand it, then at least acknowledge me as the original author, and any other authors I creditIf the program is released, acknowledge me in your credits (it doesn't have to state which functions came from me, though again if the source is provided - see #1)The source on it's own (as opposed to part of a project) can not be posted unless a link to the page(s) where the code were retrieved from is provided and a message stating that the latest updates will be available on the page(s) linked to.Pieces of the code can however be discussed on the threads where Ascend4nt has posted the code without worrying about further linking. Edited September 14, 2011 by Ascend4nt My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
monoceres Posted July 29, 2009 Posted July 29, 2009 (edited) Heh I made something similar for a long time ago, forgot to post it Anyways, it looks good & useful. However my thoughts:Using for example "align 2;" should not show up as a data typePossible trailing and leading spaces should be removed, it looks funny in the listview.Definitely needs to display the pointer to the struct somewhere, this will serve as a double purpose since it will display '0' of the struct is invalidMaybe show arrays of type byte/char/wchar in binary/string in a single listview element?Other than that it works fine >_< Edit:To calculate correct offset you can use DllStructGetPtr() with the element paramater. Array elements will always be placed next to eachother in the array. Edited July 29, 2009 by monoceres Broken link? PM me and I'll send you the file!
dmob Posted July 29, 2009 Posted July 29, 2009 Excellent learning tool. I must say thank you, I have learned a lot from your code over the months. I now understand things I never even learnt.
Ascend4nt Posted July 29, 2009 Author Posted July 29, 2009 @Monoceres: Thanks for the ideas - I will implement some of them, maybe some as bool parameters. As for calculating the offset, I had tried to use an element index, but then found out there's only a pointer to the element (so pointers to individual items in [#] can't be gotten). I'm going to just use a type-size translation array or even a string with StringRegExp to see which would be faster to get the actual size of each item (hmm..gotta take into account size differences with @AutoItX64) @dmob: Thanks for the compliment >_< , I'm glad I've been of help. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Ascend4nt Posted July 29, 2009 Author Posted July 29, 2009 (edited) Updated! Hopefully this satisfies the needs of most. (This also fixes some issues). Changes (since last time):Fixes:Fixed items with label descriptionsFixed alignment-override being read as a data-typeFixed subitem offset infoAdditions:Added DLL Struct 'Base pointer' info (in Title bar & 'Offset' column description)Added Alignment info (in Title bar & 'Offset' column description)Stripped whitespace from Struct Type/descriptions (except where needed for Labels and subitem info)Added parameter option to display multi-character strings (char[#]/wchar[#]) as one concatenated string (default behavior)Added parameter option to display multi-byte Binary strings (ubyte[#],byte[#]) as one concatenated string (not default behavior)*edit* Also added 'Size' column (which is also properly adjusted for x86 or x64 mode)Anyways, have a look. Hopefully this should make everyone happy. >_< Edited July 29, 2009 by Ascend4nt My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Ascend4nt Posted July 30, 2009 Author Posted July 30, 2009 Okay, last change (I hope!). I've added an 'Index' column, because those sub-items can make it a bit confusing if you're trying to remember which index to use as the base index into the Structure. (the sub-item # is the sub-index) Th-th-th-thats all >_< My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
trancexx Posted August 2, 2009 Posted August 2, 2009 Excellent! Very useful thing. Was missing it and also was too lazy to write it and I knew some day someone would and I'll just say thanks. So, thanks. Btw, I see you don't use Opt("MustDeclareVars", 1). Everyone should. And tidy.exe, and #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 4 -w 5 -w 6 and ...actually nothing more >_< ♡♡♡ . eMyvnE
Ascend4nt Posted August 2, 2009 Author Posted August 2, 2009 Excellent! Very useful thing. Was missing it and also was too lazy to write it and I knew some day someone would and I'll just say thanks. So, thanks.You're welcome Now someone should create a tool to test, mess around with, and create your own DLLStructs. erm, hey, why are you looking at me. I'm not a GUI guy da*it!*walks off mumbling about too many projects on my mind* >_< My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Ascend4nt Posted March 22, 2010 Author Posted March 22, 2010 I'm back. Code has been updated, latest edit:*edits: 3/18/2010: Updated to all new supported types as of AutoIT v3.3.6.0 My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
KaFu Posted April 27, 2010 Posted April 27, 2010 Excellent debug UDF m8 , thanks for this one! OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Ascend4nt Posted May 26, 2011 Author Posted May 26, 2011 New updates (works with latest beta changes!):5/26/2011: Updated to new structure alignment directives (as of AutoIt v3.3.7.2beta)Added: Structure size information, End-of-Structure Padding InfoAdded: Struct/EndStruct support, these show up in list with C-style curly braces { }; My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Ascend4nt Posted May 27, 2011 Author Posted May 27, 2011 Updated again. Didn't know about the ability to use multiple 'align' directives in a structure, now I do! So here's a version that works with those structures (plus a bugfix or 2):5/27/2011: Small fixes, ability to use multiple 'align' directivesFixed: initial 'align (##);' check code failed in certain circumstances (align on its own, spaces after #)Fixed: 'char' & 'byte' can now be part of description of all array objectsAdded/Fixed: 'align (##);' can now appear anywhere in a structure, now properly handled (extra ones are reported in display) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Raik Posted April 16, 2012 Posted April 16, 2012 I have changed for my personal use: 113 ; $aStDisplay[0][0]="Index" 114 ; $aStDisplay[0][1]="DLL Struct Type + Description (optional)" 115 ; $aStDisplay[0][2]="Value" 116 ; $aStDisplay[0][3]="Offset [Base Ptr="&$iBaseAddress&", Alignment="&$iAlign&" [Base], Size="&$iStrSize&']' 117 ; $aStDisplay[0][4]="Size [Total="&$iStrSize&']' 118 119 $iDispIndex=0 ... 224 _ArrayDisplay($aStDisplay,"DLLStruct"&$sStructName&" Contents [Base Ptr="&$iBaseAddress&", Alignment="&$iAlign&", Size="&$iStrSize&']',-1,0,"","|", _ 225 "Row|Index|DLL Struct Type + Description (optional)|Value|Offset [Base Ptr="&$iBaseAddress&", Alignment="&$iAlign&" [Base], Size="&$iStrSize&"]|Size [Total="&$iStrSize&']') AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)
Biatu Posted December 11, 2013 Posted December 11, 2013 Return=False @Error=0 @Extended=0 using it to read $tSTARTUPINFO struct from the RunBiinary UDF from trancexx What is what? What is what.
MattHiggs Posted March 28, 2024 Posted March 28, 2024 I realize this post is ancient, but, considering the udf is no longer available, wanted to see if somebody potentially saved the udf at the time and could re-upload it. THanks.
argumentum Posted March 28, 2024 Posted March 28, 2024 (edited) 6 minutes ago, MattHiggs said: somebody potentially saved the udf I did 😅 Edited March 28, 2024 by argumentum oops Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Nine Posted March 28, 2024 Posted March 28, 2024 @MattHiggs You could use _WinAPI_DisplayStruct, it is quite good, but you need to provide the actual tag (usually not a problem)... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now