📄 jclmetadata.pas
字号:
FSize: DWORD;
FCode: Pointer;
FMaxStack: DWORD;
FLocalVarSignToken: TJclClrToken;
FLocalVarSign: TJclClrLocalVarSign;
FEHTable: TObjectList;
procedure AddEHTable(EHTable: PImageCorILMethodSectEH);
procedure AddOptILTable(OptILTable: Pointer; Size: Integer);
procedure ParseMoreSections(SectHeader: PImageCorILMethodSectHeader);
function GetExceptionHandler(const Idx: Integer): TJclClrExceptionHandler;
function GetExceptionHandlerCount: Integer;
function GetLocalVarSign: TJclClrLocalVarSign;
function GetLocalVarSignData: TJclClrBlobRecord;
public
constructor Create(const AMethod: TJclClrTableMethodDefRow);
destructor Destroy; override;
property Method: TJclClrTableMethodDefRow read FMethod;
property Size: DWORD read FSize;
property Code: Pointer read FCode;
property MaxStack: DWORD read FMaxStack;
property LocalVarSignToken: TJclClrToken read FLocalVarSignToken;
property LocalVarSignData: TJclClrBlobRecord read GetLocalVarSignData;
property LocalVarSign: TJclClrLocalVarSign read GetLocalVarSign;
property ExceptionHandlers[const Idx: Integer]: TJclClrExceptionHandler read GetExceptionHandler;
property ExceptionHandlerCount: Integer read GetExceptionHandlerCount;
end;
TJclClrCustomModifierSign = class(TJclClrSignature)
private
FRequired: Boolean;
FToken: TJclClrToken;
public
constructor Create(const ABlob: TJclClrBlobRecord);
property Required: Boolean read FRequired;
property Token: TJclClrToken read FToken;
end;
TJclClrMethodSign = class;
TJclClrMethodParam = class(TJclClrSignature)
private
FCustomMods: TObjectList;
FByRef: Boolean;
FElementType: TJclClrElementType;
FToken: TJclClrToken;
FMethodSign: TJclClrMethodSign;
FArraySign: TJclClrArraySign;
function GetCustomModifier(const Idx: Integer): TJclClrCustomModifierSign;
function GetCustomModifierCount: Integer;
public
constructor Create(const ABlob: TJclClrBlobRecord);
destructor Destroy; override;
property CustomModifiers[const Idx: Integer]: TJclClrCustomModifierSign read GetCustomModifier;
property CustomModifierCount: Integer read GetCustomModifierCount;
property ElementType: TJclClrElementType read FElementType;
property ByRef: Boolean read FByRef;
property Token: TJclClrToken read FToken;
property MethodSign: TJclClrMethodSign read FMethodSign;
property ArraySign: TJclClrArraySign read FArraySign;
end;
TJclClrMethodRetType = class(TJclClrMethodParam)
end;
TJclClrMethodSignFlag = (mfHasThis, mfExplicitThis, mfDefault, mfVarArg);
TJclClrMethodSignFlags = set of TJclClrMethodSignFlag;
TJclClrMethodSign = class(TJclClrSignature)
private
FFlags: TJclClrMethodSignFlags;
FParams: TObjectList;
FRetType: TJclClrMethodRetType;
function GetParam(const Idx: Integer): TJclClrMethodParam;
function GetParamCount: Integer;
public
constructor Create(const ABlob: TJclClrBlobRecord);
destructor Destroy; override;
property Flags: TJclClrMethodSignFlags read FFlags;
property Params[const Idx: Integer]: TJclClrMethodParam read GetParam;
property ParamCount: Integer read GetParamCount;
property RetType: TJclClrMethodRetType read FRetType;
end;
TJclClrMemberAccess =
(maCompilercontrolled, maPrivate, maFamilyAndAssembly,
maAssembly, maFamily, maFamilyOrAssembly, maPublic);
TJclClrMethodFlag =
(mfStatic, mfFinal, mfVirtual, mfHideBySig,
mfCheckAccessOnOverride, mfAbstract, mfSpecialName,
mfPInvokeImpl, mfUnmanagedExport,
mfRTSpcialName, mfHasSecurity, mfRequireSecObject);
TJclClrMethodFlags = set of TJclClrMethodFlag;
TJclClrMethodCodeType = (ctIL, ctNative, ctOptIL, ctRuntime);
TJclClrMethodImplFlag =
(mifForwardRef, mifPreserveSig, mifInternalCall,
mifSynchronized, mifNoInlining);
TJclClrMethodImplFlags = set of TJclClrMethodImplFlag;
TJclClrTableMethodDefRow = class(TJclClrTableRow)
private
FRVA: DWORD;
FImplFlags: Word;
FFlags: Word;
FNameOffset: DWORD;
FSignatureOffset: DWORD;
FParamListIdx: DWORD;
FParentToken: TJclClrTableTypeDefRow;
FParams: TList;
FMethodBody: TJclClrMethodBody;
FSignature: TJclClrMethodSign;
function GetName: WideString;
function GetSignatureData: TJclClrBlobRecord;
function GetParam(const Idx: Integer): TJclClrTableParamDefRow;
function GetParamCount: Integer;
function GetHasParam: Boolean;
procedure UpdateParams;
function GetFullName: WideString;
function GetSignature: TJclClrMethodSign;
function GetMemberAccess: TJclClrMemberAccess;
function GetMethodFlags: TJclClrMethodFlags;
function GetNewSlot: Boolean;
function GetCodeType: TJclClrMethodCodeType;
function GetManaged: Boolean;
function GetMethodImplFlags: TJclClrMethodImplFlags;
protected
constructor Create(const ATable: TJclClrTable); override;
procedure Update; override;
procedure SetParentToken(const ARow: TJclClrTableTypeDefRow);
public
function DumpIL: string; override;
destructor Destroy; override;
property RVA: DWORD read FRVA;
property ImplFlags: Word read FImplFlags;
property Flags: Word read FFlags;
property NameOffset: DWORD read FNameOffset;
property SignatureOffset: DWORD read FSignatureOffset;
property ParamListIdx: DWORD read FParamListIdx;
property Name: WideString read GetName;
property FullName: WideString read GetFullName;
property MethodFlags: TJclClrMethodFlags read GetMethodFlags;
property MethodImplFlags: TJclClrMethodImplFlags read GetMethodImplFlags;
property MemberAccess: TJclClrMemberAccess read GetMemberAccess;
property NewSlot: Boolean read GetNewSlot;
property CodeType: TJclClrMethodCodeType read GetCodeType;
property Managed: Boolean read GetManaged;
property Signature: TJclClrMethodSign read GetSignature;
property SignatureData: TJclClrBlobRecord read GetSignatureData;
property ParentToken: TJclClrTableTypeDefRow read FParentToken;
property HasParam: Boolean read GetHasParam;
property Params[const Idx: Integer]: TJclClrTableParamDefRow read GetParam;
property ParamCount: Integer read GetParamCount;
property MethodBody: TJclClrMethodBody read FMethodBody;
end;
TJclClrTableMethodDef = class(TJclClrTable)
private
function GetRow(const Idx: Integer): TJclClrTableMethodDefRow;
protected
class function TableRowClass: TJclClrTableRowClass; override;
public
property Rows[const Idx: Integer]: TJclClrTableMethodDefRow read GetRow; default;
end;
TJclClrTableMethodPtrRow = class(TJclClrTableRow)
private
FMethodIdx: DWORD;
function GetMethod: TJclClrTableMethodDefRow;
protected
constructor Create(const ATable: TJclClrTable); override;
public
property MethodIdx: DWORD read FMethodIdx;
property Method: TJclClrTableMethodDefRow read GetMethod;
end;
TJclClrTableMethodPtr = class(TJclClrTable)
private
function GetRow(const Idx: Integer): TJclClrTableMethodPtrRow;
protected
class function TableRowClass: TJclClrTableRowClass; override;
public
property Rows[const Idx: Integer]: TJclClrTableMethodPtrRow read GetRow; default;
end;
TJclClrTableMethodImplRow = class(TJclClrTableRow)
private
FClassIdx: DWORD;
FMethodBodyIdx: DWORD;
FMethodDeclarationIdx: DWORD;
protected
constructor Create(const ATable: TJclClrTable); override;
public
property ClassIdx: DWORD read FClassIdx;
property MethodBodyIdx: DWORD read FMethodBodyIdx;
property MethodDeclarationIdx: DWORD read FMethodDeclarationIdx;
end;
TJclClrTableMethodImpl = class(TJclClrTable)
private
function GetRow(const Idx: Integer): TJclClrTableMethodImplRow;
protected
class function TableRowClass: TJclClrTableRowClass; override;
public
property Rows[const Idx: Integer]: TJclClrTableMethodImplRow read GetRow; default;
end;
TJclClrTableMethodSemanticsRow = class(TJclClrTableRow)
private
FSemantics: Word;
FMethodIdx: DWORD;
FAssociationIdx: DWORD;
protected
constructor Create(const ATable: TJclClrTable); override;
public
property Semantics: Word read FSemantics;
property MethodIdx: DWORD read FMethodIdx;
property AssociationIdx: DWORD read FAssociationIdx;
end;
TJclClrTableMethodSemantics = class(TJclClrTable)
private
function GetRow(const Idx: Integer): TJclClrTableMethodSemanticsRow;
protected
class function TableRowClass: TJclClrTableRowClass; override;
public
property Rows[const Idx: Integer]: TJclClrTableMethodSemanticsRow read GetRow; default;
end;
TJclClrTableMethodSpecRow = class(TJclClrTableRow)
private
FMethodIdx: DWORD;
FInstantiationOffset: DWORD;
function GetInstantiation: TJclClrBlobRecord;
function GetMethod: TJclClrTableRow;
protected
constructor Create(const ATable: TJclClrTable); override;
public
property MethodIdx: DWORD read FMethodIdx;
property InstantiationOffset: DWORD read FInstantiationOffset;
property Method: TJclClrTableRow read GetMethod;
property Instantiation: TJclClrBlobRecord read GetInstantiation;
end;
TJclClrTableMethodSpec = class(TJclClrTable)
private
function GetRow(const Idx: Integer): TJclClrTableMethodSpecRow;
protected
class function TableRowClass: TJclClrTableRowClass; override;
public
property Rows[const Idx: Integer]: TJclClrTableMethodSpecRow read GetRow; default;
end;
TJclClrTableNestedClassRow = class(TJclClrTableRow)
private
FEnclosingClassIdx: DWORD;
FNestedClassIdx: DWORD;
protected
constructor Create(const ATable: TJclClrTable); override;
public
property NestedClassIdx: DWORD read FNestedClassIdx;
property EnclosingClassIdx: DWORD read FEnclosingClassIdx;
end;
TJclClrTableNestedClass = class(TJclClrTable)
private
function GetRow(const Idx: Integer): TJclClrTableNestedClassRow;
protected
class function TableRowClass: TJclClrTableRowClass; override;
public
property Rows[const Idx: Integer]: TJclClrTableNestedClassRow read GetRow; default;
end;
TJclClrTablePropertyFlag = (pfSpecialName, pfRTSpecialName, pfHasDefault);
TJclClrTablePropertyFlags = set of TJclClrTablePropertyFlag;
TJclClrTablePropertyDefRow = class(TJclClrTableRow)
private
FKindIdx: DWORD;
FNameOffset: DWORD;
FFlags: Word;
function GetName: WideString;
function GetFlags: TJclClrTablePropertyFlags;
protected
constructor Create(const ATable: TJclClrTable); override;
public
function DumpIL: string; override;
property RawFlags: Word read FFlags;
property NameOffset: DWORD read FNameOffset;
property KindIdx: DWORD read FKindIdx;
property Name: WideString read GetName;
property Flags: TJclClrTablePropertyFlags read GetFlags;
end;
TJclClrTablePropertyDef = class(TJclClrTable)
private
function GetRow(const Idx: Integer): TJclClrTablePropertyDefRow;
protected
class function TableRowClass: TJclClrTableRowClass; override;
public
property Rows[const Idx: Integer]: TJclClrTablePropertyDefRow read GetRow; default;
end;
TJclClrTablePropertyPtrRow = class(TJclClrTableRow)
private
FPropertyIdx: DWORD;
function GetProperty: TJclClrTablePropertyDefRow;
protected
constructor Create(const ATable: TJclClrTable); override;
public
property PropertyIdx: DWORD read FPropertyIdx;
property _Property: TJclClrTablePropertyDefRow read GetProperty;
end;
TJclClrTablePropertyPtr = class(TJclClrTable)
private
function GetRow(const Idx: Integer): TJclClrTablePropertyPtrRow;
protected
class function TableRowClass: TJclClrTableRowClass; override;
public
property Rows[const Idx: Integer]: TJclClrTablePropertyPtrRow read GetRow; default;
end;
TJclClrTablePropertyMapRow = class(TJclClrTableRow)
private
FParentIdx: DWORD;
FPropertyListIdx: DWORD;
FProperties: TList;
function GetParent: TJclClrTableTypeDefRow;
function GetProperty(const Idx: Integer): TJclClrTablePropertyDefRow;
function GetPropertyCount: Integer;
protected
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -