public override void dump(PrettyPrinter printer) { printer.addLine("[PyPacket typeID=" + packetType + " userID=" + userID + " name='" + typeString + "']"); printer.indentLevel++; printer.addLine("Source:"); printer.addItem(source); printer.addLine("Destination:"); printer.addItem(dest); printer.addLine("Payload:"); printer.addItem(payload); printer.addLine("Named Payload:"); printer.addItem(namedPayload); printer.indentLevel--; }
public override void dump(PrettyPrinter printer) { printer.addLine("[PyPackedRow " + RawData.Length + " bytes]"); if (Descriptor != null) { printer.indentLevel++; if (Descriptor.Columns != null) { foreach (var column in Descriptor.Columns) { int index = Descriptor.Columns.FindIndex(x => x.Name == column.Name); PyRep value = values[index]; printer.addLine("[\"" + column.Name + "\" => " + " [" + column.Type + "] " + value + "]"); } } else { printer.addLine("[Columns parsing failed!]"); } printer.indentLevel--; } else { if (DescriptorObj != null) { printer.addItem(DescriptorObj); } else { printer.indentLevel++; printer.addLine("Error.. Obj missing."); printer.indentLevel--; } } }
public override void dump(PrettyPrinter printer) { printer.addLine("[PyList " + Items.Count + " items]" + PrettyPrinter.PrintRawData(this)); foreach (var item in Items) { printer.addItem(item); } }
public override void dump(PrettyPrinter printer) { printer.addLine("[PyDict " + Dictionary.Count + " kvp]" + PrettyPrinter.PrintRawData(this)); printer.indentLevel++; foreach (var kvp in Dictionary) { printer.addLine("Key:"); printer.addItem(kvp.Key); if (kvp.Value == null) { printer.addLine("Value: <nullptr>"); } else { printer.addLine("Value:"); printer.addItem(kvp.Value); } } printer.indentLevel--; }
public override void dump(PrettyPrinter printer) { if (RawData != null) { printer.addLine("[PySubStream " + RawData.Length + " bytes]"); } else { printer.addLine("[PySubStream]"); } printer.addItem(Data); }
public override void dump(PrettyPrinter printer) { printer.addLine("[PyObjectEx " + (IsType2 ? "Type2" : "Normal") + "]" + PrettyPrinter.PrintRawData(this)); printer.indentLevel++; printer.addLine("Header:"); printer.addItem(Header); printer.addLine("List:"); foreach (var item in List) { printer.addItem(item); } printer.addLine("Dictionary:"); foreach (var kvp in Dictionary) { printer.indentLevel++; printer.addLine("Key:"); printer.addItem(kvp.Key); printer.addLine("Value:"); printer.addItem(kvp.Value); printer.indentLevel--; } printer.indentLevel--; }
public override void dump(PrettyPrinter printer) { printer.addLine("[PyTuple " + Items.Count + " items]" + PrettyPrinter.PrintRawData(this)); foreach (var item in Items) { if (item != null) { printer.addItem(item); } else { printer.addLine("<nullptr>"); } } }
public override void dump(PrettyPrinter printer) { printer.addLine("[PyBuffer " + Data.Length + " bytes]" + PrettyPrinter.PrintRawData(this)); if (Data != null && (Data[0] == Unmarshal.HeaderByte || Data[0] == Unmarshal.ZlibMarker || Data[0] == 0x63)) { byte[] d = Data; if (d[0] == Unmarshal.ZlibMarker) { d = Zlib.Decompress(d); } if (d != null && (d[0] == Unmarshal.PythonMarker || d[0] == 0x63) && printer.decompilePython && d.Length > 60) { // We have a python file. Bytecode code = new Bytecode(); if (code.load(d, d[0] == 0x63)) { Python.PrettyPrinter pp = new Python.PrettyPrinter(); pp.indentLevel = printer.indentLevel + 1; pp.indent = printer.indent; code.dump(pp); printer.addLine(pp.dump); } } else if (d != null && d[0] == Unmarshal.HeaderByte) { Unmarshal un = new Unmarshal(); PyRep rep = un.Process(d); if (rep != null) { if (Data[0] == Unmarshal.ZlibMarker) { printer.addLine("<compressed-data>"); } printer.addItem(rep); } } } }
public override void dump(PrettyPrinter printer) { printer.addLine("[PyChecksumedStream Checksum: " + Checksum + "]"); printer.addItem(Data); }
public override void dump(PrettyPrinter printer) { string name = "Unknown"; if (opCode == MarshalOpcode.StringEmpty) { name = "PyStringEmpty"; } else if (opCode == MarshalOpcode.StringChar) { name = "PyStringChar"; } else if (opCode == MarshalOpcode.WStringUTF8) { name = "PyWStringUTF8"; } else if (opCode == MarshalOpcode.WStringUCS2Char) { name = "PyWStringUCS2Char"; } else if (opCode == MarshalOpcode.WStringEmpty) { name = "PyWStringEmpty"; } else if (opCode == MarshalOpcode.WStringUCS2) { name = "PyWStringUCS2"; } else if (opCode == MarshalOpcode.StringShort) { name = "PyString"; } else if (opCode == MarshalOpcode.StringLong) { name = "PyString"; } else if (opCode == MarshalOpcode.StringTable) { name = "PyStringTable[" + tableIndex.ToString() + "]"; } bool printed = false; if (Raw.Length > 0 && (Raw[0] == (byte)Unmarshal.ZlibMarker || Raw[0] == (byte)Unmarshal.HeaderByte || Raw[0] == Unmarshal.PythonMarker || Raw[0] == 0x63)) { // We have serialized python data, decode and display it. byte[] d = Raw; if (d[0] == Unmarshal.ZlibMarker) { d = Zlib.Decompress(d); } if (d != null && (d[0] == Unmarshal.PythonMarker || d[0] == 0x63) && printer.decompilePython && d.Length > 60) { // We have a python file. Bytecode code = new Bytecode(); if (code.load(d, d[0] == 0x63)) { printer.addLine("[" + name); Python.PrettyPrinter pp = new Python.PrettyPrinter(); pp.indent = printer.indent; pp.indentLevel = printer.indentLevel + 1; code.dump(pp); printer.addLine(pp.dump); printer.addLine("]"); printed = true; } } else if (d != null && d[0] == Unmarshal.HeaderByte) { Unmarshal un = new Unmarshal(); un.analizeInput = decodedAnalized; PyRep obj = un.Process(d); if (obj != null) { string sType = "<serialized>"; if (Raw[0] == Unmarshal.ZlibMarker) { sType = "<serialized-compressed>"; } printer.addLine("[" + name + " " + sType); printer.addItem(obj); printer.addLine("]"); printed = true; } } } if (!printed) { if (!PrettyPrinter.containsBinary(Raw)) { printer.addLine("[" + name + " \"" + Value + "\"]"); } else { printer.addLine("[" + name + " \"" + Value + "\""); printer.indentLevel += 2; printer.addLine("<binary len=" + Value.Length + "> hex=\"" + PrettyPrinter.ByteArrayToString(Raw) + "\"]"); printer.indentLevel -= 2; } } }
public override void dump(PrettyPrinter printer) { printer.addLine("[PySubStruct]"); printer.addItem(Definition); }
public override void dump(PrettyPrinter printer) { printer.addLine("[PyObject Name: " + Name + "]" + PrettyPrinter.PrintRawData(this)); printer.addItem(Arguments); }