Exemplo n.º 1
0
 private static Assembly ReadExistingAssembly(AssemblyName name)
 {
     foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
     {
         AssemblyName name1 = assembly.GetName();
         // ISSUE: reference to a compiler-generated method
         // ISSUE: reference to a compiler-generated method
         if (string.Equals(name1.Name, name.Name, StringComparison.InvariantCultureIgnoreCase) && string.Equals(AssemblyLoader.CultureToString(name1.CultureInfo), AssemblyLoader.CultureToString(name.CultureInfo), StringComparison.InvariantCultureIgnoreCase))
         {
             return(assembly);
         }
     }
     return((Assembly)null);
 }
Exemplo n.º 2
0
        // Token: 0x06000083 RID: 131 RVA: 0x0000C9CC File Offset: 0x0000ABCC
        private static Assembly ReadExistingAssembly(AssemblyName name)
        {
            AppDomain currentDomain = AppDomain.CurrentDomain;

            Assembly[] assemblies = currentDomain.GetAssemblies();
            foreach (Assembly assembly in assemblies)
            {
                AssemblyName name2 = assembly.GetName();
                if (string.Equals(name2.Name, name.Name, StringComparison.InvariantCultureIgnoreCase) && string.Equals(AssemblyLoader.CultureToString(name2.CultureInfo), AssemblyLoader.CultureToString(name.CultureInfo), StringComparison.InvariantCultureIgnoreCase))
                {
                    return(assembly);
                }
            }
            return(null);
        }
Exemplo n.º 3
0
 public static void Attach()
 {
     // ISSUE: reference to a compiler-generated field
     if (Interlocked.Exchange(ref AssemblyLoader.isAttached, 1) == 1)
     {
         return;
     }
     AppDomain.CurrentDomain.AssemblyResolve += (ResolveEventHandler)((sender, e) =>
     {
         // ISSUE: reference to a compiler-generated field
         object nullCacheLock1 = AssemblyLoader.nullCacheLock;
         bool flag1 = false;
         try
         {
             Monitor.Enter(nullCacheLock1, ref flag1);
             // ISSUE: reference to a compiler-generated field
             if (AssemblyLoader.nullCache.ContainsKey(e.Name))
             {
                 return((Assembly)null);
             }
         }
         finally
         {
             if (flag1)
             {
                 Monitor.Exit(nullCacheLock1);
             }
         }
         AssemblyName assemblyName = new AssemblyName(e.Name);
         // ISSUE: reference to a compiler-generated method
         Assembly assembly1 = AssemblyLoader.ReadExistingAssembly(assemblyName);
         if (Assembly.op_Inequality(assembly1, (Assembly)null))
         {
             return(assembly1);
         }
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated method
         Assembly assembly2 = AssemblyLoader.ReadFromEmbeddedResources(AssemblyLoader.assemblyNames, AssemblyLoader.symbolNames, assemblyName);
         if (Assembly.op_Equality(assembly2, (Assembly)null))
         {
             // ISSUE: reference to a compiler-generated field
             object nullCacheLock2 = AssemblyLoader.nullCacheLock;
             bool flag2 = false;
             try
             {
                 Monitor.Enter(nullCacheLock2, ref flag2);
                 // ISSUE: reference to a compiler-generated field
                 AssemblyLoader.nullCache[e.Name] = true;
             }
             finally
             {
                 if (flag2)
                 {
                     Monitor.Exit(nullCacheLock2);
                 }
             }
             if ((assemblyName.Flags & AssemblyNameFlags.Retargetable) != AssemblyNameFlags.None)
             {
                 assembly2 = Assembly.Load(assemblyName);
             }
         }
         return(assembly2);
     });
 }
Exemplo n.º 4
0
 private static Assembly ReadExistingAssembly(AssemblyName name)
 {
     Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
     for (int i = 0; i < assemblies.Length; i++)
     {
         Assembly     assembly = assemblies[i];
         AssemblyName name2    = assembly.GetName();
         if (string.Equals(name2.Name, name.Name, StringComparison.InvariantCultureIgnoreCase) && string.Equals(AssemblyLoader.CultureToString(name2.CultureInfo), AssemblyLoader.CultureToString(name.CultureInfo), StringComparison.InvariantCultureIgnoreCase))
         {
             return(assembly);
         }
     }
     return(null);
 }
Exemplo n.º 5
0
        // Token: 0x06000010 RID: 16 RVA: 0x0000268C File Offset: 0x0000088C
        public static void Attach()
        {
            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.AssemblyResolve += ((object s, ResolveEventArgs e) => AssemblyLoader.ResolveAssembly(e.Name));
        }
Exemplo n.º 6
0
 // Token: 0x0600000F RID: 15 RVA: 0x00002070 File Offset: 0x00000270
 private static Assembly <Attach> b__0(object s, ResolveEventArgs e)
 {
     return(AssemblyLoader.ResolveAssembly(e.Name));
 }
Exemplo n.º 7
0
 // Token: 0x06000003 RID: 3 RVA: 0x0000208C File Offset: 0x0000028C
 private static Assembly ReadExistingAssembly(AssemblyName name)
 {
     foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
     {
         AssemblyName name2 = assembly.GetName();
         bool         flag  = string.Equals(name2.Name, name.Name, StringComparison.InvariantCultureIgnoreCase) && string.Equals(AssemblyLoader.CultureToString(name2.CultureInfo), AssemblyLoader.CultureToString(name.CultureInfo), StringComparison.InvariantCultureIgnoreCase);
         bool         flag2 = flag;
         if (flag2)
         {
             return(assembly);
         }
     }
     return(null);
 }