CodeExplorer Posted September 21 Posted September 21 How to get Tables length with dnlib?? Fallowing tables: 0x1B000000 TypeSpec 0x01000000 TypeRef 0x02000000 TypeDef 0x0A000000 MemberRef 0x04000000 Field 0x06000000 Method 0x2B000000 MethodTyPar 0x70000000 String 0x11000000 StandAloneSig
CodeExplorer Posted September 22 Author Posted September 22 I got it: private uint GetTableLength(uint table) { if (table==0) return 0; if (Program.module==null) return 0; TablesStream tablesStream = Program.module.Metadata.TablesStream; if (tablesStream==null) return 0; if ((table&0xFFFFFF)==0) table = table>>24; //MDTable mdtable = tablesStream.Get((Table)0x2B); if (table==0x1B) return tablesStream.TypeSpecTable.Rows; else if (table==0x01) return tablesStream.TypeRefTable.Rows; else if (table==0x02) return tablesStream.TypeDefTable.Rows; else if (table==0x0A) return tablesStream.MemberRefTable.Rows; else if (table==0x04) return tablesStream.FieldTable.Rows; else if (table==0x06) return tablesStream.MethodTable.Rows; else if (table==0x2B) return tablesStream.MethodSpecTable.Rows; else if (table==0x70) // string return Program.module.USStream.StreamLength; else if (table==0x11) return tablesStream.StandAloneSigTable.Rows; return 0; } 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now