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](/flash/images/issue_list.png)
#2234 Unnecessary extra inserted into ActionScript code
Author:
Llama
![user user](/flash/images/user.png)
Date created:
Type: bug
Visibility: Everybody
Assigned to:
Labels: AS1/2DecompilationGFX
State: upgraded ![Help](/flash/images/help.png)
![Help](/flash/images/help.png)
> What steps will reproduce the problem?
Open SWF, edit ActionScript.
Save and close.
Open the edited SWF and export the ActionScript you edited.
Compare original to new.
Observe the extra lines.
Here's a sample of the original:
var _loc5_ = 0;
while(_loc5_ < itemsArray.length)
{
_loc5_;
var _loc11_ = itemsArray[_loc5_++];
_loc5_;
var _loc12_ = Number(itemsArray[_loc5_++]);
_loc5_;
var _loc10_ = Number(itemsArray[_loc5_++]) * 1000;
_loc5_;
var _loc8_ = Number(itemsArray[_loc5_++]);
_loc5_;
var _loc13_ = Number(itemsArray[_loc5_++]);
var _loc3_ = dialog.pickpocket["slot" + _loc8_];
if(_loc3_)
{
if(_loc13_ == 1)
Here's a sample of the edited:
var _loc17_ = 0;
while(_loc17_ < itemsArray.length)
{
_loc17_;
_loc17_;
var _loc18_ = itemsArray[_loc17_++];
_loc17_;
_loc17_;
var _loc19_ = Number(itemsArray[_loc17_++]);
_loc17_;
_loc17_;
var _loc20_ = Number(itemsArray[_loc17_++]) * 1000;
_loc17_;
_loc17_;
var _loc21_ = Number(itemsArray[_loc17_++]);
_loc17_;
_loc17_;
var _loc22_ = Number(itemsArray[_loc17_++]);
var _loc23_ = dialog.pickpocket["slot" + _loc21_];
if(_loc23_)
{
if(_loc22_ == 1)
See how each _loc17_; are doubled?
> What is the expected output? What do you see instead?
Not to insert these extra lines.
> What version of the product are you using? Is it "nightly build"? Which operating system
do you have?
ffdec_20.1.0_nightly2780.zip on GitHub.
Windows 10 x64.
> Please provide any additional information below. If the problem is related to a SWF
file, attach it here, otherwise we can't help you.
Added the SWF file I used in the sample above.
The sample is taken starting line 395.
![Download](/flash/images/disk.png)
Which script is this from?
You said line 395, but which script?
I don't see anything similar like the sample you written in this SWF file.
How do you mean?
I see only one 'DoAction' script under 'frame 1'.
You wrote:
"Here's a sample of the original:
var _loc5_ = 0;
while(_loc5_ < itemsArray.length)
...
""
What do you mean by original?
You mean the original code that is in this SWF file?
I don't see this kind of code anywhere in the SWF file you attached.
Or is this a new code you are trying to insert?
Are you sure you attached the correct SWF?
I don't see anything like for example "pickpocket" in it.
Please explain the exact steps how to reproduce it on this swf file.
Okay i see the following as simple code that reproduces the bug on any script:
function myFunc()
{
_root.test = 5; //triggers DefineFunction2
var _loc2_ = 0;
var _loc3_ = {};
//after compilation, it inserts _loc2_ in this place
var _loc4_ = _loc3_[_loc2_++];
}
So now I can try to fix it...
Okay, it should be fixed in nightly 2823, try it.
State: new→upgraded
Works for me, thanks!