GithubHelp home page GithubHelp logo

Comments (10)

PeterMatula avatar PeterMatula commented on September 25, 2024

Can you successfully run RetDec (retdec-decompiler.py) from command line - not via IDA?

I.e. gen you try the following:

  • python retdec-decompiler.py --help
    • In your environment probably something like this (I'm guessing from the paths in that error message, maybe you will have to fix it a little bit):
      C:\Users\x230\AppData\Local\Programs\Python\Python35-32\python.exe D:\GitHub\retdec-v3.3-windows-32b\retdec\bin\retdec-decompiler.py --help
  • python retdec-decompiler.py x86_crackme_hash.exe
    • C:\Users\x230\AppData\Local\Programs\Python\Python35-32\python.exe D:\GitHub\retdec-v3.3-windows-32b\retdec\bin\retdec-decompiler.py D:\examples\x86_crackme_hash.exe

If it works, we will try some more things. If it does not, please paste here what is says.

from retdec-idaplugin.

perfectswpuboy1 avatar perfectswpuboy1 commented on September 25, 2024

Can you successfully run RetDec (retdec-decompiler.py) from command line - not via IDA?

I.e. gen you try the following:

  • python retdec-decompiler.py --help

    • In your environment probably something like this (I'm guessing from the paths in that error message, maybe you will have to fix it a little bit):
      C:\Users\x230\AppData\Local\Programs\Python\Python35-32\python.exe D:\GitHub\retdec-v3.3-windows-32b\retdec\bin\retdec-decompiler.py --help
  • python retdec-decompiler.py x86_crackme_hash.exe

    • C:\Users\x230\AppData\Local\Programs\Python\Python35-32\python.exe D:\GitHub\retdec-v3.3-windows-32b\retdec\bin\retdec-decompiler.py D:\examples\x86_crackme_hash.exe

If it works, we will try some more things. If it does not, please paste here what is says.

Running alone looks like there is no problem, but there is an error message, I don't know if it is the reason.

`##### Trying to unpack D:\examples\x86_crackme_hash.exe into D:\examples\x86_crackme_hash-unpacked.tmp by using generic unpacker...
RUN: D:\GitHub\retdec-v3.2-windows-32b\retdec\bin\retdec-unpacker D:\examples\x86_crackme_hash.exe -o D:\examples\x86_crackme_hash-unpacked.tmp --max-memory-half-ram
No matching plugins found for 'Microsoft Linker 12.0'
No matching plugins found for 'MSVC'

Unpacking by using generic unpacker: nothing to do
'upx' not available: nothing to do`

ConEmu_MTE0WWw4v0

ConEmu_85cOB3NgKJ
ConEmu_488FX1Ul39
ConEmu_CE5PA0N9PM

from retdec-idaplugin.

perfectswpuboy1 avatar perfectswpuboy1 commented on September 25, 2024

//
// This file was generated by the Retargetable Decompiler
// Website: https://retdec.com
// Copyright (c) 2019 Retargetable Decompiler [email protected]
//

#include <stdint.h>
#include <stdio.h>

// ------------------- Function Prototypes --------------------

int32_t function_401000(char * a1);

// --------------------- Global Variables ---------------------

char (*g1)[6] = "1>=&1";

// ------------------------ Functions -------------------------

// Address range: 0x401000 - 0x40105c
int32_t function_401000(char * a1) {
char v1 = *a1; // 0x4010265
if (v1 == 0) {
// 0x401054
return 0xabcd;
}
int32_t v2 = *(int32_t *)&g1;
int32_t v3 = 0; // 0x4010238
char v4 = *(char *)((int32_t)(0x100000000 * (int64_t)(v3 >> 31) % 5) + v2); // 0x401046
int32_t result = (int32_t)(v4 ^ v1) + 0xabcd; // 0x40104c
int32_t v5 = v3 + 1; // 0x40101a
char v6 = *(char *)(v5 + (int32_t)a1); // 0x401026
// branch -> 0x40102d
while (v6 != 0) {
// 0x40102d
v3 = v5;
v4 = *(char *)((int32_t)((0x100000000 * (int64_t)(v3 >> 31) | (int64_t)v5 & 0xffffffff) % 5) + v2);
result += (int32_t)(v4 ^ v6);
v5 = v3 + 1;
v6 = *(char *)(v5 + (int32_t)a1);
// continue -> 0x40102d
}
// 0x401054
return result;
}

// Address range: 0x401060 - 0x4010b7
int main(int argc, char ** argv) {
int32_t result = -1;
if (argc == 2) {
int32_t v1 = function_401000((char )(int32_t *)((int32_t)argv + 4)); // 0x40107e
if (v1 != 0xad6d) {
// 0x4010a2
printf("loose\n");
// branch -> 0x4010b0
} else {
// 0x401092
printf("Win\n");
// branch -> 0x4010b0
}
// 0x4010b0
result = v1;
// branch -> 0x4010b3
}
// 0x4010b3
return result;
}

// --------------- Dynamically Linked Functions ---------------

// int printf(const char * restrict format, ...);

// --------------------- Meta-Information ---------------------

// Detected compiler/packer: microsoft linker (12.0)
// Detected functions: 2
// Decompilation date: 2019-03-20 18:16:00

from retdec-idaplugin.

PeterMatula avatar PeterMatula commented on September 25, 2024

Ok, it looks like RetDec itself is working.
No, that message about not available UPX is not critical and can be ignored.

Now, we will try to determine if something goes wrong with the decompilation itself, or if the problem is in IDA plugin.
Trigger decompilation from IDA plugin - it will fail, but it will generate the needed files (e.g. config file x86_crackme_hash.idb.json) and it will show that error message you posted. Copy (or rewrite) the full command that is being run by launch_process(command) and try to run it manually - i.e. run C:\Users\x230\AppData\Local\Programs\Python\Python35-32\python.exe "D:\GitHub\retdec-v3.3-windows-32b\retdec\bin\retdec-decompiler.py" "D:\examples\x86_crackme_hash.exe" --config="..." --color-for-ida -o "..." --select-decode-only --select-ranges="...".

Does it fail, or does it work? If it fails, what does it say?

from retdec-idaplugin.

perfectswpuboy1 avatar perfectswpuboy1 commented on September 25, 2024

Ok, it looks like RetDec itself is working.
No, that message about not available UPX is not critical and can be ignored.

Now, we will try to determine if something goes wrong with the decompilation itself, or if the problem is in IDA plugin.
Trigger decompilation from IDA plugin - it will fail, but it will generate the needed files (e.g. config file x86_crackme_hash.idb.json) and it will show that error message you posted. Copy (or rewrite) the full command that is being run by launch_process(command) and try to run it manually - i.e. run C:\Users\x230\AppData\Local\Programs\Python\Python35-32\python.exe "D:\GitHub\retdec-v3.3-windows-32b\retdec\bin\retdec-decompiler.py" "D:\examples\x86_crackme_hash.exe" --config="..." --color-for-ida -o "..." --select-decode-only --select-ranges="...".

Does it fail, or does it work? If it fails, what does it say?


I've run it manually,seems it's works.So I don't understand why doesn't work in IDA.

retdec_转

If possible, you can use Teamviewer to remotely operate my computer to determine if there is something wrong with my IDA configuration.

from retdec-idaplugin.

s3rvac avatar s3rvac commented on September 25, 2024

I have just noticed that the command in the IDA error window is different from the one that you have tried to run manually:

different-command

Even the input files are different. Could you please try running the exact same command as in the IDA error window?

Also, could you please provide the following information?

  • What version of IDA do you use?
  • What version of retdec-idaplugin do you use?
  • What version of Windows do you use?

from retdec-idaplugin.

perfectswpuboy1 avatar perfectswpuboy1 commented on September 25, 2024

What version of IDA do you use? : 7.0
What version of retdec-idaplugin do you use? : v3.3(3.2 the same error)
What version of Windows do you use? :win7 SP1 Ultimate
ret-dec-_jq_转
I noticed that there is no .c file output.
explorer_Z6j1KHO9Wf

from retdec-idaplugin.

fubuki8087 avatar fubuki8087 commented on September 25, 2024

It seems that this problem is caused by Chinese character. When the file you reverse is put in the path that has Chinese character, it raises this error. I meet the same problem, but if I move the file to English path, it works.

from retdec-idaplugin.

perfectswpuboy1 avatar perfectswpuboy1 commented on September 25, 2024

It seems that this problem is caused by Chinese character. When the file you reverse is put in the path that has Chinese character, it raises this error. I meet the same problem, but if I move the file to English path, it works.

Thank for replay,But there is absoluty English Path.

from retdec-idaplugin.

PeterMatula avatar PeterMatula commented on September 25, 2024

After 3503eb6, plugin no longer uses launch_process. Release v1.0 will come shortly.

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.