Ejemplo n.º 1
0
        static unsafe void AssemblyName_nInit(byte *obj, out TysosAssembly assembly, bool forIntrospection, bool raiseResolveEvent)
        {
            string name = CastOperations.ReinterpretAsString(*(void **)(obj + ClassOperations.GetFieldOffset("_ZW19System#2EReflection12AssemblyName", "_Name")));

            System.Diagnostics.Debugger.Log(0, "libsupcs", "AssemblyName_nInit(" + name + ", out TysosAssembly, bool, bool) called");

            // split assembly name off from other fields
            int    comma = name.IndexOf(',');
            string Name;

            if (comma != -1)
            {
                Name = name.Substring(0, comma);
            }
            else
            {
                Name = name;
            }

            if (Name.Equals("System.Private.CoreLib"))
            {
                Name = "mscorlib";
            }

            *(void **)(obj + ClassOperations.GetFieldOffset("_ZW19System#2EReflection12AssemblyName", "_Name")) =
                CastOperations.ReinterpretAsPointer(Name);

            System.Diagnostics.Debugger.Log(0, "libsupcs", "AssemblyName_nInit - setting _Name to " + Name);

            assembly = null;
        }
Ejemplo n.º 2
0
        static byte *GetResource(TysosAssembly ass, string resourceName, out ulong length, StackCrawlMarkHandle stackMark,
                                 bool skipSecurityCheck)
        {
            System.Diagnostics.Debugger.Log(0, "libsupcs", "TysosAssembly.GetResource(" + ass.assemblyName + ", " + resourceName + ", out ulong length, " +
                                            "StackCrawlMarkHandle stackMark, bool skipSecurityCheck) called");

            var res_addr = JitOperations.GetAddressOfObject(ass.assemblyName + "_resources");

            if (res_addr == null)
            {
                System.Diagnostics.Debugger.Log(0, "libsupcs", "TysosAssembly.GetResource: cannot find " + ass.assemblyName + "_resources");
                length = 0;
                return(null);
            }

            uint *ret = (uint *)res_addr;

            // length is the first int32
            length = *ret++;

            System.Diagnostics.Debugger.Log(0, "libsupcs", "TysosAssembly.GetResource: returning: " + ((ulong)ret).ToString("X") +
                                            ", length: " + length.ToString("X"));

            return((byte *)ret);
        }
Ejemplo n.º 3
0
 static void *GetManifestResource(TysosAssembly ass, string name, out int size, out System.Reflection.Module mod)
 {
     // this always fails for now
     System.Diagnostics.Debugger.Log(0, "libsupcs", "TysosAssembly: GetManifestResource(" + ass.assemblyName + ", " + name + ", out int size, out Module mod) called");
     size = 0;
     mod  = null;
     return(null);
 }
Ejemplo n.º 4
0
 internal TysosModule(void *_aptr, string ass_name)
 {
     aptr = _aptr;
     ass  = new TysosAssembly(this, ass_name);
 }