News in FFDec 21.0.x

Colorized CLI help, ActionScript linkage dialog, ABC cleaner, export to IDEA or FD projects, AS3 debugger for nested SWFs. Harman AIR 51 support. That and even more in the 21.0.x version.

21.0.3 – 2024-08-27

Harman AIR 51 support – float

AIR 51 introduced float numbers support that changed ABC structure a bit – added float constant pool and increased ABC major to 47. FFDec had slightly different float support already bundled, but still needed to be modified to properly handle this new format (like dropping float4 type).

Harman AIR 51 unpacker with custom key

In AIR 51, you can now encrypt embedded binary data with custom key instead of randomly generated. New FFDec has new kind of unpacker for this where you can specify encryption key.
As usual, it is available through context menu on DefineBinaryData tags / Use unpacker.

FlashDevelop AIR project support

Option to export FlashDevelop project as AIR project added – you need to select the project type in filetype dropdown list in save dialog.

FLA/FlashDevelop/IDEA export – Link to all classes

If you export ActionScript 3 classes, there may be some classes that are not linked from main document class. These scripts will be missed when compiled again. FFDec adds option (default off) to add special class to the decompiled project, that will link all classes. This does not include classes that are associated with a Sprite, as we found out that there are some problems compiling these.

Changed – Compound script slot/const location

Compound scripts now have the slot and const traits available through its main script script initializer.

Changed – FD / IDEA export without timeline

FlashDevelop or IntelliJ IDEA export does not allow to export main SWF timeline so we modified the app that if SWF has some items on the main timeline, you cannot export to FD/IDEA, you need to use FLA export.

21.0.2 – 2024-08-12

Better decimal values support

Flex SDK ASC ScriptCompiler has option to compile using decimal numerics (-m argument). It requires special ABC format – minor version 17. This FFDec release handles these kind of types. Beware that this ABC format is not supported by standard flash player.

Better float values support

AVMPlus uses new special types – float and float4. It also requires special ABC format (major 47, minor 16 and later) which is not available in standard flash player. FFDec handles these kind of types.

Non-nullable classes

Flex SDK has disabled option to use non-nullable classes. This consists of new NON_NULLABLE flag on InstanceInfo object. In AS3 source code it is written as exclamation mark after class name in class definition. FFDec supports this flag although it has probably no meaning in standard flash player.

AS3 direct editation – unary plus

In previous FFDec versions, you could not use plus as unary operator.
For example following code failed to compile:

var a:int = 5;
var b:int = a + +a;

New FFDec handles this properly.

Go to document class context menu item

You can now navigate to document class through the context menu on (AS3) SWF and scripts. Previously only a button in Menu/Tools was available.

We also updated the Go to document class icon.

21.0.1 – 2024-08-08

Add new AS3 P-code function button

We added new button on the top panel of AS3 P-code view and editor. After clicking the new button, a new function is added to the ABC – MethodInfo and the MethodBody.
A new method index is then displayed to you and it can be then copied to clipboard.
The method index can be used as a parameter to newfunction P-code instruction.
This way a new nested function can be created.
If you then want to modify the method parameters, you need to locate it in ActionScript view, click it, and edit it in the P-code view.

Library documentation

HTML documentation for FFDec library generated from Javadoc comments is now available for download. We also updated many Javadoc comments so it is better than before.

21.0.0 – 2024-08-05

StartSound character info

StartSound and StartSound2 show characterId/class in the tag tree.

Folder preview for sounds

Not very useful, but sounds now have icons in the folder preview.

Ignoring letter spacing on text search

When you search a text, the letter spacing attributes are ignored.
This applies to global search, not to search inside text.

The spacing attributes which are ignored

Collapse all option

You can collapse all sub-items of the given tree-item from context menu.

16bit MochiCrypt packer

We added support for 16bit variant of MochiCrypt. This also means that user needs to select Mochicrypt variant via Use Unpacker menu.

Apply unpacker menu

Better commandline

CLI interface has new help which uses Ansi colors and is organized to “commands” and “options”.
You can use --help <command> to see details about any command.
For easier access in Windows, we added ffdec-cli.exe executable because main EXE is GUI only.

Help for -export command

Collect depth as sprites

You can now use action called collect to get all items on specific depth and make DefineSprite from that.

Resample sound to 44kHz

There’s a new option to resample sound to higher sampling rate (44kHz). It can be enabled for playback and also for exporting WAV files. (Only WAV files, not MP3s or FLVs).

ActionScript linkage dialog

Previously, you could assign an identifier or class to a Sprite only via manually editing ExportAssets or SymbolClass tag. FFDec now offers a tool – dialog, which handles this for you. Just right click any character and select “Set AS linkage” or “Set AS3 class linkage” for AS3.
The dialog can also create the class if it does not exist yet. If it’s not detected, then it will ask you for the tag ExportAsset/SymbolClass position.
As the result of using this dialog, it will modify the ExportAssets or SymbolClass for you.

AS1/2 dialog
AS3 dialog

Search bar in replace character window

We added search bar to the replace character / replace references window. Also the tags are displayed as list, not combo-box.

Filtering in replace dialog

Ignore frame background option

During export of frames, new checkbox is available, which will ignore SetBackgroundColor tag and make background color transparent.

ABC explorer enhancements

The ABC explorer now shows list of usages of selected item. You can double-click usage to navigate to it. Items with zero usages are semi-transparent. We added copy path to clipboard action. You can also go to specific path by pressing Ctrl + G.

List of usages

ABC cleaner

New Clean ABC action is available through context menu and also in ABC explorer. If you edit an ABC file, it can then contain items which are not referenced from any scripts. The cleaning action will remove such items from the ABC. In the ABC explorer, there is a button for it, which is enabled only when there is at least one nonzero usage item. (The number of such non-referenced items is shown on the button) CLI also has this covered via -abcclean command.

Clean action can help to remove unused items.

GFX enhancements

On DefineExternalImage2, FontTextureInfo the field IdType is recognized. Image file formats list was updated.

On special old variants of GFX, a prefix like “data:” can be seen on some referenced filenames. A new dialog (context menu on the GFX) can solve this – you can define prefix to directory mapping. It is per GFX file setting.

Config home on Linux

Configuration of FFDec is now on Linux stored in ~/.config/FFDec
If you define XDG_CONFIG_HOME variable, you can override it.
For people which still have old ~/.FFDec dir, it is used instead.

FLA export enhancements

ImportAssets/2 support added to FLA – the “import for runtime sharing” feature added.

The checkbox for RS import in Flash CS6
Imported item in Flash CS6

“Export in frame 1” flag on symbols supported.

Checkbox for exporting in frame 1 in Flash CS6

FLA export is now placed also in SWF context menu.

Details in needed/dependent

If you need more details in needed or dependent characters lists, you can now press “+” button again (= twice) to show full character name as displayed in the tag tree.

Second plus link
After second clicking plus – full tag titles

Export to FlashDevelop & IntelliJ IDEA

We added export to FlashDevelop and IntelliJ IDEA project files. It will export all scripts in the SWF file including embeds and create project file / directory structure. It is available from the menu icons or SWF context menu.

New export menu

Window icons for dialogs

Just a small change, but the vast majority of dialogs now has icons.

Re-organized context menu

We made some structure reorganization of the context menu and also added separators to make the menu more intuitive.

Example menu (DefineSprite)

Save all

Save all button on menu was added. It is bigger than standard save icon.

New file panel

Save only when needed

Save and Save all buttons are enabled only when the SWF is modified.

Disabled Save all

Save as EXE changes

Save as EXE tool was moved to the tools menu.

In the save as EXE dialog, the export mode can be selected – Wrapper or Projector (win, mac, linux) via selecting from file type list box.
This was previously only available in Advanced settings. For projectors you need to have Projector file(s) downloaded at specific location (the dialog will tell you where to put it).

Some optimizations

Context menu and deleting items is faster on large SWF trees.

AS debugger variable flags

Added some of new variable flags – dontDelete and SWF versions related.

Editing AS3 “native” keyword

AS3 files containing native keyword = no method implementation, can be edited.

AS3 Debugger for nested SWF files

When SWF file loads other files from DefineBinaryData tag and decrypts it, FFDec can catch it via intercepting Loader calls. This was existing feature “Open loaded SWFs while playing”. Now this feature is extended so you can even debug such SWF files right in the decompiler. FFDec handles all the debuginfo injection for you.

Example of debugging nested SWFs.

Float matrix values

FB values in MATRIX (scale/rotate) shows as floats instead of int
In the text editor, these parameters are -f suffixed parameters.
Original parameters without -f suffix can be used (to import old style text).

Text float matrix attributes have -f suffix

Abbreviated tag info

Information in the tag node title now has abbreviated prefix of type for each bit of info.
Example: DefineSprite (chid: 27, cls: pkg.MySprite) instead of DefineSprite (27, pkg.MySprite).

New tag title format

Tags from ImportAssets/2 not visible but work

When a SWF file uses ImportAsset/2 tag, it is offered to load such SWF files. In previous versions, these tags were visible with changed character id. In the new version, they are not visible in the tag list / tree, but if you reference them in other tags, the reference will work.

Temp files in SWF directory

Run/Debug command – executed SWF temp files (~ffdec_run...swf etc.) are now generated
in the directory where original SWF resides to allow loading relative assets. This may also result in some temp files left in SWF directory when you terminate FFDec abnormally.

ActionScript bit-wise operations in hex

Bit-wise operations (&,|,^,~) now show operands in hexadecimal mode.

Hex arguments of bit-wise operations

Removed: Proxy feature

I decided to remove the Proxy from FFDec as it lacked support of HTTPs. Todays web is all about HTTPS and there exist many more useful proxies to catch SWFs in – like Fiddler for example.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *