diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-11-17 04:00:31 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-11-17 04:00:41 +0100 |
commit | e983cf52775e493b7deedbe48d2f50f598c9da4e (patch) | |
tree | 30d03752be63af3943f1948eeb9d80581c426453 /youtube_dl/swfinterp.py | |
parent | 0ab1ca5501108b8038090750e8455bfb5d72c443 (diff) | |
download | youtube-dl-e983cf52775e493b7deedbe48d2f50f598c9da4e.zip youtube-dl-e983cf52775e493b7deedbe48d2f50f598c9da4e.tar.gz youtube-dl-e983cf52775e493b7deedbe48d2f50f598c9da4e.tar.bz2 |
[swfinterp] Interpret yet more opcodes
Diffstat (limited to 'youtube_dl/swfinterp.py')
-rw-r--r-- | youtube_dl/swfinterp.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/youtube_dl/swfinterp.py b/youtube_dl/swfinterp.py index 58da6c5..85efde5 100644 --- a/youtube_dl/swfinterp.py +++ b/youtube_dl/swfinterp.py @@ -393,7 +393,10 @@ class SWFInterpreter(object): self._classes_by_name, avm_class.variables]) while True: opcode = _read_byte(coder) - if opcode == 17: # iftrue + if opcode == 16: # jump + offset = s24() + coder.seek(coder.tell() + offset) + elif opcode == 17: # iftrue offset = s24() value = stack.pop() if value: @@ -403,6 +406,20 @@ class SWFInterpreter(object): value = stack.pop() if not value: coder.seek(coder.tell() + offset) + elif opcode == 19: # ifeq + offset = s24() + value2 = stack.pop() + value1 = stack.pop() + if value2 == value1: + coder.seek(coder.tell() + offset) + elif opcode == 20: # ifne + offset = s24() + value2 = stack.pop() + value1 = stack.pop() + if value2 != value1: + coder.seek(coder.tell() + offset) + elif opcode == 32: # pushnull + stack.append(None) elif opcode == 36: # pushbyte v = _read_byte(coder) stack.append(v) |