Permalink
Browse files

Move dead code

svn path=/old-code/; revision=133369
  • Loading branch information...
1 parent f79abb9 commit ee070414c08221450d9f902b8e191a761d1a0905 @migueldeicaza migueldeicaza committed May 2, 2009
Showing with 17,069 additions and 0 deletions.
  1. +41 −0 Mono.PEToolkit/BadImageException.cs
  2. +127 −0 Mono.PEToolkit/COFFHeader.cs
  3. +49 −0 Mono.PEToolkit/ChangeLog
  4. +186 −0 Mono.PEToolkit/Characteristics.cs
  5. +117 −0 Mono.PEToolkit/CheckSum.cs
  6. +409 −0 Mono.PEToolkit/CorHeader.cs
  7. +1 −0 Mono.PEToolkit/DEPRECATED
  8. +117 −0 Mono.PEToolkit/DOSHeader.cs
  9. +132 −0 Mono.PEToolkit/DataDir.cs
  10. +79 −0 Mono.PEToolkit/ExeSignature.cs
  11. +297 −0 Mono.PEToolkit/Image.cs
  12. +272 −0 Mono.PEToolkit/LEBitConverter.cs
  13. +278 −0 Mono.PEToolkit/MachineId.cs
  14. +15 −0 Mono.PEToolkit/Makefile
  15. +41 −0 Mono.PEToolkit/Mono.PEToolkit.dll.sources
  16. +698 −0 Mono.PEToolkit/PEHeader.cs
  17. +192 −0 Mono.PEToolkit/PEUtils.cs
  18. +1 −0 Mono.PEToolkit/README
  19. +143 −0 Mono.PEToolkit/RVA.cs
  20. +234 −0 Mono.PEToolkit/Section.cs
  21. +213 −0 Mono.PEToolkit/SectionCharacteristics.cs
  22. +132 −0 Mono.PEToolkit/Subsystem.cs
  23. +3 −0 Mono.PEToolkit/build/ChangeLog
  24. +23 −0 Mono.PEToolkit/build/Makefile
  25. +64 −0 Mono.PEToolkit/build/mddump.cs
  26. +42 −0 Mono.PEToolkit/build/mddump.exe.sources
  27. +14 −0 Mono.PEToolkit/build/srcgen/a.bat
  28. +10 −0 Mono.PEToolkit/build/srcgen/bitconv-types.xml
  29. +149 −0 Mono.PEToolkit/build/srcgen/bitconverter.xsl
  30. +34 −0 Mono.PEToolkit/build/srcgen/coded-id.xsl
  31. +549 −0 Mono.PEToolkit/build/srcgen/data/ilasm.xml
  32. +589 −0 Mono.PEToolkit/build/srcgen/data/md-schema.xml
  33. +36 −0 Mono.PEToolkit/build/srcgen/elem-type.xsl
  34. +72 −0 Mono.PEToolkit/build/srcgen/gen-utils.xsl
  35. +225 −0 Mono.PEToolkit/build/srcgen/rows.xsl
  36. +41 −0 Mono.PEToolkit/build/srcgen/table-id.xsl
  37. +69 −0 Mono.PEToolkit/build/srcgen/tabs-base.xsl
  38. +255 −0 Mono.PEToolkit/build/srcgen/tabs-decoder.xsl
  39. +53 −0 Mono.PEToolkit/build/srcgen/tabs.xsl
  40. +231 −0 Mono.PEToolkit/build/srcgen/xslt.wsf
  41. +56 −0 Mono.PEToolkit/metadata/AssemblyFlags.cs
  42. +20 −0 Mono.PEToolkit/metadata/BadMetaDataException.cs
  43. +20 −0 Mono.PEToolkit/metadata/ChangeLog
  44. +31 −0 Mono.PEToolkit/metadata/CodedTokenId.cs
  45. +53 −0 Mono.PEToolkit/metadata/ElementType.cs
  46. +40 −0 Mono.PEToolkit/metadata/GUIDHeap.cs
  47. +60 −0 Mono.PEToolkit/metadata/MDHeap.cs
  48. +219 −0 Mono.PEToolkit/metadata/MDStream.cs
  49. +105 −0 Mono.PEToolkit/metadata/MDTable.cs
  50. +158 −0 Mono.PEToolkit/metadata/MDToken.cs
  51. +89 −0 Mono.PEToolkit/metadata/MDUtils.cs
  52. +29 −0 Mono.PEToolkit/metadata/ManifestResourceAttributes.cs
  53. +237 −0 Mono.PEToolkit/metadata/MetaDataRoot.cs
  54. +149 −0 Mono.PEToolkit/metadata/MethodIL.cs
  55. +26 −0 Mono.PEToolkit/metadata/MethodSemanticsAttributes.cs
  56. +54 −0 Mono.PEToolkit/metadata/PInvokeAttributes.cs
  57. +74 −0 Mono.PEToolkit/metadata/Row.cs
  58. +4,887 −0 Mono.PEToolkit/metadata/Rows.cs
  59. +105 −0 Mono.PEToolkit/metadata/StringsHeap.cs
  60. +66 −0 Mono.PEToolkit/metadata/TableId.cs
  61. +1,375 −0 Mono.PEToolkit/metadata/Tables.cs
  62. +217 −0 Mono.PEToolkit/metadata/TablesHeap.cs
  63. +787 −0 Mono.PEToolkit/metadata/TablesHeapBase.cs
  64. +1,933 −0 Mono.PEToolkit/metadata/TabsDecoder.cs
  65. +46 −0 Mono.PEToolkit/metadata/TokenType.cs
@@ -0,0 +1,41 @@
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+/*
+ * Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
+ */
+
+using System;
+
+namespace Mono.PEToolkit {
+
+ public class BadImageException : Exception {
+
+ public BadImageException() : base()
+ {
+ }
+
+ public BadImageException(string msg) : base(msg)
+ {
+ }
+ }
+
+}
@@ -0,0 +1,127 @@
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+/*
+ * Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
+ */
+
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+
+namespace Mono.PEToolkit {
+
+ public class COFFHeader {
+
+ private MachineId machine;
+ private short sections;
+ private uint tdStampRaw;
+ private uint symTabPtr;
+ private uint numSymbols;
+ private short optHeaderSize;
+ private Characteristics characteristics;
+
+ public MachineId Machine {
+ get { return machine; }
+ set { machine = value; }
+ }
+
+ public short NumberOfSections {
+ get { return sections; }
+ set { sections = value; }
+ }
+
+ public uint TimeDateStamp {
+ get { return tdStampRaw; }
+ set { tdStampRaw = value; }
+ }
+
+ public DateTime TimeStamp {
+ get {
+ return (new DateTime(1970, 1, 1) +
+ TimeSpan.FromSeconds(tdStampRaw)).ToLocalTime();
+ }
+ }
+
+ public uint PointerToSymbolTable {
+ get { return symTabPtr; }
+ set { symTabPtr = value; }
+ }
+
+ public uint NumberOfSymbols {
+ get { return numSymbols; }
+ set { numSymbols = value; }
+ }
+
+ public short SizeOfOptionalHeader {
+ get { return optHeaderSize; }
+ set { optHeaderSize = value; }
+ }
+
+ public Characteristics Characteristics {
+ get { return characteristics; }
+ set { characteristics = value; }
+ }
+
+ public void Read (BinaryReader reader)
+ {
+ machine = (MachineId) reader.ReadUInt16 ();
+ sections = reader.ReadInt16 ();
+ tdStampRaw = reader.ReadUInt32 ();
+ symTabPtr = reader.ReadUInt32 ();
+ numSymbols = reader.ReadUInt32 ();
+ optHeaderSize = reader.ReadInt16 ();
+ characteristics = (Characteristics) reader.ReadUInt16 ();
+ }
+
+ public void Write (BinaryWriter writer)
+ {
+ writer.Write ((ushort)machine);
+ writer.Write (sections);
+ writer.Write (tdStampRaw);
+ writer.Write (symTabPtr);
+ writer.Write (numSymbols);
+ writer.Write (optHeaderSize);
+ writer.Write ((ushort)characteristics);
+ }
+
+ public void Dump(TextWriter writer)
+ {
+ writer.WriteLine(
+ "Machine ID : {0}" + Environment.NewLine +
+ "Sections : {1}" + Environment.NewLine +
+ "Characteristics : {2}" + Environment.NewLine +
+ "timestamp : {3} ({4})" + Environment.NewLine
+ ,machine, sections, (ushort)characteristics,
+ TimeStamp, tdStampRaw.ToString("X")
+ );
+ }
+
+ public override string ToString()
+ {
+ StringWriter sw = new StringWriter();
+ Dump(sw);
+ return sw.ToString();
+ }
+
+ }
+}
+
View
@@ -0,0 +1,49 @@
+2003-03-01 Jackson Harper <jackson@latitudegeo.com>
+
+ * Image.cs: Write Metadata root
+
+2003-02-23 Peter Williams <peterw@ximian.com>
+
+ * makefile.gnu (all): Give this dependencies
+ so that we don't rebuild every time.
+ (all): Take two.
+
+2003-02-22 Jackson Harper <jackson@latitudegeo.com>
+
+ * Image.cs: Write CorHeader
+
+2003-02-22 Jackson Harper <jackson@latitudegeo.com>
+
+ * Image.cs: Write Sections
+
+2003-02-22 Jackson Harper <jackson@latitudegeo.com>
+
+ * Section.cs: Add method for writing Sections
+
+2003-02-21 Jackson Harper <jackson@latitudegeo.com>
+
+ * Section.cs: Add Method to write Headers
+
+2003-02-21 Jackson Harper <jackson@latitudegeo.com>
+
+ * Section.cs: Make Read method safe
+
+2003-02-21 Jackson Harper <jackson@latitudegeo.com>
+
+ * Section.cs: Convert Header to a class and lowers it accesability.
+
+2003-02-17 Jackson Harper <jackson@latitudegeo.com>
+
+ * COFFHeader.cs: Convert to class, use Read and Write methods. Compress some code
+ * CheckSum.cs: Access Lfanew through property not field.
+ * CorHeader.cs: Convert to class, use Read and Write methods.
+ * DOSHeader.cs: Convert to class, use Read and Write methods, and Init method for creating
+ new DOSHeaders
+ * DataDir.cs: Convert to class, use Read and Write methods.
+ * Image.cs: Access lfanew through property, add Write method.
+ * PEHeader.cs: Convert to class, use Read and Write methods.
+ * PEUtils.cs: Add GetString method for converting byte pointers to strings.
+ * RVA.cs: Add Write method
+ * Section.cs: Use PEUtils.GetString method instead of new string (byte*)
+ * makefuile.gnu: Compile all the files I want compiled ;-)
+
Oops, something went wrong.

0 comments on commit ee07041

Please sign in to comment.