projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
33a266f
)
[swfinterp] Implement bitand and pushshort operators
author
Philipp Hagemeister
<phihag@phihag.de>
Mon, 17 Nov 2014 04:08:39 +0000
(
05:08
+0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Mon, 17 Nov 2014 04:08:39 +0000
(
05:08
+0100)
youtube_dl/swfinterp.py
patch
|
blob
|
history
diff --git
a/youtube_dl/swfinterp.py
b/youtube_dl/swfinterp.py
index 7369c94fcacc78674ab297a48087678b510b4440..fc704603ab233353bf488e01c45cb9a8f14c4b5e 100644
(file)
--- a/
youtube_dl/swfinterp.py
+++ b/
youtube_dl/swfinterp.py
@@
-451,6
+451,9
@@
class SWFInterpreter(object):
elif opcode == 36: # pushbyte
v = _read_byte(coder)
stack.append(v)
elif opcode == 36: # pushbyte
v = _read_byte(coder)
stack.append(v)
+ elif opcode == 37: # pushshort
+ v = u30()
+ stack.append(v)
elif opcode == 38: # pushtrue
stack.append(True)
elif opcode == 39: # pushfalse
elif opcode == 38: # pushtrue
stack.append(True)
elif opcode == 39: # pushfalse
@@
-712,6
+715,13
@@
class SWFInterpreter(object):
value1 = stack.pop()
res = value1 % value2
stack.append(res)
value1 = stack.pop()
res = value1 % value2
stack.append(res)
+ elif opcode == 168: # bitand
+ value2 = stack.pop()
+ value1 = stack.pop()
+ assert isinstance(value1, int)
+ assert isinstance(value2, int)
+ res = value1 & value2
+ stack.append(res)
elif opcode == 171: # equals
value2 = stack.pop()
value1 = stack.pop()
elif opcode == 171: # equals
value2 = stack.pop()
value1 = stack.pop()