-3

When I am decompiling an swf file, and get variables named _loc1_, _loc2 _, loc3_ ...

How can I decompile an swf file and get the original scripts?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
A3D AS
  • 1
  • 1

2 Answers2

3

How to decompile swf file and get original scripts?

You can't!! A swf is a compiled application, not a text document. When it becomes .swf format its no longer the original scripts (as saved in .as file) but it is now machine code (see Actionscript Virtual Machine in online articles or wiki's).

For original var names, some decompilers work better (at least on un-obfuscated code) so you gotta try them all. To a machine, a variabe doesn't need an understandable name like hero, baddie or weapon... instead it can be loc1, loc2 and loc3. Decompilers have to guess from your SWF data what the original AS3 might look like (sometimes it's a bad guess, which gives non-working code).

Only use decompilers for code-recovery of lost sources (if decompiled code is 70% usable, you can "remember" your original logic and fix the rest, or even rename vars to original names).

VC.One
  • 14,790
  • 4
  • 25
  • 57
-2

Many of flash applications have been protected by some types of code-obfuscators.(renamers or Ugifyers or Minifiers) flash scripts are normaly accesible for original codes even comments. But you cant reverse an obfuscated code to its original with any decompiler.

payam_sbr
  • 1,428
  • 1
  • 15
  • 24