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

retdec-archive-decompiler.sh does not append ".c" at the end of the decompiled files #261

Closed
s3rvac opened this issue Mar 31, 2018 · 2 comments
Assignees

Comments

@s3rvac
Copy link
Member

s3rvac commented Mar 31, 2018

The retdec-archive-decompiler.sh script does not append .c at the end of the decompiled files from the input archive.

Input

Run

retdec-archive-decompiler.sh FILE

where FILE is e.g. gnu.a from our regression-tests suite. You can take any archive you want as the issue does not depend on the input archive.

Output

Among other files, the command generates the following two files, which contain the decompiled C code:

gnu.a.file_1
gnu.a.file_2

Notice that the files do not have any extension.

Expected output

The generated files should end with .c, just like when you run retdec-decompiler.sh:

gnu.a.file_1.c
gnu.a.file_2.c

Configuration

  • Commit: ae9a6d4 (current master)
  • 64b Arch Linux, GCC 7.3.1, Debug build of RetDec
@s3rvac
Copy link
Member Author

s3rvac commented Apr 2, 2018

I have analyzed this. In scripts/retdec-archive-decompiler.sh, we call retdec-decompiler.sh for each file in the archive:

gnutimeout $TIMEOUT "$DECOMPILER_SH" --ar-index="$INDEX" -o "$LIBRARY_PATH.file_$FILE_INDEX" "$LIBRARY_PATH" $DECOMPILER_SH_ARGS > "$LOG_FILE" 2>&1

However, when specifying the output file via -o, we do not append the extension based on the selected high-level language (.c or .py, depending on -l/--target-language).

@s3rvac s3rvac self-assigned this May 26, 2018
s3rvac added a commit that referenced this issue May 26, 2018
…-decompiler.sh (#261).

The retdec-archive-decompiler.sh script did not append .c at the end of the
decompiled files from the input archive (see #261). This commit fixes that.

Since there is currently no way of selecting the target language when running
retdec-archive-decompiler.sh, we can just append '.c' to the output files as C
is the default target language.
@s3rvac
Copy link
Member Author

s3rvac commented May 26, 2018

Fixed in c924fea.

@s3rvac s3rvac closed this as completed May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant