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.

#2472 Can the PermitDebugging setting be changed?
Author:
zxczxczxc

Date created:
Type: question
Visibility: Everybody
Assigned to:
Labels: Debugger
State: opened 

Hi,
Thanks for making ffdec, it's super useful!
I'm decompiling and editing an SWF and noticed that when I call getStackTrace(), I get
null.
Based on some reading online, it seems this happens if the SWF was published with the
PermitDebugging setting off.
Refs:
https://benoitfreslon.com/news/actionscript-good-practices-in-flash-Development/
https://helpx.adobe.com/animate/using/debugging-actionscript-3-0.html
I'm very new to ActionScript/SWF dev. I looked around the settings in ffdec and couldn't
find an equivalent setting for that. Is this possible to do with ffdec or would it be a
viable feature request?
Ultimately, I want the file and line number where an error occurred to help speed up my
debugging/dev process. And this SWF is loaded in a bit of a weird way where I'm not sure I
can use ffdec's debugging.
Thanks!
Hi,
for file/line info to be available, few things must be done:
- in SWF version <5 files, Protect tag must be present
- in SWF version 5 files, EnableDebugger tag must be present
- in SWF version 6+ files, EnableDebugger2 tag must be present
- for AS1/2 files, SWD file must be generated in the SWF directory
- for AS3 files, file/line info must be injected into the P-code of every method
When debugging in FFDec with the "Debug" button,
it does all this for you, with file/line info taken from source code.
I don't know whether the injected file/line info can be useful without the source code
right in the decompiler.
You can use FFDecs commandline interface to enable debugging and insert file/line info on
specific SWF file:
For AS3 files:
java -jar ffdec.jar -enabledebugging -injectas3 myas3file.swf myas3file_debug.swf
For AS1/2 files:
java -jar ffdec.jar -enabledebugging -generateswd myas2file.swf myas2file_debug.swf
But I did not really test it, use it on your own risk.
State: new→opened
Oh cool, I'll try this out! Is there a way to get ffdec to output the debug versions of
the SWF files without a Flash player? My setup is a bit odd - the SWFs get loaded through
another application so I've just been testing by giving the files to the application.