📄 modglobals.bas
字号:
Attribute VB_Name = "modGlobals"
'#############################################
'modGlobals vbgamer45 2004
'##############################################
'Notes
'################################################
'"a" - means it is an Address
'"o" - means it is a relative Offset
'"Unknown" - self explanatory
'"Flag" - Variable Unknown Property
'"Const" - Constant Unknown Property
'"Address" - Unknown Address
'################################################
Const Signature = &H1F4 ' F4 01 00 00
Const MAX_PATH = 260
Public Const Version = "0.03"
Type VBHeader
Signature As String * 4 '00h 00d
'VB5! identifier "VB5!"
RuntimeBuild As Integer '04h 04d
'RuntimeBuild
LanguageDLL As String * 14 '06h 06d
'Language DLL name. _
0x2A meaning default or null terminated string.
BackupLanguageDLL As String * 14 '14h 20d
'Backup Language DLL name. _
0x7F meaning default or null terminated string. _
Changing values do not effect working status of an exe.
RuntimeDLLVersion As Integer '22h 34d
'Run-time DLL version
LanguageID As Long '24h 36d
BackupLanguageID As Long '28h 40d
'Backup Language ID (only when Language DLL exists)
aSubMain As Long '2Ch 44d
'Address to Sub Main() code _
(If 0000 0000 then it's a load form call)
aProjectInfo As Long '30h 48d
fMDLIntObjs As Long '34h 52d
fMDLIntObjs2 As Long '38h 56d
ThreadFlags As Long '3Ch 60d
ThreadCount As Long '40h 64d
FormCount As Integer '44h 68d
ExternalComponentCount As Integer '46h 70d
'Number of external components (eg. winsock) referenced
ThunkCount As Long
aGUITable As Long '4Eh 78d
aExternalComponentTable As Long '52h 82d
'aProjectDescription As Long '56h 86d
aComRegisterData As Long
oProjectExename As Long '5Ah 90d
oProjectTitle As Long '5Eh 94d
oHelpFile As Long '62h 98d
oProjectName As Long '66h 102d
End Type
'* Thread Flags:
'+-------+----------------+--------------------------------------------------------+
'| Value | Name | Description |
'+-------+----------------+--------------------------------------------------------+
'| 0x01 | ApartmentModel | Specifies multi-threading using an apartment model |
'| 0x02 | RequireLicense | Specifies to do license validation (OCX only) |
'| 0x04 | Unattended | Specifies that no GUI elements should be initialized |
'| 0x08 | SingleThreaded | Specifies that the image is single-threaded |
'| 0x10 | Retained | Specifies to keep the file in memory (Unattended only) |
'+-------+----------------+--------------------------------------------------------+
'ex: A value of 0x15 specifies a multi-threaded, memory-resident ActiveX Object with no GUI
'* MDL Internal Object Flags
'+---------+------------+---------------+
'| Ctrl ID | Value | Object Name |
'+---------+------------+---------------+
'| First Flag |
'+---------+------------+---------------+
'| 0x00 | 0x00000001 | PictureBox |
'| 0x01 | 0x00000002 | Label |
'| 0x02 | 0x00000004 | TextBox |
'| 0x03 | 0x00000008 | Frame |
'| 0x04 | 0x00000010 | CommandButton |
'| 0x05 | 0x00000020 | CheckBox |
'| 0x06 | 0x00000040 | OptionButton |
'| 0x07 | 0x00000080 | ComboBox |
'| 0x08 | 0x00000100 | ListBox |
'| 0x09 | 0x00000200 | HScrollBar |
'| 0x0A | 0x00000400 | VScrollBar |
'| 0x0B | 0x00000800 | Timer |
'| 0x0C | 0x00001000 | Print |
'| 0x0D | 0x00002000 | Form |
'| 0x0E | 0x00004000 | Screen |
'| 0x0F | 0x00008000 | Clipboard |
'| 0x10 | 0x00010000 | Drive |
'| 0x11 | 0x00020000 | Dir |
'| 0x12 | 0x00040000 | FileListBox |
'| 0x13 | 0x00080000 | Menu |
'| 0x14 | 0x00100000 | MDIForm |
'| 0x15 | 0x00200000 | App |
'| 0x16 | 0x00400000 | Shape |
'| 0x17 | 0x00800000 | Line |
'| 0x18 | 0x01000000 | Image |
'| 0x19 | 0x02000000 | Unsupported |
'| 0x1A | 0x04000000 | Unsupported |
'| 0x1B | 0x08000000 | Unsupported |
'| 0x1C | 0x10000000 | Unsupported |
'| 0x1D | 0x20000000 | Unsupported |
'| 0x1E | 0x40000000 | Unsupported |
'| 0x1F | 0x80000000 | Unsupported |
'+---------+------------+---------------+
'| Second Flag |
'+---------+------------+---------------+
'| 0x20 | 0x00000001 | Unsupported |
'| 0x21 | 0x00000002 | Unsupported |
'| 0x22 | 0x00000004 | Unsupported |
'| 0x23 | 0x00000008 | Unsupported |
'| 0x24 | 0x00000010 | Unsupported |
'| 0x25 | 0x00000020 | DataQuery |
'| 0x26 | 0x00000040 | OLE |
'| 0x27 | 0x00000080 | Unsupported |
'| 0x28 | 0x00000100 | UserControl |
'| 0x29 | 0x00000200 | PropertyPage |
'| 0x2A | 0x00000400 | Document |
'| 0x2B | 0x00000800 | Unsupported |
'+---------+------------+---------------+
'ex: A value of 0x30F000 (the so called "static binary constant on most sites") actually means to initialize the Print, Form, Screen, ClipBoard Objects (0xF000) as well as the Drive/Dir Objects (0x30000). This is the default on VB projects because those objects can always be accessed from a module (ie, they are not graphic, except Forms, wich can always be created)
'COM Data Types
'
Type tCOMRegData
oRegInfo As Long ' 0x00 (00d) Offset to COM Interfaces Info
oNTSProjectName As Long ' 0x04 (04d) Offset to Project/Typelib Name
oNTSHelpDirectory As Long ' 0x08 (08d) Offset to Help Directory
oNTSProjectDescription As Long ' 0x0C (12d) Offset to Project Description
uuidProjectClsId(15) As Byte ' 0x10 (16d) CLSID of Project/Typelib
lTlbLcid As Long ' 0x20 (32d) LCID of Type Library
iPadding1 As Integer ' 0x24 (36d)
iTlbVerMajor As Integer ' 0x26 (38d) Typelib Major Version
iTlbVerMinor As Integer ' 0x28 (40d) Typelib Minor Version
iPadding2 As Integer ' 0x2A (42d)
lPadding3 As Long ' 0x2C (44d)
' 0x30 (48d) <- Structure Size
End Type
Type tCOMRegInfo
oNextObject As Long ' 0x00 (00d) Offset to COM Interfaces Info
oObjectName As Long ' 0x04 (04d) Offset to Object Name
oObjectDescription As Long ' 0x08 (08d) Offset to Object Description
lInstancing As Long ' 0x0C (12d) Instancing Mode
lObjectID As Long ' 0x10 (16d) Current Object ID in the Project
uuidObjectClsID(15) As Byte ' 0x14 (20d) CLSID of Object
fIsInterface As Long ' 0x24 (36d) Specifies if the next CLSID is valid
oObjectClsID As Long ' 0x28 (40d) Offset to CLSID of Object Interface
oControlClsID As Long ' 0x2C (44d) Offset to CLSID of Control Interface
fIsControl As Long ' 0x30 (48d) Specifies if the CLSID above is valid
lMiscStatus As Long ' 0x34 (52d) OLEMISC Flags (see MSDN docs)
fClassType As Byte ' 0x38 (56d) Class Type
fObjectType As Byte ' 0x39 (57d) Flag identifying the Object Type
iToolboxBitmap32 As Integer ' 0x3A (58d) Control Bitmap ID in Toolbox
iDefaultIcon As Integer ' 0x3C (60d) Minimized Icon of Control Window
fIsDesigner As Integer ' 0x3E (62d) Specifies whether this is a Designer
oDesignerData As Long ' 0x40 (64d) Offset to Designer Data
' 0x44 (68d) <-- Structure Size
End Type
'Object Type part of tCOMRegInfo
'+-------+---------------+-------------------------------------------+
'| Value | Name | Description |
'+-------+---------------+-------------------------------------------+
'| 0x02 | Designer | A Visual Basic Designer for an Add.in |
'| 0x10 | Class Module | A Visual Basic Class |
'| 0x20 | User Control | A Visual Basic ActiveX User Control (OCX) |
'| 0x80 | User Document | A Visual Basic User Document |
'+-------+---------------+-------------------------------------------+
Type tDesignerInfo
uuidDesigner(15) As Byte '0x00 (00d) CLSID of the Addin/Designer
lStructSize As Long '0x10 (16d) Total Size of the next fields
iSizeAddinRegKey As Integer '0x14 (20d)
sAddinRegKey As String '0x16 (22d) Registry Key of the Addin
iSizeAddinName As Integer '0x16 (22d) + iSizeAddinRegKey
sAddinName As String '0x18 (24d) + iSizeAddinRegKey Friendly Name of the Addin
iSizeAddinDescription As Integer '0x18 (24d) + iSizeAddinRegKey _
+ iSizeAddinName
iAddinDescription As String '0x1A (26d) + iSizeAddinRegKey _
+ iSizeAddinName Description of Addin
lLoadBehaviour As Long '0x1A (26d) + iSizeAddinRegKey _
+ iSizeAddinName _
+ iSizeAddinDescription CLSID of Object
iSizeSatelliteDLL As Integer '0x1E (30d) + iSizeAddinRegKey _
+ iSizeAddinName _
+ iSizeAddinDescription
sSatelliteDLL As String '0x20 (32d) + iSizeAddinRegKey _
+ iSizeAddinName _
+ iSizeAddinDescription SatelliteDLL, if specified
iSizeAdditionalRegKey As Integer '0x20 (32d) + iSizeAddinRegKey _
+ iSizeAddinName _
+ iSizeAddinDescription _
+ iSizeSatteliteDLL
sAdditionalRegKey As String '0x22 (34d) + iSizeAddinRegKey _
+ iSizeAddinName _
+ iSizeAddinDescription _
+ iSizeSatteliteDLL Extra Registry Key, if specified
lCommandLineSafe As Long '0x22 (34d) + iSizeAddinRegKey _
+ iSizeAddinName _
+ iSizeAddinDescription _
+ iSizeSatteliteDLL _
+ iSizeAdditionalRegKey Specifies a GUI-less Addin if 1
'0x14 + lStructSize <-- Structure Size
End Type
Private Type tProjectInfo
Signature As Long ' 0x00
aObjectTable As Long ' 0x04
Null1 As Long ' 0x08
aStartOfCode As Long ' 0x0C
aEndOfCode As Long ' 0x10
Flag1 As Long ' 0x14
ThreadSpace As Long ' 0x18
aVBAExceptionhandler As Long ' 0x1C
aNativeCode As Long ' 0x20
oProjectLocation As Integer ' 0x24
Flag2 As Integer ' 0x26
Flag3 As Integer ' 0x28
OriginalPathName(MAX_PATH * 2) As Byte ' 0x2A
NullSpacer As Byte ' 0x233
aExternalTable As Long ' 0x234
ExternalCount As Long ' 0x238
' Size 0x23C
End Type
Private Type tObject
aObjectInfo As Long ' 0x00
Const1 As Long ' 0x04
aPublicBytes As Long ' 0x08 (08d) Pointer to Public Variable Size integers
aStaticBytes As Long ' 0x0C (12d) Pointer to Static Variables Struct
aModulePublic As Long ' 0x10 (16d) Memory Pointer to Public Variables
aModuleStatic As Long ' 0x14 (20d) Pointer to Static Variables
aObjectName As Long ' 0x18 NTS
ProcCount As Long ' 0x1C events, funcs, subs
aProcNamesArray As Long ' 0x20 when non-zero
oStaticVars As Long ' 0x24 (36d) Offset to Static Vars from aModuleStatic
ObjectType As Long ' 0x28
Null3 As Long ' 0x2C
' 0x30 <-- Structure Size
End Type
'tObject.ObjectTyper Properties...
'#########################################################
'form: 0000 0001 1000 0000 1000 0011 --> 18083
' 0000 0001 1000 0000 1010 0011 --> 180A3
' 0000 0001 1000 0000 1100 0011 --> 180C3
'module: 0000 0001 1000 0000 0000 0001 --> 18001
' 0000 0001 1000 0000 0010 0001 --> 18021
'class: 0001 0001 1000 0000 0000 0011 --> 118003
' 0001 0011 1000 0000 0000 0011 --> 138003
' 0000 0001 1000 0000 0010 0011 --> 18023
' 0000 0001 1000 1000 0000 0011 --> 18803
' 0001 0001 1000 1000 0000 0011 --> 118803
'usercontrol: 0001 1101 1010 0000 0000 0011 --> 1DA003
' 0001 1101 1010 0000 0010 0011 --> 1DA023
' 0001 1101 1010 1000 0000 0011 --> 1DA803
'propertypage: 0001 0101 1000 0000 0000 0011 --> 158003
' | || | | | | |
'[moog] | || | | | | |
'HasPublicInterface ---+ || | | | | |
'HasPublicEvents --------+| | | | | |
'IsCreatable/Visible? ----+ | | | | |
'Same as "HasPublicEvents" -----+ | | | |
'[aLfa] | | | | |
'usercontrol (1) ---------------+ | | | |
'ocx/dll (1) ----------------------+ | | |
'form (1) ------------------------------+ | |
'vb5 (1) ---------------------------------+ |
'HasOptInfo (1) -------------------------------+
' |
'module(0) ------------------------------------+
Public Type tObjectInfo
Flag1 As Integer ' 0x00
ObjectIndex As Integer ' 0x02
aObjectTable As Long ' 0x04
Null1 As Long ' 0x08
aSmallRecord As Long ' 0x0C when it is a module this value is -1 [better name?]
Const1 As Long ' 0x10
Null2 As Long ' 0x14
aObject As Long ' 0x18
RunTimeLoaded As Long ' 0x1C [can someone verify this?]
NumberOfProcs As Long ' 0x20
aProcTable As Long ' 0x24
iConstantsCount As Integer '0x28 (40d) Number of Constants
iMaxConstants As Integer '0x2A (42d) Maximum Constants to allocate.
Flag5 As Long ' 0x2C
Flag6 As Integer ' 0x30
Flag7 As Integer ' 0x32
aConstantPool As Long ' 0x34
' 0x38 <-- Structure Size
'the rest is optional items[OptionalObjectInfo]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -