summaryrefslogtreecommitdiffhomepage
path: root/youtube_dl/swfinterp.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <[email protected]>2014-11-17 05:08:39 +0100
committerPhilipp Hagemeister <[email protected]>2014-11-17 05:08:39 +0100
commit162f54eca6b9c0dc2e4fe36bd2905190ba0185fa (patch)
tree91734445aeb710f82a919b70dee84640abc093c2 /youtube_dl/swfinterp.py
parent33a266f4bae7b53ad12bd79293bcc1f11ae6d407 (diff)
downloadyoutube-dl-162f54eca6b9c0dc2e4fe36bd2905190ba0185fa.tar.gz
youtube-dl-162f54eca6b9c0dc2e4fe36bd2905190ba0185fa.zip
[swfinterp] Implement bitand and pushshort operators
Diffstat (limited to 'youtube_dl/swfinterp.py')
-rw-r--r--youtube_dl/swfinterp.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/youtube_dl/swfinterp.py b/youtube_dl/swfinterp.py
index 7369c94fc..fc704603a 100644
--- 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 == 37: # pushshort
+ v = u30()
+ stack.append(v)
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)
+ 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()