GithubHelp home page GithubHelp logo

Comments (7)

PeterMatula avatar PeterMatula commented on September 25, 2024

Yes, it seems you are doing everything right - so it it hard to say, what is wrong. Lets try two things:

  1. Can you try it with some binary that does not use custom IDA loader? This should not cause the described problem, but who knows. Just try it with as simple binary as possible.
  2. If it still does not work (probable), can you try running RetDec from cmd.exe the same way the plugin does (it uses sh)?
    sh retdec-decompiler.sh --help
    sh retdec-decompiler.sh simple-binary.exe

from retdec-idaplugin.

BullyWiiPlaza avatar BullyWiiPlaza commented on September 25, 2024
  1. Using a simple binary (32-bit Windows DLL) in IDA also fails with the same problem (but I don't get the custom loader warning)
  2. From cmd.exe it works but I just used retdec-decompiler.sh simple-binary.dll instead of the prepended sh since the sh command is not installed and it doesn't seem to be needed though.

With win-bash:

>C:\shell\sh.exe retdec-decompiler.sh simple-binary.dll
C:\Users\User\AppData\Local\Temp\191776.201428.inc.sh2: readlink: command not found
retdec-decompiler.sh: ./retdec-utils.sh: No such file or directory
retdec-decompiler.sh: syntax error near unexpected token `<<<'
retdec-decompiler.sh: retdec-decompiler.sh: line 184: `                 IFS='-' read -a vs <<< "$r"  # parser line into array'

I might be doing the later wrong but since I'm running Windows, readlink doesn't exist (it's a Linux command). Also I'm not sure why the IDA plugin uses sh when it works from cmd.exe without it.

from retdec-idaplugin.

Tiemichael avatar Tiemichael commented on September 25, 2024

I am facing the exactly same issue as outlined in the 1st post.
(Windows 10/64, most recent IDA Pro, retdec and plugin, following all instructions from the Github pages)

C:\Users\Michael>sh retdec-decompiler.sh test.exe /c/retdec/bin/retdec-decompiler.sh: line 23: ./retdec-utils.sh: No such file or directory

C:\Users\Michael>bash retdec-decompiler.sh test.exe /c/retdec/bin/retdec-decompiler.sh: line 23: ./retdec-utils.sh: No such file or directory /c/retdec/bin/retdec-decompiler.sh: line 169: get_realpath: command not found /c/retdec/bin/retdec-decompiler.sh: line 170: get_realpath: command not found

from retdec-idaplugin.

Maroc-OS avatar Maroc-OS commented on September 25, 2024

Fixed here : c195e41 pull request here : #27

from retdec-idaplugin.

PeterMatula avatar PeterMatula commented on September 25, 2024

I think the problem is the missing sh (i.e. missing MSYS2). Right now, it is a bit tricky to set up everything correctly. Section 2.2 of plugin's user guide says you need a properly installed standalone RetDec. The instructions to follow say to install and configure MSYS2 on Windows. Then, you should have both sh and readlink (and a bunch of other stuff).

Standalone RetDec might be working on your system even without MSYS2, but it does not on all Windows systems. That is why the plugin is explicitly calling sh (MSYS2) at the moment. If the MSYS2 is installed and in the path, it should work for all.

Try to install MSYS2.

There is already a pull request that rewrites all bash scripts to Python. Once this is finalized and merged, the whole process should be much simpler - no MSYS, only Python. We will definitely create a new release, maybe even an all in one that contains both RetDec and plugin and will not need to be configured much (at all?).

from retdec-idaplugin.

Tiemichael avatar Tiemichael commented on September 25, 2024

Thanks for your reply.
Not sure if I understand correctly, but when I use 'MSYS2' a MSYS-shell opens.
C:\msys64\mingw64\bin;C:\msys64;C:\msys64\usr\bin; are included in my path.

from retdec-idaplugin.

BullyWiiPlaza avatar BullyWiiPlaza commented on September 25, 2024

After installing MYS2 and adding C:\msys64\usr\bin;C:\msys64;C:\msys64\usr\bin to the PATH it works now for me now. I also agree that Python would be better.

from retdec-idaplugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.