annotate jet-symbols/src/JetBrains.CommandLine.Symbols/DumpBinaryFileSignCommand.cs @ 102:0e927b14ccf1

restored jet-symbols native tool sources
author Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
date Mon, 16 May 2016 19:40:51 +0300
parents
children
rev   line source
102
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
1 // Decompiled with JetBrains decompiler
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
2 // Type: JetBrains.CommandLine.Symbols.DumpBinaryFileSignCommand
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
3 // Assembly: JetBrains.CommandLine.Symbols, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
4 // MVID: EF046BF6-60AC-48EA-9121-8AF3D8D08853
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
5 // Assembly location: C:\Data\Work\TeamCity\misc\tc-symbol-server\tools\JetSymbols\JetBrains.CommandLine.Symbols.exe
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
6
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
7 using JetBrains.Metadata.Utils;
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
8 using JetBrains.Metadata.Utils.PE;
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
9 using JetBrains.Util;
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
10 using System;
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
11 using System.Collections.Generic;
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
12 using System.IO;
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
13
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
14 namespace JetBrains.CommandLine.Symbols
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
15 {
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
16 public class DumpBinaryFileSignCommand : DumpFilesSignCommandBase
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
17 {
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
18 public const string CMD_NAME = "dumpBinSign";
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
19
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
20 public DumpBinaryFileSignCommand(FileSystemPath outputFilePath, IEnumerable<FileSystemPath> targetFilePaths)
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
21 : base(outputFilePath, targetFilePaths)
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
22 {
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
23 }
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
24
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
25 protected override string GetFileSignature(FileSystemPath targetFilePath)
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
26 {
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
27 try
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
28 {
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
29 using (Stream stream = targetFilePath.OpenFileForReading())
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
30 {
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
31 PEFile peFile = new PEFile((IBinaryReader) new StreamBinaryReader(stream));
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
32 return string.Format("{0:X}{1:X}", (object) peFile.COFFheader.TimeStamp, (object) peFile.NTHeader.ImageSize);
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
33 }
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
34 }
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
35 catch (Exception ex)
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
36 {
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
37 Console.Error.WriteLine(ex.Message);
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
38 return (string) null;
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
39 }
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
40 }
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
41 }
0e927b14ccf1 restored jet-symbols native tool sources
Evgeniy.Koshkin@unit-519.Labs.IntelliJ.Net
parents:
diff changeset
42 }