We had a Power Point Presentation file given us a few days ago with an
embedded flash file which we needed to extract to use on the website.
We couldn't find any way to do this. We could drag and drop the swf
onto another presentation, we could even drag the object onto the
desktop. This created a scrap file which was rather annoying.
However, this led me to the discovery of the NeverShowExt registry
key. I managed to rename the scrap to a have a .swf extension, but
still no cookie.
So I started digging around the scrap to see if I could find the swf object inside and after reading an introduction to SWF I found what I was looking for.
Now I just wanted to extract this binary data from the scrap file, and I wanted to do it the hard way!
So I wrote a small amount of code to look through a file and extract
the goodies. The main part of the code was to take a byte array and
copy that into my SWF struct - using the
System.Runtime.InteropServices.Marshal class.
After a bit of messing around the code runs like a dream. The final
executable takes 2 parameters the first is the file containing the SWF
and the second is the file to write the SWF.
View the code
In theory this could be used to extract many forms of embedded binary data.