If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler
NEW : We have got a new blog where we post some interesting SWF internals info.
List of issues#2373 AS2 Code Limitation
Author: Ner
Date created:
Type: question
Visibility: Everybody
Assigned to:
State: opened
Is there a way to increase or remove that kind of limitation?
2024-11-25_13-14.png (12 KiB)
This limit cannot be removed,
it is by design.
Imagine an if instuction - ActionIf,
it has a 16 bit signed value as an argument - the number of bytes to jump if the
expression evaluates to true.
if (1 == 2) {
[code A]
}
[code after if]
Compiles to P-code as:
Push 1
Push 2
ActionEquals
ActionIf +10
[code A, 10 bytes length]
target:
[code after if]
The value of +10 here is the offset, it cannot be more than 32 767, because that's the
limit of signed 16bit value.
SWF format has fixed limit of offsets, which requires it to be 16bit.
In ActionScript3, the offset if 24bit which is more and usually does not cause any
problems.
In AS1/2, it causes problems.
FFDec does not allow to save larger values than 16bit in AS1/2, and produces this error
message.
On the other hand, for example Flash CS6 editor does not produce any warning on SWF
generation in such cases,
but the code will be corrupted.
See Ghost challenge:
https://github.com/jindrapetrik/as-ghost-challenge
To avoid this kind of warning,
you can:
- make shorter if-else clauses
- make shorter functions, split them into smaller ones
Unfortunately, FFDec won't tell you which function/if is the problematic one,
but you can experiment.
This problem can even happen on the code which you did not modify at all,
because FFDec compiler could produce code with different length than official compiler.
State: new→opened