JPEXS Free Flash Decompiler Issue Tracker

If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler

NEW : We have got a new blog where we post some interesting SWF internals info.

List of issuesList of issues

#654 backslash-escaped file names on command line cause error in Linux
Author: user loki
Date created:
Type: bug
Visibility: Everybody
Assigned to: developer honfika
Labels: Linux
State: closed Help

Normally "\ " is a valid way to use a space on the command line (it autocompleted that way.) > What steps will reproduce the problem? $ ~/Downloads/ffdec_3.0.0_fd9e1de/ffdec.sh -replaceBinaryData ~/wordgamerelease.swf /opt/Word\ Realms/share/wordgamerelease.swf 7 7-modified.bin Exception in thread "main" java.lang.NumberFormatException: For input string: "Realms/share/wordgamerelease.swf" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:492) at java.lang.Integer.parseInt(Integer.java:527) at com.jpexs.decompiler.flash.console.CommandLineArgumentParser.parseReplaceBinaryData(Comman dLineArgumentParser.java:1261) at com.jpexs.decompiler.flash.console.CommandLineArgumentParser.parseArguments(CommandLineArg umentParser.java:349) at com.jpexs.decompiler.flash.gui.Main.main(Main.java:904) > What is the expected output? What do you see instead? Not sure, first time trying the replace feature, but see output above. > What version of the product are you using? On what operating system? As above, on Linux Mint 16. > Please provide any additional information below. Attach the file you have problem with if neccessary. If you do not want to publish files YOU CAN CHANGE VISIBILITY TO PRIVATE If I change it to being surrounded by quotes but without the backslash, I get the exact same error. Quotes and backslash, same thing. So I guess there's no way to pass a path containing a space currently?
developer
Please execute the followingcommand with the latest nightly build: ffdec.sh -debug -replaceBinaryData ~/wordgamerelease.swf /opt/Word\ Realms/share/wordgamerelease.swf 7 7-modified.bin This command will print the original arguments (args from main(String[] args) method) If it splits your fileName-filePath, then the problem is not in our sw. Otherwise we will fix it. Please copy the result here. Thanks.
Assigned:developer honfika
user
$ ~/Downloads/ffdec_3.0.0_fd9e1de/ffdec.sh -debug -replaceBinaryData ~/wordgamerelease.swf /opt/Word\ Realms/share/wordgamerelease.swf 7 7-spatulacity.bin Exception in thread "main" java.lang.NumberFormatException: For input string: "Realms/share/wordgamerelease.swf" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:492) at java.lang.Integer.parseInt(Integer.java:527) at com.jpexs.decompiler.flash.console.CommandLineArgumentParser.parseReplaceBinaryData(Comman dLineArgumentParser.java:1261) at com.jpexs.decompiler.flash.console.CommandLineArgumentParser.parseArguments(CommandLineArg umentParser.java:349) at com.jpexs.decompiler.flash.gui.Main.main(Main.java:904)
user
Sorry, wrong nightly! Just a sec
user
There we go (identical output with quotes instead of '\' ): $ ~/Downloads/ffdec_3.0.0_0a1e132/ffdec.sh -debug -replaceBinaryData ~/wordgamerelease.swf /opt/Word\ Realms/share/wordgamerelease.swf 7 7-spatulacity.bin 0.:-debug 1.:-replaceBinaryData 2.:/home/kev/wordgamerelease.swf 3.:/opt/Word 4.:Realms/share/wordgamerelease.swf 5.:7 6.:7-spatulacity.bin Exception in thread "main" java.lang.NumberFormatException: For input string: "Realms/share/wordgamerelease.swf" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:492) at java.lang.Integer.parseInt(Integer.java:527) at com.jpexs.decompiler.flash.console.CommandLineArgumentParser.parseReplaceBinaryData(Comman dLineArgumentParser.java:1267) at com.jpexs.decompiler.flash.console.CommandLineArgumentParser.parseArguments(CommandLineArg umentParser.java:355) at com.jpexs.decompiler.flash.gui.Main.main(Main.java:904)
admin
Please try java -jar ... instead of ffdec.sh ... with the backslash and with quotes too
admin
sorry, I mean: java -jar ffdec.jar ...
user
That way works: 0.:-debug 1.:-replaceBinaryData 2.:/home/kev/wordgamerelease.swf 3.:/opt/Word Realms/share/wordgamerelease.swf 4.:7 5.:7-spatulacity.bin
user
(with quotes produces the same output as with backslash)
developer
Then the problem seems to be in ffdec.sh Does anyone know how to fix it?
user
Oh, I think I do--just put quotes around the $@ occurences: # Check default java if [ -x "`which java`" ]; then JAVA_VERSION_OUTPUT=`java -version 2>&1` check_java_version && exec java -Djava.net.preferIPv4Stack=true -Xmx$MEMORY -jar $JAR_FILE "$@" fi # Test other possible Java locations for JRE_PATH in $LOOKUP_JRE_DIRS; do if [ -x "$JRE_PATH/bin/java" ]; then JAVA_VERSION_OUTPUT=`"$JRE_PATH/bin/java" -version 2>&1` check_java_version && { export JRE_PATH exec $JRE_PATH/bin/java -Djava.net.preferIPv4Stack=true -Xmx$MEMORY -jar $JAR_FILE "$@" ...that seems to let it work, although every argument then seems to need an absolute path for some reason.
user
Sorry, I hadn't thought to look there...had assumed it was in Java somewhere...thanks!
user
Actually, this might be a bit more quote/script-friendly: # Handle symlinks PROGRAM="$0" while [ -L "$PROGRAM" ]; do PROGRAM=`readlink -f "$PROGRAM"` done cd "`dirname \"$PROGRAM\"`" PARAMS="" for PARAM in "$@" do PARAMS="${PARAMS} \"${PARAM}\"" done # Check default java if [ -x "`which java`" ]; then JAVA_VERSION_OUTPUT=`java -version 2>&1` check_java_version && bash -c "exec java -Djava.net.preferIPv4Stack=true -Xmx$MEMORY -jar $JAR_FILE ${PARAMS}" fi # Test other possible Java locations for JRE_PATH in $LOOKUP_JRE_DIRS; do if [ -x "$JRE_PATH/bin/java" ]; then JAVA_VERSION_OUTPUT=`"$JRE_PATH/bin/java" -version 2>&1` check_java_version && { export JRE_PATH bash -c "exec $JRE_PATH/bin/java -Djava.net.preferIPv4Stack=true -Xmx$MEMORY -jar $JAR_FILE ${PARAMS}" } fi done
user
Actually, maybe that's no good, it then fails the check after that block.
developer
Then how should we fix this? Sorry, I don't know this script.
user
Ah, just take out the bash -c stuff, and it seems to work well: PARAMS="" for PARAM in "$@" do PARAMS="${PARAMS} \"${PARAM}\"" done # Check default java if [ -x "`which java`" ]; then JAVA_VERSION_OUTPUT=`java -version 2>&1` check_java_version && exec java -Djava.net.preferIPv4Stack=true -Xmx$MEMORY -jar $JAR_FILE ${PARAMS} fi # Test other possible Java locations for JRE_PATH in $LOOKUP_JRE_DIRS; do if [ -x "$JRE_PATH/bin/java" ]; then JAVA_VERSION_OUTPUT=`"$JRE_PATH/bin/java" -version 2>&1` check_java_version && { export JRE_PATH exec $JRE_PATH/bin/java -Djava.net.preferIPv4Stack=true -Xmx$MEMORY -jar $JAR_FILE ${PARAMS} } fi done
developer
i've created a nightly build with your modified script. please try it thanks for the fix
State: new→upgraded
user
Actually, sorry, for some reason this still doesn't work. It worked from my script, but not from the straight command line. It should actually be the straight "$@" way I first suggested; when I then fixed my script properly, my script and ffdec from the command-line worked fine.
developer
Please could you attach the working sh file?
user
There, sorry for my confusion.
Downloadffdec.sh (2 KiB)
developer
Thanks, added. Please try the latest nightly build.
user
Works great! Glad to help, thanks for your patience.
developer
State: upgraded→closed