1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-12-30 22:03:00 +08:00

[swfinterp] Implement bitand and pushshort operators

This commit is contained in:
Philipp Hagemeister 2014-11-17 05:08:39 +01:00
parent 33a266f4ba
commit 162f54eca6

View File

@ -451,6 +451,9 @@ class SWFInterpreter(object):
elif opcode == 36: # pushbyte elif opcode == 36: # pushbyte
v = _read_byte(coder) v = _read_byte(coder)
stack.append(v) stack.append(v)
elif opcode == 37: # pushshort
v = u30()
stack.append(v)
elif opcode == 38: # pushtrue elif opcode == 38: # pushtrue
stack.append(True) stack.append(True)
elif opcode == 39: # pushfalse elif opcode == 39: # pushfalse
@ -712,6 +715,13 @@ class SWFInterpreter(object):
value1 = stack.pop() value1 = stack.pop()
res = value1 % value2 res = value1 % value2
stack.append(res) 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 elif opcode == 171: # equals
value2 = stack.pop() value2 = stack.pop()
value1 = stack.pop() value1 = stack.pop()