コード例 #1
0
def MakeAssemblyRefOSRow():
    return construct.Struct('AssemblyRefOSRow',
        construct.ULInt32('OSPlatformID'),
        construct.ULInt32('OSMajorVersion'),
        construct.ULInt32('OSMinorVersion'),
        MDTag.AssemblyRefRId.parse('AssemblyRef')
    )
コード例 #2
0
def MakeManifestResourceRow():
    return construct.Struct('ManifestResourceRow',
        construct.ULInt32('Offset'),
        construct.ULInt32('Flags'),
        MDTag.StringHeapRef.parse('Name'),
        MDTag.Implementation.parse('Implementation')
    )
コード例 #3
0
def MakeGenericParamRow():
    return construct.Struct('GenericParamRow',
        construct.ULInt16('Number'),
        construct.ULInt16('Flags'),
        MDTag.TypeOrMethodDef.parse('Owner'),
        MDTag.StringHeapRef.parse('Name')
    )
コード例 #4
0
def MakeConstantRow():
    return construct.Struct('ConstantRow',
        construct.ULInt8('Type'),
        construct.Padding(1, strict = True),
        MDTag.HasConstant.parse('Parent'),
        MDTag.BlobHeapRef.parse('Value')
    )
コード例 #5
0
def MakeImplMapRow():
    return construct.Struct('ImplMapRow',
        construct.ULInt16('MappingFlags'),
        MDTag.MemberForwarded.parse('MemberForwarded'),
        MDTag.StringHeapRef.parse('ImportName'),
        MDTag.ModuleRefRId.parse('ImportScope')
    )
コード例 #6
0
def MakeExportedTypeRow():
    return construct.Struct('ExportedTypeRow',
        construct.ULInt32('Flags'),
        construct.ULInt32('TypeDefId'),
        MDTag.StringHeapRef.parse('TypeName'),
        MDTag.StringHeapRef.parse('TypeNamespace'),
        MDTag.Implementation.parse('Implementation')
    )
コード例 #7
0
def MakeModuleRow():
    return construct.Struct('ModuleRow',
        construct.ULInt16('Generation'),
        MDTag.StringHeapRef.parse('Name'),
        MDTag.GuidHeapRef.parse('MVId'),
        MDTag.GuidHeapRef.parse('EnCId'),
        MDTag.GuidHeapRef.parse('EnCBaseId')
    )
コード例 #8
0
def MakeTypeDefRow():
    return construct.Struct('TypeDefRow',
        construct.ULInt32('Flags'),
        MDTag.StringHeapRef.parse('Name'),
        MDTag.StringHeapRef.parse('Namespace'),
        MDTag.TypeDefOrRef.parse('Extends'),
        MDTag.FieldRef.parse('FieldList'),
        MDTag.MethodRef.parse('MethodList')
    )
コード例 #9
0
def MakeMethodRow():
    return construct.Struct('MethodRow',
        MakeRva('RVA'),
        construct.ULInt16('ImplFlags'),
        construct.ULInt16('Flags'),
        MDTag.StringHeapRef.parse('Name'),
        MDTag.BlobHeapRef.parse('Signature'),
        MDTag.ParamRef.parse('ParamList')
    )
コード例 #10
0
def MakeAssemblyRefRow():
    return construct.Struct('AssemblyRefRow',
        construct.ULInt16('MajorVersion'),
        construct.ULInt16('MinorVersion'),
        construct.ULInt16('BuildNumber'),
        construct.ULInt16('RevisionNumber'),
        construct.ULInt32('Flags'),
        MDTag.BlobHeapRef.parse('PublicKeyOrToken'),
        MDTag.StringHeapRef.parse('Name'),
        MDTag.StringHeapRef.parse('Culture'),
        MDTag.BlobHeapRef.parse('HashValue')
    )
コード例 #11
0
def ReadVtableFixups(ClrHeader):
    VTableFixup = construct.Struct('VTableFixup',
        MakeRva('RVA'),
        construct.ULInt16('Count'),
        construct.FlagsEnum(construct.ULInt16('Type'),
            COR_VTABLE_32BIT                           = 0x01, # V-table slots are 32-bits in size.
            COR_VTABLE_64BIT                           = 0x02, # V-table slots are 64-bits in size.
            COR_VTABLE_FROM_UNMANAGED                  = 0x04, # If set, transition from unmanaged.
            COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN = 0x08, # If set, transition from unmanaged with keeping the current appdomain.
            COR_VTABLE_CALL_MOST_DERIVED               = 0x10, # Call most derived method described by
        )
    )
    numFixups = ClrHeader.VTableFixups.Size / VTableFixup.sizeof()
    VTableFixups = construct.Array(numFixups, VTableFixup)
    if numFixups == 0: return []
    return VTableFixups.parse(idc.get_bytes(ClrHeader.VTableFixups.VA, int(VTableFixups.sizeof())))
コード例 #12
0
def MakeEventRow():
    return construct.Struct('EventRow',
        construct.ULInt16('EventFlags'),
        MDTag.StringHeapRef.parse('Name'),
        MDTag.TypeDefOrRef.parse('EventType')
    )
コード例 #13
0
def MakeNestedClassRow():
    return construct.Struct('NestedClassRow',
        MDTag.TypeDefRId.parse('NestedClass'),
        MDTag.TypeDefRId.parse('EnclosingClass')
    )
コード例 #14
0
def MakeFileRow():
    return construct.Struct('FileRow',
        construct.ULInt32('Flags'),
        MDTag.StringHeapRef.parse('Name'),
        MDTag.BlobHeapRef.parse('HashValue')
    )
コード例 #15
0
def MakePropertyMapRow():
    return construct.Struct('PropertyMapRow',
        MDTag.TypeDefRId.parse('Parent'),
        MDTag.PropertyRId.parse('PropertyList')
    )
コード例 #16
0
def MakeTypeSpecRow():
    return construct.Struct('TypeSpecRow',
        MDTag.BlobHeapRef.parse('Signature')
    )
コード例 #17
0
def MakePropertyPtrRow():
    return construct.Struct('PropertyPtrRow',
        MDTag.PropertyRef.parse('Property')
    )
コード例 #18
0
def MakeAssemblyOSRow():
    return construct.Struct('AssemblyOSRow',
        construct.ULInt32('OSPlatformID'),
        construct.ULInt32('OSMajorVersion'),
        construct.ULInt32('OSMinorVersion')
    )
コード例 #19
0
def MakeGenericParamConstraintRow():
    return construct.Struct('GenericParamConstraintRow',
        MDTag.GenericParamRId.parse('Owner'),
        MDTag.TypeDefOrRef.parse('Constraint')
    )
コード例 #20
0
def MakeEnCMapRow():
    return construct.Struct('EnCMapRow',
        construct.ULInt32('Token')
    )
コード例 #21
0
def MakeAssemblyProcessorRow():
    return construct.Struct('AssemblyProcessorRow',
        construct.ULInt32('Processor')
    )
コード例 #22
0
def MakeMethodSemanticsRow():
    return construct.Struct('MethodSemanticsRow',
        construct.ULInt16('Flags'),
        MDTag.MethodRId.parse('Method'),
        MDTag.HasSemantics.parse('Association')
    )
コード例 #23
0
def MakeFieldRvaRow():
    return construct.Struct('FieldRvaRow',
        MakeRva('RVA'),
        MDTag.FieldRId.parse('Field')
    )
コード例 #24
0
def MakeMethodImplRow():
    return construct.Struct('MethodImplRow',
        MDTag.TypeDefRId.parse('Class'),
        MDTag.MethodDefOrRef.parse('MethodBody'),
        MDTag.MethodDefOrRef.parse('MethodDeclaration')
    )
コード例 #25
0
def MakeEventPtrRow():
    return construct.Struct('EventPtrRow',
        MDTag.EventRef.parse('Event')
    )
コード例 #26
0
def MakePropertyRow():
    return construct.Struct('PropertyRow',
        construct.ULInt16('Flags'),
        MDTag.StringHeapRef.parse('Name'),
        MDTag.BlobHeapRef.parse('Type')
    )
コード例 #27
0
def MakeMethodSpecRow():
    return construct.Struct('MethodSpecRow',
        MDTag.MethodDefOrRef.parse('Method'),
        MDTag.BlobHeapRef.parse('Instantiation')
    )
コード例 #28
0
def MakeAssemblyRefProcessorRow():
    return construct.Struct('AssemblyRefProcessorRow',
        construct.ULInt32('Processor'),
        MDTag.AssemblyRefRId.parse('AssemblyRef')
    )
コード例 #29
0
def MakeEnCLogRow():
    return construct.Struct('EnCLogRow',
        construct.ULInt32('Token'),
        construct.ULInt32('FuncCode')
    )
コード例 #30
0
def MakeModuleRefRow():
    return construct.Struct('ModuleRefRow',
        MDTag.StringHeapRef.parse('Name')
    )