Last active
March 16, 2017 21:25
-
-
Save yonatan/b275020f39cca5f980b3998964c9dce8 to your computer and use it in GitHub Desktop.
Patch wonderfl swfs to change asset urls to relative paths
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: swf-surgery <input-file> <output-file>" | |
exit 1 | |
fi | |
TMP="/tmp/$(basename $0).$$" | |
SWF="$TMP.swf" | |
BAK="$TMP.\$wf" | |
cp $1 $SWF | |
flasm -x $SWF | |
sed -e 's|http://swf\.wonderfl\.net/swf/usercode|../../../../swfs/./././././././././.|g' \ | |
-e 's|http://assets\.wonderfl\.net/images/related_images|../../../../assets/././././././././././././././.|g' \ | |
-e 's|http://swf\.wonderfl\.net/static/assets|../../../../assets/static/./././././.|g' \ | |
-i $SWF | |
flasm -z $SWF | |
mv $SWF $2 | |
rm $BAK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment