PEASS-ng/winPEAS/winPEASexe/winPEAS/3rdParty/MicroJson
makikvues 9a6e5d5831 - fixed namespaces
- added CredentialGuard check
- added Named Pipes enumeration
- added Printers enumeration
- added SysMon enumeration
- added Logon Sessions enumeration
- added SuperPutty config files check
- added Oracle SQL Developer Config files check
- added AMSI providers check
- added SCCM check
- fixed output formatting
2021-01-31 14:13:56 +01:00
..
JsonParser.cs - fixed namespaces 2021-01-31 14:13:56 +01:00
JsonSerializer.cs - fixed namespaces 2021-01-31 14:13:56 +01:00
README.md - added saved password extraction for: Opera, Firefox, Chrome 2021-01-28 10:19:27 +01:00

MicroJson

Version Build status Coverage Status

MicroJson is a small library for serializing/deserializing JSON strings from strongly typed CLR objects (POCOs). It is basically a replacement for the JavaScriptSerializer class for situations where you cannot or do not want to use that class. Its aim is neither to be fast nor feature-rich but rather small and compatible with most environments. If you are looking for a more fully featured JSON serializer, you should probably take a look at JSON.Net.

MicroJson consists of two source files you can just drop into your project. It has been tested in the following environments:

Usage

public class Test
{
    public string S { get; set; }
    public int I { get; set; }
    public List<int> L;
}

var json = @"{
    ""S"": ""Hello, world."",
    ""I"": 4711,
    ""L"": [1, 2, 3]
}";

var t = new JsonSerializer().Deserialize<Test>(json);

Assert.That(t.S, Is.EqualTo("Hello, world."));
Assert.That(4711, Is.EqualTo(t.I));
Assert.That(new[] { 1, 2, 3 }, Is.EquivalentTo(t.L));

var j = new JsonSerializer().Serialize(t);

Assert.That(j, Is.EqualTo(@"{""I"":4711,""L"":[1,2,3],""S"":""Hello, world.""}"));

Notes

Deserialization is a two step process. First, JSON text is deserialized into generic CLR objects, i.e. JSON arrays into List<object> and JSON objects into Dictionary<object>. If you only need this, then you can just include JsonParser.cs.

Type information can be preserved when de/serializing by setting the UseTypeInfo property to true on the JsonSerializer object. This will emit the class name of a serialized object as an additional property (can be configured through the property TypeInfoPropertyName, default is @type) for classes which are derived and/or implement an interface.

License

MIT X11

Used at

UpdateStar