How to extract images from SWF (OSX 10.4)

  1. To extract moon images from http://www.sciencenetlinks.com/interactives/moon/moon_worksheet/Moon_Worksheet.swf and *.html:
  2. Used the Xcode sample program DiskCacheInspector to locate the two files in /Library/Caches/Safari (see Note below).
  3. Used FileJuicer 4.9.3 to try to extract images but they are not viewable.
  4. Trillix Flash Decompiler V3.1 (Eltima Software) does a better job after you specify extra options (mask, etc.), but the trial version will only the first two extract 2 files. Full version costs $54.95.
  5. Locate swftools-0.8.1.tar.gz, and run ./configure; make; sudo make install
  6. Run swfextract Moon_Worksheet.swf:
    Objects in file Moon_Worksheet.swf:
     [-i] 101 Shapes: ID(s) 6, 7, 15, 16, 18, 20, 22, 24, 27-31, 39, 41, 43, 45, 53, 70, 128, 130, 133, 136-138, 142, 154, 165, 168, 170, 171, 184, 197, 210, 211, 214, 216, 222, 223, 226, 228, 230, 232, 234, 246, 247, 250, 251, 253, 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, 286, 289, 292, 295, 298, 300, 303, 306, 309, 311, 314, 317, 320, 323, 326, 329, 332, 335, 341, 344-346, 349, 354, 357, 365-367, 369, 376, 389, 405, 408, 410, 426-428, 432, 436, 440, 441, 446
     [-i] 93 MovieClips: ID(s) 5, 21, 23, 40, 42, 46, 48, 50, 52, 55, 57, 59, 61, 63, 65, 67, 69, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 129, 131, 132, 135, 167, 196, 215, 221, 236, 239, 242, 245, 249, 254, 257, 260, 263, 266, 269, 272, 275, 278, 281, 284, 287, 290, 293, 296, 299, 301, 304, 307, 310, 312, 315, 318, 321, 324, 327, 330, 333, 340, 356, 375, 407, 431, 435, 445
     [-j] 28 JPEGs: ID(s) 169, 183, 252, 255, 258, 261, 264, 267, 270, 273, 276, 279, 282, 285, 288, 291, 294, 297, 302, 305, 308, 313, 316, 319, 322, 325, 328, 331
     [-s] 3 Sounds: ID(s) 139, 166, 402
     [-F] 10 Fonts: ID(s) 1, 3, 8, 10, 12, 25, 143, 338, 347, 377
     [-f] 1 Frame: ID(s) 0
     [-m] 1 MP3 Soundstream
    
  7. Create one shell script:
    #!/bin/sh
    swfextract -j $1 Moon_Worksheet.swf
    mv output.jpg $1.jpg
    
  8. Extract each individual .jpg file:
    ./one 169
    ./one 183
    etc.
    

Note re DiskCacheInspector

See http://forums.macrumors.com/showthread.php?p=5105772#post5105772

Question about Safari and its Cache - DiskCacheInspector - 2008-03-06

If you have Xcode 2.4.1 installed the example project file is /Developer/Examples/WebKit/DiskCacheInspector/DiskCacheInspector.xcodeproj

You can't run the ../Build/Release/DiskCacheInspector.app because it gives you 'You cannot open the application "DiskCacheInspector.app" because it may be damaged or incomplete.'

I was able to run it from Xcode and rebuild it too, but I was only able to get it to execute outside Xcode by using Finder to browse the package contents, and then dragging the executable /Developer/Examples/WebKit/DiskCacheInspector/build/Release/DiskCacheInspector.app/Contents/MacOS/DiskCacheInspector into a Terminal window.

The DiskCacheInspector is not a fully-finished application but it does show what the real file names of the Safari cache files are.

I got interested in this to disassemble a .swf file to look at the contents.

I used the swftools-0.8.1 package to extract what I wanted.