# swfinfo

> **Tool `tools/formats/swfinfo.py`** (program, Formats). First look at a Flash game: an SWF file, or a Flash projector (an .exe with the SWF inside).

Run it with `./gameframe run swfinfo ARGS` or `python3 tools/formats/swfinfo.py`. [Source on GitHub](https://github.com/tanepiper/game-frame/blob/main/tools/formats/swfinfo.py).

## Its own help

This is the help text in the tool itself, as `./gameframe tool swfinfo` prints it.

```text
First look at a Flash game: an SWF file, or a Flash projector (an .exe with the SWF inside).
It also recognises Shockwave Director files and projectors.

Usage: swfinfo.py FILE [--tags] [--decompress OUT] [--extract OUT] [--json]

  FILE              an .swf, a projector .exe, or any file with an SWF inside
  --tags            list every tag in order, with its size
  --decompress OUT  write the movie uncompressed (an FWS file), which other tools read
  --extract OUT     write the SWF found inside a projector or another file

It reports the SWF version, the compression (FWS none, CWS zlib, ZWS LZMA), the stage size,
the frame rate and frame count, and whether the code is ActionScript 1 or 2 (DoAction tags,
run by the old virtual machine) or ActionScript 3 (DoABC tags, run by the AVM2). It counts
the shapes, bitmaps, sounds, fonts, sprites and binary data, and lists the class names the
movie links to symbols, the exported names, the metadata and any protection tags.

What it does not do is decompile the scripts. JPEXS Free Flash Decompiler (FFDec) does that,
and Ruffle runs the movie. docs/engines/flash-and-shockwave.md describes the route from
here. A Shockwave Director file (RIFX or XFIR) is only recognised: its Lingo scripts need
ProjectorRays. Decompressed and extracted movies are game material: write them into derived/.
Standard library only.
```

## Named by

Skills: [re-inventory](/skills/re-inventory).
