home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Planet Source Code Jumbo …e CD Visual Basic 1 to 7
/
6_2008-2009.ISO
/
data
/
zips
/
EliteXp®_P21651610152009.psc
/
OptionalHeader.cls
< prev
next >
Wrap
Text File
|
2009-10-15
|
3KB
|
86 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "OptionalHeader"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Dim st As IMAGE_OPTIONAL_HEADER, fOwner As NtHeader
Private Type Objects
FileHeader As FileHeader
End Type
Dim Objs As Objects
Friend Property Get Struct() As IMAGE_OPTIONAL_HEADER
Struct = st
End Property
Friend Property Let Struct(n As IMAGE_OPTIONAL_HEADER)
Dim hdr As IMAGE_NT_HEADERS
hdr = Owner.Struct
st = n
hdr.OptionalHeader = st
Owner.Struct = hdr
End Property
Friend Sub SetOwner(cOwner As NtHeader)
Set fOwner = cOwner
End Sub
Friend Property Get Owner() As NtHeader
Set Owner = fOwner
End Property
'***********************************************************************
'**********Common Routines For Memory Mapping**************************
Property Get Length() As Long
Length = Len(st)
End Property
Property Get Pointer() As Long
Pointer = VarPtr(st)
End Property
Function Fill(ByVal hMem As Long) As Boolean
On Error Resume Next
If IsBadCodePtr(hMem) Then Exit Function
CopyMemory ByVal Pointer, ByVal hMem, Length
End Function
'***************End Of Common Routine**************************************
'**************************************************************************
Property Get EntryPoint() As Long
EntryPoint = st.AddressOfEntryPoint
End Property
Property Get CodeBase() As Long
CodeBase = st.BaseOfCode
End Property
Property Get DataBase() As Long
DataBase = st.BaseOfData
End Property
Property Get ImageBase() As Long
ImageBase = st.ImageBase
End Property
Property Get CheckSum() As Long
CheckSum = st.CheckSum
End Property
Property Get FileAlignment() As Long
FileAlignment = st.FileAlignment
End Property
Property Get SectionAlignment() As Long
SectionAlignment = st.SectionAlignment
End Property
Property Get CodeSize() As Long
CodeSize = st.SizeOfCode
End Property
Property Get ImageSize() As Long
ImageSize = st.SizeOfImage
End Property
Property Get HeaderSize() As Long
HeaderSize = st.SizeOfHeaders
End Property
Property Get InitializedDataSize() As Long
InitializedDataSize = st.SizeOfInitializedData
End Property
Property Get UnInitializedDataSize() As Long
UnInitializedDataSize = st.SizeOfUninitializedData
End Property