Scans and catalogs Integers, Floats, Strings, Structs, Enums, Macros, and UUIDs.
Automatically perform calculations and variable substitutions defined in macros to resolve constant values.
Set user-defined constants so you can keep your .data files lean with only the constants you want to list in a given API.
Create profiles of user-defined groups of headers.
All #preprocessors are now parsed to get a more accurate set of constants.
Flexible UI for searching and referencing API constants/structs/unions/enums/macros.
All listed Win32 API groups have been dumped to the Data File Repo.
Jump to where a value is defined in headers from the main list (right-click).
(Define text editor settings in the Settings menu.)
Setup this script with a compiler of your choice for checking constants (recommended MSVC BuildTools or GCC variant, like MinGW32/64 or TDGCC).
It sometimes doesn't work, this is a work-in-progress.
Double-click a constant in the list (or press F3) to get a larger display window (handy for browsing large structs and enums).
Toggle Value column between Hex and Decimal format with CTRL
Space, or from the List menu.
Each .data file now contains a sub-catalog of data types and their sizes that pertain to that API.
Drastically reduced number of duplicate constants.
No more "critical" constants.
"Critical" used to mean that a value of a numeric constant was based on one or more duplicate constants. Now with the proper pre-defined constants, and #preprocessors being processed during scanning, there are no more "Critical" constants, and significantly fewer dupes.
============================================================================= Important Changes:
=============================================================================
The old data files won't work with this update. Please download the ones you need again from here.
I do plan to make docs for how to actually use this script to scan headers for constants in the future. If people want this, let me know so I can bump it up on the priority list. I made a rough tutorial on the GitHub repo README.
Cleaned up some dialogs to be more consistent with the rest of the UI changes.
Fixed sizeof(type *) to resolve to selected architecture pointer size.
Added a "Global Base Folder" option for users who just browse .data files.
This enables the "Go to #Include" and "Include" menu functionality.
The Compile menu is now hidden unless you define your CLI compiler enviornment settings in the Settings tab.
Added the ability to edit values.
This is mostly used for selectively cleaning up struct indentation.
Re-dumped all x64 .data files because most were missing some includes (re-download please!).
Finised dumping values into .data files for the remaining Win32 API references on the Microsoft site.
Updated readme with better setup instructions and explanation of features.
Now multiple .data files can be loaded.
Multiple loaded .data files can be saved to a new .data file.
2021/12/30
Removed Includes report, but the includes list is still contained in the data files
Updated README.
Rewrote the parser, now #preprocessors (ie #if, #ifdef, etc) are properly read which gives more complete/accurate values.
Now there are almost no dupes, except for redeclared UUIDs and overloaded functions/macros.
Made several UI updates for modifying profile settings.
Removed old/unused includes.
Now sizeof() basic types (and extended typedefs) are recorded and can be browsed after loading a data file.
Updated eval() library.
Redumped all x64 values from previously listed APIs.
Now UUIDs/GUIDs are recorded and converted to the proper format for AHK {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.
Structs/Unions/Enums indentation is now cleaned up and properly indented.
2021/06/21
minor updates for a137
2021/05/29
some cleaning up of old files
updated GuiCtlExt with Btn.SetImg()
fixed profile window to ensure dupe headers are not added
2021/05/08
changes for a134
updated CLSAK, JXON, GuiCtlExt, and eval libs
changed match.value(n) (for regex) to match[n] and other regex changes
Added option to prepend comment char ";" on copying constants
Column widths are now remembered between sessions.
2021/04/21
Added a larger window to view constant data. This is handy for large structs and enums. Double-click on a constant, or press F3 to access this window.
Added CTRL + Space hotkey to toggle Value column between hex and decimal.
2021/04/20
Added ability to toggle integers in "value" column between Hex and Decimal.
2021/04/18
Scanner now processes a few functions like MAKE_HRESULT().
Added user-defined constants in profile edit window.
Value search field will now change hex value to decimal on search.
Many more constants are now resolved on the database file repo, and no more extra constants from include files.
Only specified files in the profile edit window are scanned, no more branching includes.
2021/04/16
changes for a131
changed Exception() to Error()
I meant to include credits to SKAN whose Constants.ahk inspired me to make this version. I know it's been a while, and that this post update may seem odd. I just wanted to update the record to give credit where it is due. Script docs and comments have been updated to include this credit.
2021/03/09
updated for a128
2021/01/30
now this script also catalogs ENUM and STRUCT elements
created a profile system with several settings for each API the user wants to scan
created repo on github to store saved APIs
2020/12/21
finished compiler integration for MSVC BuildTools and GCC variants, ie. MinGW32/64 and TDGCC
cleaned up the UI
added columns where X indicates a Dupe or Critical entry (in D and C columns)
reverted calculations involving type casting and functions until more compiler tests can be done
2020/08/13
added a confirmation dialog for scanning
fixed calculations to only use powershell now
- it's accurate but slow to scan
re-saved windows constants (only scanned main folder - should still contain most of the relevant constants)
Dig into GCC MinGW compiler and its WIN32 source files.
This will likely yield a different set of global constants for the GCC compiler. I plan to include these default global settings in the future.
Calculate struct sizes and field offsets (aligned and unaligned) without the compiler (I still will spot check with the compiler though).
============================================================================= *** Special Notes ***
=============================================================================
When searching for error codes, please note that when you have a return value or error value, like an HRESULT, on a 64-bit system it will come out as: 0xFFFFFFFFAABBCCDD, where 0xAABBCCDD is the actual code you are looking for. This will result in negative integers that seem to have nothing to do with the actual value in the database files, unless you look at it in hex format.
When you process these HRESULT-type values, you should use var := 64_bit_number & 0xFFFFFFFF to convert it to a 32-bit value, or at least use Format() to change it to hex so you can see the last 8 characters, which will help you find your error codes when using this tool.
Last edited by TheArkive on 03 Jan 2022, 12:50, edited 41 times in total.
Found some incorrect constants. As always please do your own double checking. I'll modify this post when I have reason to believe the full list is accurate.
This script will be temporarily broken until I can work something out to either get less values but higher accuracy, or get more values AND higher accuracy.
Many more constant values will now be unresolved until i find a better way to resolve them.
All constants that are resolved should be accurate now.
Last edited by TheArkive on 09 Mar 2021, 11:51, edited 1 time in total.
Scanner now processes a few functions like MAKE_HRESULT().
Added user-defined constants in profile edit window.
Value search field will now change hex value to decimal on search.
Many more constants are now resolved on the database file repo, and no more extra constants from include files.
Only specified files in the profile edit window are scanned, no more branching includes.
*** Special Notes ***
Please be on the lookout for possible incorrect constant values. Mostly from trying to resolve some functions. The functions aren't difficult to replicate, and I did check values through the compiler, so I know they are right on my system, but if you find them to be wrong please let me know so I can investigate.
Also, for searching error codes, please note that when you have a return value or error value, like an HRESULT, on a 64-bit system it will come out as: 0xFFFFFFFFAABBCCDD, where 0xAABBCCDD is the actual code you are looking for. This will result in negative integers that seem to have nothing to do with the actual value in the database files, unless you look at it in hex.
When you process these HRESULT-type values, you should use var := 64_bit_number ^ 0xFFFFFFFF00000000 to convert it to a 32-bit value, or at least use Format() to change it to hex so you can see the last 8 characters, which will help you find your error codes when using this tool.
Removed Includes report, but the includes list is still contained in the data files
Updated README.
Rewrote the parser, now #preprocessors (ie #if, #ifdef, etc) are properly read which gives more complete/accurate values.
Now there are almost no dupes, except for redeclared UUIDs and overloaded functions/macros.
Made several UI updates for modifying profile settings.
Removed old/unused includes.
Now sizeof() basic types (and extended typedefs) are recorded and can be browsed after loading a data file.
Updated eval() library.
Redumped all x64 values from previously listed APIs.
Now UUIDs/GUIDs are recorded and converted to the proper format for AHK {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.
Structs/Unions/Enums indentation is now cleaned up and properly indented.
Last edited by TheArkive on 30 Dec 2021, 09:18, edited 1 time in total.