-
Notifications
You must be signed in to change notification settings - Fork 0
/
playground.py
53 lines (38 loc) · 934 Bytes
/
playground.py
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
47
48
49
50
51
52
53
from shiftops import *
#from uncompyle2 import uncompyle
from mydis import disassemble
from StringIO import StringIO
def target():
print "Hey"
import dis
co_code = target.func_code.co_code
out = StringIO()
code = type(target.func_code)
c = target.func_code.co_code
codestring = c
consts = target.func_code.co_consts
varnames = target.func_code.co_varnames
names = target.func_code.co_names
#print consts
#consts = ('?', 'why')
#names = ('what',)
#varnames = ('woo',)
target.func_code = code(
target.func_code.co_argcount,
target.func_code.co_nlocals,
target.func_code.co_stacksize,
target.func_code.co_flags,
codestring,
consts,
names,
varnames,
target.func_code.co_filename,
target.func_code.co_name,
target.func_code.co_firstlineno,
target.func_code.co_lnotab,
)
#uncompyle('2.7', target.func_code, out=out)
#out.seek(0)
#print out.read()
dis.dis(target)
#target()