public static PEFile ReadPublicClasses(string filename) { Contract.Requires(filename != null); Contract.Ensures(Contract.Result <PEFile>() != null); PEFile pefile = PEReader.ReadPEFile(filename, true); ArrayList newClasses = new ArrayList(); foreach (object cls in pefile.classes) { ClassDef aClass = (ClassDef)cls; if (aClass.isPublic()) { newClasses.Add(aClass); } } pefile.classes = newClasses; return(pefile); }