Open tuomassalo opened 8 years ago
With the attached .swf file, the swf2xml command produces invalid XML. Notice the 1b in the dump.
swf2xml
1b
$ swfmill swf2xml test.swf | grep '\^' | hexdump -C 00000000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3c 53 | <S| 00000010 74 72 69 6e 67 20 76 61 6c 75 65 3d 22 5e 1b 22 |tring value="^."| 00000020 2f 3e 0a |/>.| 00000023
test.swf.zip
Since XML disallows ASCII control characters, they should be escaped or removed. Both approaches have downsides.
For someone having the same problem, here's a a quick fix to just change all control characters to spaces:
perl -pi -e 's/[\0-\x{09}\x{0b}-\x{1f}]/ /g' test.xml
This is a tricky one, since XML doesn’t even allow ASCII control characters to be escaped like .

With the attached .swf file, the
swf2xml
command produces invalid XML. Notice the1b
in the dump.test.swf.zip
Since XML disallows ASCII control characters, they should be escaped or removed. Both approaches have downsides.
For someone having the same problem, here's a a quick fix to just change all control characters to spaces: