Statically linked code is not removed when decompiling through the IDA plugin

Open
#10 0 comments 0 reactions 1 assignee View on GitHub

@PeterMatula is already working on this.

Since Sep 16, 2019.

Assessment

This issue has not been assessed yet.

Description

bug P-output

When the attached PE binary file is decompiled through the IDA plugin, statically linked code is not removed, but when I decompile it directly through decompile.sh, it is removed.

Input and output files

The input and both output C files can be downloaded here.

Steps to reproduce

  1. Decompile the input binary file hello-world.exe through the IDA plugin via run-ida-decompilation.sh:
    $ run-ida-decompilation.sh hello-world.exe -o hello-world.idpalugin.c
    
  2. Decompile the same file directly through decompile.sh:
    $ decompile.sh hello-world.exe -o hello-world.decompile-sh.c
    

Expected output

The input binary file hello-world.exe contains just main() with printf("Hello, world!");. This is exactly what decompile.sh produces in hello-world.decompile-sh.c (just a single main() function and nothing more).

However, hello-world.idaplugin.c contains not only _main() but also 47 other functions that come from statically linked code. I would expect them to be removed, just like when the file is decompiled directly through decompile.sh.

Configuration

  • retdec commit: 8c4b23d (current master)
  • retdec-idaplugin commit: e249927a86c4ebd3b8d5c19de72cdf9f364bef3d (current master)
  • 64b Arch Linux, GCC 7.2.1, Debug builds of both RetDec and IDA plugin
Dominant language
C++
Stars
799
Forks
132
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from avast/retdec-idaplugin

All issues in avast/retdec-idaplugin

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.