private void AppendModuleImport(ImageModuleImport moduleImport) { _entryTableBuilder.Segments.Add(moduleImport); _lookupTablesBuilder.GetModuleLookupSegment(moduleImport); AddressTablesBuilder.GetModuleLookupSegment(moduleImport); _nameTableBuilder.GetModuleNameSegment(moduleImport); }
private static ImageModuleImport CreateMscoreeImport(bool isDll) { var module = new ImageModuleImport("mscoree.dll"); module.SymbolImports.Add(new ImageSymbolImport(new HintName(0, isDll ? "_CorDllMain" : "_CorExeMain"))); return(module); }
public void AddModuleImport(ImageModuleImport moduleImport) { _imports.Add(moduleImport); ModuleImportTable.AddModuleImport(moduleImport); LookupTables.GetModuleLookupTable(moduleImport); AddressTables.GetModuleLookupTable(moduleImport); NameTable.GetModuleNameSegment(moduleImport); }
public FileSegment GetModuleNameSegment(ImageModuleImport moduleImport) { FileSegment segment; if (!_moduleNameSegments.TryGetValue(moduleImport, out segment)) { Segments.Add(segment = DataSegment.CreateAsciiString(moduleImport.Name, true)); _moduleNameSegments.Add(moduleImport, segment); } return(segment); }
public static void ValidateModuleImport(ImageModuleImport originalModule, ImageModuleImport newModule) { Assert.Equal(originalModule.Name, newModule.Name); for (int i = 0; i < originalModule.SymbolImports.Count; i++) { Assert.True(i < newModule.SymbolImports.Count); var originalSymbol = originalModule.SymbolImports[i]; var newSymbol = newModule.SymbolImports[i]; ValidateSymbolImport(originalSymbol, newSymbol); } }
public LookupTableBuffer GetModuleLookupTable(ImageModuleImport moduleImport) { LookupTableBuffer segment; if (!_lookupTableSegments.TryGetValue(moduleImport, out segment)) { segment = new LookupTableBuffer(_offsetConverter, _nameTableBuffer) { Is32Bit = Is32Bit }; foreach (var symbolImport in moduleImport.SymbolImports) { segment.GetLookupSegment(symbolImport); } segment.GetLookupSegment(new ImageSymbolImport(0)); Segments.Add(segment); _lookupTableSegments.Add(moduleImport, segment); } return(segment); }
public void AddModuleImport(ImageModuleImport import) { Segments.Insert(Segments.Count - 1, import); }
private static ImageModuleImport CreateMscoreeImport(bool isDll) { var module = new ImageModuleImport("mscoree.dll"); module.SymbolImports.Add(new ImageSymbolImport(new HintName(0, isDll ? "_CorDllMain" : "_CorExeMain"))); return module; }
public FileSegment GetModuleNameSegment(ImageModuleImport moduleImport) { FileSegment segment; if (!_moduleNameSegments.TryGetValue(moduleImport, out segment)) { Segments.Add(segment = DataSegment.CreateAsciiString(moduleImport.Name, true)); _moduleNameSegments.Add(moduleImport, segment); } return segment; }
public LookupTableBuilder GetModuleLookupSegment(ImageModuleImport moduleImport) { LookupTableBuilder segment; if (!_lookupTableSegments.TryGetValue(moduleImport, out segment)) { segment = new LookupTableBuilder(_offsetConverter, _nameTableBuilder) { Is32Bit = Is32Bit }; foreach (var symbolImport in moduleImport.SymbolImports) segment.GetLookupSegment(symbolImport); segment.GetLookupSegment(new ImageSymbolImport(0)); Segments.Add(segment); _lookupTableSegments.Add(moduleImport, segment); } return segment; }
public static void ValidateModuleImport(ImageModuleImport originalModule, ImageModuleImport newModule) { Assert.AreEqual(originalModule.Name, newModule.Name); for (int i = 0; i < originalModule.SymbolImports.Count; i++) { Assert.IsTrue(i < newModule.SymbolImports.Count); var originalSymbol = originalModule.SymbolImports[i]; var newSymbol = newModule.SymbolImports[i]; ValidateSymbolImport(originalSymbol, newSymbol); } }