summaryrefslogtreecommitdiff
path: root/README.rst
blob: 5f743e22934a8f73fa4e605fbfe18eeb7a1acd91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.NET Viewstate Decoder
======================

A small Python library for decoding .NET viewstate. Can be used in various scraping scenarios.

Usage
-----

The Viewstate decoder accepts Base64 encoded .NET viewstate data and returns the decoded output in the form of plain Python objects.

There are two main ways to use this package. First, it can be used as an imported library with the following typical use case:

::

  from viewstate import ViewState
  vs = ViewState(base64EncodedViewState)
  decoded_state = vs.decode()

It is also possible to feed the raw bytes directly:

::

  vs = ViewState(raw=b'\xff\x01....')

Alternatively, the library can be used via command line by directly executing the module:

::

  $ cat data.base64 | python -m viewstate

Which will pretty-print the decoded data structure.

Development
-----------

Unit test are run via ``pytest``

References
----------

- https://github.com/mutantzombie/JavaScript-ViewState-Parser
- http://viewstatedecoder.azurewebsites.net/

License
-------
MIT