From eb5376044ca2bb86a61c70ce1905992a0e5d25bd Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Mon, 17 Nov 2014 04:27:51 +0100 Subject: [PATCH] [swfinterp] Implement equals opcode --- test/swftests/EqualsOperator.as | 10 ++++++++++ youtube_dl/swfinterp.py | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 test/swftests/EqualsOperator.as diff --git a/test/swftests/EqualsOperator.as b/test/swftests/EqualsOperator.as new file mode 100644 index 000000000..837a69a46 --- /dev/null +++ b/test/swftests/EqualsOperator.as @@ -0,0 +1,10 @@ +// input: [] +// output: false + +package { +public class EqualsOperator { + public static function main():Boolean{ + return 1 == 2; + } +} +} diff --git a/youtube_dl/swfinterp.py b/youtube_dl/swfinterp.py index 0ce8474ca..1e8b26ecc 100644 --- a/youtube_dl/swfinterp.py +++ b/youtube_dl/swfinterp.py @@ -629,6 +629,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() -- 2.22.2