a pastebin project

Miscellany

  1. --- oSpy/Parser/MSN.cs
  2. +++ oSpy/Parser/MSN.cs
  3. @@ -285,6 +285,68 @@
  4.          }
  5.      }
  6.  
  7. +    public class MSNSBVisualizer : SessionVisualizer
  8. +    {
  9. +        public override string Name
  10. +        {
  11. +            get { return "MSNSwitchboard"; }
  12. +        }
  13. +
  14. +        public override VisualTransaction[] GetTransactions(IPSession session)
  15. +        {
  16. +            List<VisualTransaction> transactions = new List<VisualTransaction>();
  17. +
  18. +            foreach (TransactionNode node in session.Nodes)
  19. +            {
  20. +                if (node.Name == "MSNSBCommand")
  21. +                {
  22. +                    IPPacket pkt = node.Slices[0].Packet;
  23. +
  24. +                    VisualTransaction vt = new VisualTransaction(node.Index, pkt.Direction, pkt.Timestamp);
  25. +
  26. +                    string headline = (string) node["Command"];
  27. +
  28. +                    if (node.Fields.ContainsKey("Arguments"))
  29. +                        headline += " " + (string) node["Arguments"];
  30. +
  31. +                    vt.HeadlineText = headline;
  32. +
  33. +                    TransactionNode payloadNode = node.FindChild("Payload", false);
  34. +                    if (payloadNode != null)
  35. +                    {
  36. +                        string body = "";
  37. +
  38. +                        if (payloadNode.Fields.ContainsKey("XML"))
  39. +                        {
  40. +                            XMLHighlighter highlighter;
  41. +
  42. +                            XML.PrettyPrint((string)payloadNode["XML"], out body, out highlighter);
  43. +                        }
  44. +                        else if (payloadNode.Fields.ContainsKey("Text"))
  45. +                        {
  46. +                            body = (string)payloadNode["Text"];
  47. +                        }
  48. +                        else if (payloadNode.Fields.ContainsKey("MSNSLP"))
  49. +                        {
  50. +                            body = (string)payloadNode["MSNSLP"];
  51. +                        }
  52. +                        else
  53. +                        {
  54. +                            body = String.Format("Unhandled payload format: {0}",
  55. +                                (payloadNode.FieldNames.Count > 0) ? payloadNode.FieldNames[0] : payloadNode.Children[0].Name);
  56. +                        }
  57. +
  58. +                        vt.BodyText = body;
  59. +                    }
  60. +
  61. +                    transactions.Add(vt);
  62. +                }
  63. +            }
  64. +
  65. +            return transactions.ToArray();
  66. +        }
  67. +    }
  68. +
  69.      [Serializable()]
  70.      public class MSNSLPCall
  71.      {
  72. --- oSpy/VisualSession.cs
  73. +++ oSpy/VisualSession.cs
  74. @@ -229,6 +229,7 @@
  75.  
  76.              Register(new TCPVisualizer());
  77.              Register(new HTTPVisualizer());
  78. +            Register(new MSNSBVisualizer());
  79.              Register(new MSNP2PVisualizer());
  80.          }
  81.  

advertising

Create a Paste

Please enter your new post below (or upload a file instead):





Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords.

fantasy-obligation