From f8ec6c5a397d884a039811aac8d64d2759fe0b6f Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Thu, 24 Mar 2016 22:21:23 +0200 Subject: Implement True value parsing --- viewstate.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'viewstate.py') diff --git a/viewstate.py b/viewstate.py index 01417a4..bf14005 100644 --- a/viewstate.py +++ b/viewstate.py @@ -2,17 +2,17 @@ from base64 import b64decode, b64encode CONSTS = { - '\x64': {}, - '\x65': '', - '\x66': 0, - '\x67': True, - '\x68': False + 100: {}, + 101: '', + 102: 0, + 103: True, + 104: False } def parse(b): - print([hex(x) for x in b]) - if len(b) == 1 and b in CONSTS: - return CONSTS[b] + assert type(b) == bytes().__class__ + if len(b) == 1 and b[0] in CONSTS: + return CONSTS[b[0]] return None -- cgit v1.3.1