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

--cleanup removes the input file when used together with --mode raw #309

Closed
don1001 opened this issue May 25, 2018 · 4 comments · Fixed by #310
Closed

--cleanup removes the input file when used together with --mode raw #309

don1001 opened this issue May 25, 2018 · 4 comments · Fixed by #310

Comments

@don1001
Copy link

don1001 commented May 25, 2018

Hi, decompile.sh help states that

--cleanup    Removes temporary files created during the decompilation.

I use it with --mode raw, --select-ranges however it also removes input file which is a bit annoying if I want to select different range I need to copy the input file again. Solution is not to use --clean option but it is nice to remove the temporary files automatically.

@s3rvac
Copy link
Member

s3rvac commented May 25, 2018

Hi. Thank you for the report! You are totally right. Steps to reproduce with the current master:

$ wget https://github.com/avast-tl/retdec-regression-tests/raw/master/features/raw/binaries/raw.raw
$ retdec-decompiler.sh --mode raw --arch arm --endian big --raw-entry-point 0x0 --raw-section-vma 0 --cleanup raw.raw
$ ls raw*
raw.raw.c  raw.raw.c.frontend.dsm

@s3rvac s3rvac changed the title --clean removes input file --cleanup removes the input file when used together with --mode raw May 25, 2018
@don1001
Copy link
Author

don1001 commented May 25, 2018

cool, thx ! BTW. when you're at it you could remove *.frontend.dsm since it's created during the decompilation and not removed.

@s3rvac s3rvac self-assigned this May 25, 2018
s3rvac added a commit that referenced this issue May 25, 2018
… with --mode raw (#309).

This is done by removing the OUT_RAW_EXECUTABLE variable from
retdec-decompiler.sh, which is only set to $IN at the beginning of a
decompilation and serves no real purpose. It was probably a relict from the
past when we supported "raw" decompilations from C source code.
@s3rvac
Copy link
Member

s3rvac commented May 25, 2018

you could remove *.frontend.dsm since it's created during the decompilation and not removed.

The .dsm file is considered to be a part of RetDec's output. The other parts are the .c file and generated call graphs/control-flow graphs (optional). So, I do not think we will want to remove it during the cleanup as some users might need it.

BTW, the reason why the name of that file (file.c.frontend.dsm) feels temporary is historical. We would like to rename it so that RetDec produces file.c and file.dsm (see #132).

@s3rvac
Copy link
Member

s3rvac commented May 26, 2018

In #309, I have proposed a fix (commit b94efd2). After my colleague reviews the changes and accepts them, they will be merged and this issue will be fixed.

PeterMatula added a commit that referenced this issue May 28, 2018
…-input-file

Do not remove the input file when --cleanup is used together with --mode raw (#309)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants