[swfinterp] Implement pushtrue and pushfalse opcodes
[youtube-dl] / youtube_dl / swfinterp.py
index 0ce8474ca7ce96d77d05b9c9c5243a6632b69591..dd4dd060ad1fa8041c6351408ab9f79996390e0c 100644 (file)
@@ -426,6 +426,10 @@ class SWFInterpreter(object):
                 elif opcode == 36:  # pushbyte
                     v = _read_byte(coder)
                     stack.append(v)
+                elif opcode == 38:  # pushtrue
+                    stack.append(True)
+                elif opcode == 39:  # pushfalse
+                    stack.append(False)
                 elif opcode == 42:  # dup
                     value = stack[-1]
                     stack.append(value)
@@ -629,6 +633,11 @@ class SWFInterpreter(object):
                     value1 = stack.pop()
                     res = value1 % value2
                     stack.append(res)
+                elif opcode == 171:  # equals
+                    value2 = stack.pop()
+                    value1 = stack.pop()
+                    result = value1 == value2
+                    stack.append(result)
                 elif opcode == 175:  # greaterequals
                     value2 = stack.pop()
                     value1 = stack.pop()