Close() public method

public Close ( ) : void
return void
コード例 #1
0
        void Patch()
        {
            // patch debug info in PE file to match PDB
            //try
            //{
            byte[] DebugInfo = m_writer.GetDebugInfo();
            m_writer.Close();

            RVA  debugHeaderRVA = m_module.Image.PEOptionalHeader.DataDirectories.Debug.VirtualAddress;
            long debugHeaderPos = m_module.Image.ResolveVirtualAddress(debugHeaderRVA);
            uint sizeUntilData  = 0x1c;    // copied from ImageWriter
            long debugDataPos   = debugHeaderPos + sizeUntilData;

            using (FileStream fs = new FileStream(m_assembly, FileMode.Open, FileAccess.Write))
            {
                BinaryWriter writer = new BinaryWriter(fs);
                writer.BaseStream.Position = debugDataPos;
                writer.Write(DebugInfo);
            }
            //  }
            //  catch (Exception ex)
            //  {
            //      System.Diagnostics.Debug.WriteLine("in PdbWriter.Patch: " + ex.Message);
            //  }
        }
コード例 #2
0
ファイル: PdbWriter.cs プロジェクト: rpgmaker/Mono.Cecil
        public void Dispose()
        {
            var entry_point = module.EntryPoint;

            if (entry_point != null)
            {
                writer.SetUserEntryPoint(new SymbolToken(entry_point.MetadataToken.ToInt32()));
            }

            writer.Close();
        }
コード例 #3
0
ファイル: NativePdbWriter.cs プロジェクト: tornado12345/cecil
        public void Write()
        {
            var entry_point = module.EntryPoint;

            if (entry_point != null)
            {
                writer.SetUserEntryPoint(entry_point.MetadataToken.ToInt32());
            }

            debug_info = writer.GetDebugInfo(out debug_directory);
            debug_directory.TimeDateStamp = (int)module.timestamp;

            writer.Close();
        }