title: How can I create a .proto from a .cs file (not the other way around)?
body: <h1>Situation</h1>
  <ul>
  <li>I have some network traffic that is using Protobuf.</li>
  <li>I have the C# files and classes that specify information about the expected fields.</li>
  <li>I want to decode the packets.</li>
  </ul>
  <h1>Problem</h1>
  <ul>
  <li>Everything I find online seems to only explain how to generate .cs classes from a pre-built .proto file, and not the other way around (protobuf-net, protobuf-csharp-port).</li>
  </ul>
  <p>Here is some example code of one of the files that I know has the information I need. There are several files similar to this:</p>
  <pre><code>namespace ExampleUtil
  {
      using Google.ProtocolBuffers;
      
      [DebuggerNonUserCode, CompilerGenerated, GeneratedCode(&quot;ProtoGen&quot;, &quot;2.4.1.473&quot;)]
      public sealed class UtilAuth : GeneratedMessageLite&lt;UtilAuth, UtilAuth.Builder&gt;
      {
          private static readonly string[] _utilAuthFieldNames = new string[] { &quot;result&quot; };
          private static readonly uint[] _utilAuthFieldTags = new uint[] { 8 };
          private static readonly UtilAuth defaultInstance = new UtilAuth().MakeReadOnly();
          private bool hasResult;
          
          static UtilAuth()
          {
              object.ReferenceEquals(Examplelite.Descriptor, null);
          }
  
          ...
  
          [CompilerGenerated, GeneratedCode(&quot;ProtoGen&quot;, &quot;2.4.1.473&quot;), DebuggerNonUserCode]
          public static class Types
          {
              [CompilerGenerated, GeneratedCode(&quot;ProtoGen&quot;, &quot;2.4.1.473&quot;)]
              public enum PacketID
              {
                  ID = 0xcc
              }
  
              [GeneratedCode(&quot;ProtoGen&quot;, &quot;2.4.1.473&quot;), CompilerGenerated]
              public enum Result
              {
                  UNKNOWN,
                  ALLOWED,
                  INVALID,
                  NO_SERVER
              }
          }
  </code></pre>
  <p>And so on. It seems like this was generated from a proto file, but I don't know how to get that back.</p>
  <h1>The Goal</h1>
  <p>I'd ideally like to be able to open a stream up in Python, and using the generated proto file, simply print the contents in human-readable format.</p>