示例#1
0
 internal override void vmethod_1(BinaryReader reader)
 {
     this.typeBools_0 = (BfType.TypeBools)reader.ReadInt16();
     this.bool_0      = reader.ReadBoolean();
     this.bool_1      = reader.ReadBoolean();
     this.int_0       = reader.ReadInt32();
     this.string_1    = reader.ReadString();
     this.int_1       = reader.ReadInt32();
     this.bfType_0    = new BfType
     {
         Id = reader.ReadInt32()
     };
     this.fieldCollection_0.method_6(reader);
     this.methodCollection_0.method_6(reader);
     this.eventCollection_0.method_6(reader);
     this.typeCollection_0.method_6(reader);
     this.typeCollection_1.method_6(reader);
     this.typeCollection_2.method_6(reader);
     this.typeCollection_3.method_6(reader);
     this.bfAssembly_0 = new BfAssembly
     {
         Id = reader.ReadInt32()
     };
     this.bfNamespace_0 = new BfNamespace
     {
         Id = reader.ReadInt32()
     };
 }
示例#2
0
        private void method_0(Dictionary <string, AssemblyTuple> nameToAssemblyTuples)
        {
            Dictionary <AssemblyDefinition, BfAssembly> dictionary = new Dictionary <AssemblyDefinition, BfAssembly>();

            foreach (AssemblyTuple assemblyTuple in nameToAssemblyTuples.Values)
            {
                AssemblyTuple assemblyTuple;
                if (!dictionary.ContainsKey(assemblyTuple.Assembly))
                {
                    BfAssembly bfAssembly = new BfAssembly(this, assemblyTuple.Assembly, assemblyTuple.IsCoreAssembly, assemblyTuple.Directory);
                    dictionary.Add(assemblyTuple.Assembly, bfAssembly);
                    foreach (ModuleDefinition moduleDefinition in assemblyTuple.Assembly.Modules)
                    {
                        if (!this.dictionary_1.ContainsKey(moduleDefinition.Name))
                        {
                            this.dictionary_1.Add(moduleDefinition.Name, bfAssembly);
                        }
                        if (assemblyTuple.IsCoreAssembly)
                        {
                            foreach (TypeDefinition typeDefinition_ in moduleDefinition.Types)
                            {
                                this.method_12(typeDefinition_, bfAssembly);
                            }
                        }
                    }
                }
            }
            foreach (string current in nameToAssemblyTuples.Keys)
            {
                AssemblyTuple      assemblyTuple = nameToAssemblyTuples[current];
                AssemblyDefinition assembly      = assemblyTuple.Assembly;
                this.dictionary_0.Add(current, dictionary[assembly]);
            }
        }
示例#3
0
 internal BfType(BfCache cache, TypeDefinition type, BfAssembly assembly)
 {
     this.typeDefinition_0 = type;
     this.bfCache_0        = cache;
     this.string_1         = this.typeDefinition_0.Name;
     this.bfAssembly_0     = assembly;
     this.bfNamespace_0    = cache.method_13(this);
     this.IsClass          = this.typeDefinition_0.IsClass;
     this.IsEnum           = this.typeDefinition_0.IsEnum;
     this.IsValueType      = this.typeDefinition_0.IsValueType;
     this.IsInterface      = this.typeDefinition_0.IsInterface;
     if (this.typeDefinition_0.IsNestedAssembly)
     {
         this.IsNested   = true;
         this.IsInternal = true;
     }
     if (this.typeDefinition_0.IsNestedFamily)
     {
         this.IsNested    = true;
         this.IsProtected = true;
     }
     if (this.typeDefinition_0.IsNestedFamilyAndAssembly)
     {
         this.IsNested = true;
         this.IsProtectedAndInternal = true;
     }
     if (this.typeDefinition_0.IsNestedFamilyOrAssembly)
     {
         this.IsNested = true;
         this.IsProtectedOrInternal = true;
     }
     if (this.typeDefinition_0.IsNestedPrivate)
     {
         this.IsNested  = true;
         this.IsPrivate = true;
     }
     if (this.typeDefinition_0.IsNestedPublic)
     {
         this.IsNested = true;
         this.IsPublic = true;
     }
     this.IsInternal = this.typeDefinition_0.IsNotPublic;
     this.IsPublic   = this.typeDefinition_0.IsPublic;
     if (this.typeDefinition_0.IsSealed && this.typeDefinition_0.IsAbstract)
     {
         this.IsStatic = true;
     }
     else
     {
         this.IsSealed   = this.typeDefinition_0.IsSealed;
         this.IsAbstract = this.typeDefinition_0.IsAbstract;
     }
 }
示例#4
0
 internal override void vmethod_2(BfCache cache)
 {
     this.bfType_0 = ((this.bfType_0.Id == -1) ? null : cache.Types[this.bfType_0.Id]);
     this.fieldCollection_0.method_9(cache);
     this.methodCollection_0.method_9(cache);
     this.eventCollection_0.method_9(cache);
     this.typeCollection_0.method_9(cache);
     this.typeCollection_1.method_9(cache);
     this.typeCollection_2.method_9(cache);
     this.typeCollection_3.method_9(cache);
     this.bfAssembly_0  = ((this.bfAssembly_0.Id == -1) ? null : cache.Assemblies[this.bfAssembly_0.Id]);
     this.bfNamespace_0 = ((this.bfNamespace_0.Id == -1) ? null : cache.Namespaces[this.bfNamespace_0.Id]);
 }
示例#5
0
        internal BfType method_12(TypeDefinition typeDefinition_0, BfAssembly bfAssembly_0)
        {
            string text = BfCache.smethod_2(typeDefinition_0);
            BfType result;

            if (!bfAssembly_0.method_4().ContainsKey(text))
            {
                BfType bfType = new BfType(this, typeDefinition_0, bfAssembly_0);
                bfAssembly_0.method_4().Add(BfCache.smethod_2(typeDefinition_0), bfType);
                this.Types.method_1(bfType);
                bfAssembly_0.Namespaces.method_1(bfType.Namespace);
                result = bfType;
            }
            else
            {
                Logger.LogWarning("CreateBfType", "Why the hell is this type already exist " + text);
                result = bfAssembly_0.method_4()[text];
            }
            return(result);
        }
示例#6
0
		private static bool smethod_7(BfAssembly bfAssembly_0)
		{
			return bfAssembly_0.IsCoreAssembly;
		}
示例#7
0
		private static bool smethod_6(BfAssembly bfAssembly_0)
		{
			return bfAssembly_0.Name == "mscorlib" && bfAssembly_0.Version.CompareTo("2.0.0.0") > -1;
		}
示例#8
0
		internal BfType method_12(TypeDefinition typeDefinition_0, BfAssembly bfAssembly_0)
		{
			string text = BfCache.smethod_2(typeDefinition_0);
			BfType result;
			if (!bfAssembly_0.method_4().ContainsKey(text))
			{
				BfType bfType = new BfType(this, typeDefinition_0, bfAssembly_0);
				bfAssembly_0.method_4().Add(BfCache.smethod_2(typeDefinition_0), bfType);
				this.Types.method_1(bfType);
				bfAssembly_0.Namespaces.method_1(bfType.Namespace);
				result = bfType;
			}
			else
			{
				Logger.LogWarning("CreateBfType", "Why the hell is this type already exist " + text);
				result = bfAssembly_0.method_4()[text];
			}
			return result;
		}
示例#9
0
		private void method_0(Dictionary<string, AssemblyTuple> nameToAssemblyTuples)
		{
			Dictionary<AssemblyDefinition, BfAssembly> dictionary = new Dictionary<AssemblyDefinition, BfAssembly>();
			foreach (AssemblyTuple assemblyTuple in nameToAssemblyTuples.Values)
			{
				AssemblyTuple assemblyTuple;
				if (!dictionary.ContainsKey(assemblyTuple.Assembly))
				{
					BfAssembly bfAssembly = new BfAssembly(this, assemblyTuple.Assembly, assemblyTuple.IsCoreAssembly, assemblyTuple.Directory);
					dictionary.Add(assemblyTuple.Assembly, bfAssembly);
					foreach (ModuleDefinition moduleDefinition in assemblyTuple.Assembly.Modules)
					{
						if (!this.dictionary_1.ContainsKey(moduleDefinition.Name))
						{
							this.dictionary_1.Add(moduleDefinition.Name, bfAssembly);
						}
						if (assemblyTuple.IsCoreAssembly)
						{
							foreach (TypeDefinition typeDefinition_ in moduleDefinition.Types)
							{
								this.method_12(typeDefinition_, bfAssembly);
							}
						}
					}
				}
			}
			foreach (string current in nameToAssemblyTuples.Keys)
			{
				AssemblyTuple assemblyTuple = nameToAssemblyTuples[current];
				AssemblyDefinition assembly = assemblyTuple.Assembly;
				this.dictionary_0.Add(current, dictionary[assembly]);
			}
		}
示例#10
0
 private static bool smethod_7(BfAssembly bfAssembly_0)
 {
     return(bfAssembly_0.IsCoreAssembly);
 }
示例#11
0
 private static bool smethod_6(BfAssembly bfAssembly_0)
 {
     return(bfAssembly_0.Name == "mscorlib" && bfAssembly_0.Version.CompareTo("2.0.0.0") > -1);
 }
示例#12
0
        internal BfType method_7(TypeReference typeReference_0)
        {
            BfType result;

            if (typeReference_0 == null)
            {
                result = null;
            }
            else
            {
                BfType bfType = null;
                typeReference_0 = BfCache.smethod_3(typeReference_0);
                if (typeReference_0 is GenericParameter)
                {
                    IEnumerable <BfAssembly> arg_53_0 = this.dictionary_0.Values;
                    if (BfCache.func_1 == null)
                    {
                        BfCache.func_1 = new Func <BfAssembly, bool>(BfCache.smethod_6);
                    }
                    BfAssembly bfAssembly = arg_53_0.Where(BfCache.func_1).FirstOrDefault <BfAssembly>();
                    if (bfAssembly == null)
                    {
                        IEnumerable <BfAssembly> arg_8F_0 = this.dictionary_0.Values;
                        if (BfCache.func_2 == null)
                        {
                            BfCache.func_2 = new Func <BfAssembly, bool>(BfCache.smethod_7);
                        }
                        bfAssembly = arg_8F_0.Where(BfCache.func_2).FirstOrDefault <BfAssembly>();
                    }
                    if (bfAssembly.method_4().ContainsKey(typeReference_0.FullName))
                    {
                        bfType = bfAssembly.method_4()[typeReference_0.FullName];
                    }
                    else
                    {
                        bfType = this.method_12(new TypeDefinition(typeReference_0.Name, typeReference_0.Namespace, TypeAttributes.Abstract, null), bfAssembly);
                    }
                    result = bfType;
                }
                else
                {
                    BfAssembly bfAssembly2 = null;
                    try
                    {
                        if (typeReference_0.Scope is AssemblyNameReference)
                        {
                            bfAssembly2 = this.dictionary_0[((AssemblyNameReference)typeReference_0.Scope).FullName];
                        }
                        else if (typeReference_0.Scope is ModuleDefinition)
                        {
                            bfAssembly2 = this.dictionary_0[((ModuleDefinition)typeReference_0.Scope).Assembly.Name.FullName];
                        }
                        else if (typeReference_0.Scope is ModuleReference)
                        {
                            bfAssembly2 = this.dictionary_1[((ModuleReference)typeReference_0.Scope).Name];
                        }
                    }
                    catch (KeyNotFoundException)
                    {
                        throw new Exception("Could not find assembly: " + typeReference_0.Scope.ToString());
                    }
                    bfAssembly2.method_4().TryGetValue(BfCache.smethod_2(typeReference_0), out bfType);
                    if (bfType == null)
                    {
                        foreach (ModuleDefinition moduleDefinition in bfAssembly2.method_3().Modules)
                        {
                            foreach (TypeDefinition typeDefinition in moduleDefinition.Types)
                            {
                                if (typeReference_0.FullName == typeDefinition.FullName)
                                {
                                    bfType = this.method_12(typeDefinition, bfAssembly2);
                                    break;
                                }
                            }
                        }
                    }
                    if (bfType != null)
                    {
                        result = bfType;
                    }
                    else
                    {
                        Logger.LogInfo("can't find: " + typeReference_0.FullName);
                        result = null;
                    }
                }
            }
            return(result);
        }
示例#13
0
		internal override void vmethod_2(BfCache cache)
		{
			this.bfType_0 = ((this.bfType_0.Id == -1) ? null : cache.Types[this.bfType_0.Id]);
			this.fieldCollection_0.method_9(cache);
			this.methodCollection_0.method_9(cache);
			this.eventCollection_0.method_9(cache);
			this.typeCollection_0.method_9(cache);
			this.typeCollection_1.method_9(cache);
			this.typeCollection_2.method_9(cache);
			this.typeCollection_3.method_9(cache);
			this.bfAssembly_0 = ((this.bfAssembly_0.Id == -1) ? null : cache.Assemblies[this.bfAssembly_0.Id]);
			this.bfNamespace_0 = ((this.bfNamespace_0.Id == -1) ? null : cache.Namespaces[this.bfNamespace_0.Id]);
		}
示例#14
0
		internal override void vmethod_1(BinaryReader reader)
		{
			this.typeBools_0 = (BfType.TypeBools)reader.ReadInt16();
			this.bool_0 = reader.ReadBoolean();
			this.bool_1 = reader.ReadBoolean();
			this.int_0 = reader.ReadInt32();
			this.string_1 = reader.ReadString();
			this.int_1 = reader.ReadInt32();
			this.bfType_0 = new BfType
			{
				Id = reader.ReadInt32()
			};
			this.fieldCollection_0.method_6(reader);
			this.methodCollection_0.method_6(reader);
			this.eventCollection_0.method_6(reader);
			this.typeCollection_0.method_6(reader);
			this.typeCollection_1.method_6(reader);
			this.typeCollection_2.method_6(reader);
			this.typeCollection_3.method_6(reader);
			this.bfAssembly_0 = new BfAssembly
			{
				Id = reader.ReadInt32()
			};
			this.bfNamespace_0 = new BfNamespace
			{
				Id = reader.ReadInt32()
			};
		}
示例#15
0
		internal BfType(BfCache cache, TypeDefinition type, BfAssembly assembly)
		{
			this.typeDefinition_0 = type;
			this.bfCache_0 = cache;
			this.string_1 = this.typeDefinition_0.Name;
			this.bfAssembly_0 = assembly;
			this.bfNamespace_0 = cache.method_13(this);
			this.IsClass = this.typeDefinition_0.IsClass;
			this.IsEnum = this.typeDefinition_0.IsEnum;
			this.IsValueType = this.typeDefinition_0.IsValueType;
			this.IsInterface = this.typeDefinition_0.IsInterface;
			if (this.typeDefinition_0.IsNestedAssembly)
			{
				this.IsNested = true;
				this.IsInternal = true;
			}
			if (this.typeDefinition_0.IsNestedFamily)
			{
				this.IsNested = true;
				this.IsProtected = true;
			}
			if (this.typeDefinition_0.IsNestedFamilyAndAssembly)
			{
				this.IsNested = true;
				this.IsProtectedAndInternal = true;
			}
			if (this.typeDefinition_0.IsNestedFamilyOrAssembly)
			{
				this.IsNested = true;
				this.IsProtectedOrInternal = true;
			}
			if (this.typeDefinition_0.IsNestedPrivate)
			{
				this.IsNested = true;
				this.IsPrivate = true;
			}
			if (this.typeDefinition_0.IsNestedPublic)
			{
				this.IsNested = true;
				this.IsPublic = true;
			}
			this.IsInternal = this.typeDefinition_0.IsNotPublic;
			this.IsPublic = this.typeDefinition_0.IsPublic;
			if (this.typeDefinition_0.IsSealed && this.typeDefinition_0.IsAbstract)
			{
				this.IsStatic = true;
			}
			else
			{
				this.IsSealed = this.typeDefinition_0.IsSealed;
				this.IsAbstract = this.typeDefinition_0.IsAbstract;
			}
		}