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; }
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); }
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); }
internal TysosModule(void *_aptr, string ass_name) { aptr = _aptr; ass = new TysosAssembly(this, ass_name); }