SWFThis is a page for Flash SWF file analysis (Header). Try sample file: Try an example
What are we looking for?For a SWF file, we are looking for "FWS" or, in hex, 46 57 53 at the start of the file, or "CWS" for a compressed file. The full format is: here |
File contents analysis |
Sample code
public string getSwf(byte[] b) { string TextBox1 = ""; try { TextBox1 += "Byte 0 [Should be 46]: " + Global.intToHex(b[0]) + "<br/>"; TextBox1 += "Byte 1 [Should be 57]: " + Global.intToHex(b[1]) + "<br/>"; TextBox1 += "Byte 2 [Should be 53]: " + Global.intToHex(b[2]) + "<br/>"; TextBox1 += "Byte 3: Version: " + Global.intToHex(b[3]) + "<br/>"; uint filesize = ((uint)b[7] << 24) + ((uint)b[6] << 16) + ((uint)b[5] << 8) + ((uint)b[4]); TextBox1 += "Byte 4-7: File size (bytes): " + Convert.ToString(filesize)+ "<br/>"; } catch { } return (TextBox1); }
An outline of the format is: