Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swf2xml produces invalid XML output #36

Open
tuomassalo opened this issue Jan 3, 2016 · 1 comment
Open

swf2xml produces invalid XML output #36

tuomassalo opened this issue Jan 3, 2016 · 1 comment
Labels

Comments

@tuomassalo
Copy link

With the attached .swf file, the swf2xml command produces invalid XML. Notice the 1b in the dump.

$ 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
@djcsdy
Copy link
Owner

djcsdy commented Jun 16, 2017

This is a tricky one, since XML doesn’t even allow ASCII control characters to be escaped like &#x1b.

@djcsdy djcsdy added the bug label Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants