[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Swftools-common] [Patch] wrong parsing of AS3 opcode 'callstatic'
From: |
Jos Castellani |
Subject: |
[Swftools-common] [Patch] wrong parsing of AS3 opcode 'callstatic' |
Date: |
Fri, 02 Nov 2012 16:36:12 +0100 |
SWFTools' parser for ActionScript 3 byte code has a bug when parsing the
instruction 'callstatic'. The first argument should be an index into
method_info, not method_body.
I refer to the AVM2 specification, page 44
http://adobe.com/content/dam/Adobe/en/devnet/actionscript/articles/avm2overview.pdf
The following patch fixes the problem:
diff -Nrdu3 a/lib/as3/code.c b/lib/as3/code.c
--- a/lib/as3/code.c
+++ b/lib/as3/code.c
@@ -66,7 +66,7 @@
{0x4c, "callproplex", "2n", -1, 1, 0, OP_STACK_ARGS|OP_STACK_NS},
{0x46, "callproperty", "2n", -1, 1, 0, OP_STACK_ARGS|OP_STACK_NS},
{0x4f, "callpropvoid", "2n", -1, 0, 0, OP_STACK_ARGS|OP_STACK_NS},
-{0x44, "callstatic", "in", -1, 1, 0, OP_STACK_ARGS},
+{0x44, "callstatic", "mn", -1, 1, 0, OP_STACK_ARGS},
{0x45, "callsuper", "2n", -1, 1, 0, OP_STACK_ARGS|OP_STACK_NS},
{0x4e, "callsupervoid", "2n", -1, 0, 0, OP_STACK_ARGS|OP_STACK_NS},
{0x78, "checkfilter", "", -1, 1, 0, 0},
~~~~~~~~~~~~~~~~~~~~~~~~
- [Swftools-common] [Patch] wrong parsing of AS3 opcode 'callstatic',
Jos Castellani <=