rizinorg / rz-ghidra

Deep ghidra decompiler and sleigh disassembler integration for rizin
GNU Lesser General Public License v3.0
818 stars 86 forks source link

rz-ghidra can't detect string #85

Open dmknght opened 4 years ago

dmknght commented 4 years ago

Describe the issue

I am having a block of code like this Screenshot at 2020-02-27 15-30-03

R2 ghidra shows this Screenshot at 2020-02-27 15-31-49 Out put of r2dec can show some string (other strings are showing as addresses) Screenshot at 2020-02-27 15-32-05

How to reproduce? Open binary with Cutter 1.10.1 app image

Expected behavior

All string should be detected and be showed as put("string")

Possible fix

Screenshots

Additional context

Binary file lab1A.zip

DhruvaG2000 commented 2 years ago

I know that the issue mentions "Open binary with Cutter 1.10.1 app image" however when I use a later version of cutter (Cutter-v2.0.5-x64.Linux.AppImage) I get the following output, which I think does solve this issue?

image

dmknght commented 2 years ago

I know that the issue mentions "Open binary with Cutter 1.10.1 app image" however when I use a later version of cutter (Cutter-v2.0.5-x64.Linux.AppImage) I get the following output, which I think does solve this issue?

image

Hello. Your screenshot is using j2dec decompiler. The ghidra decompiler plugin is having this issue (still). image

XVilka commented 1 year ago

Still happens with the latest Rizin & Rz-ghidra (https://github.com/rizinorg/rizin/commit/ead601655cb8ba3655be278426ad8d6e60382227 and https://github.com/rizinorg/rz-ghidra/commit/0c9ab921afa034cf7186821712d988d06190e07e respectively)

[0x08048b44]> pdg

// WARNING: Removing unreachable block (ram,0x08048b65)
// WARNING: Restarted to delay deadcode elimination for space: stack

uint32_t main(undefined4 placeholder_0, char **envp)
{
    int32_t iVar1;
    uint32_t uVar2;
    int32_t in_GS_OFFSET;
    int size;
    FILE *stream;
    int32_t var_38h;
    char acStack52 [8];
    int32_t var_2ch;
    char *s;
    int32_t var_24h;
    int32_t iStack20;
    int32_t canary;

    iStack20 = *(int32_t *)(in_GS_OFFSET + 0x14);
    sym.imp.puts();
    sym.imp.puts();
    sym.imp.puts();
    sym.imp.puts();
    sym.imp.puts();
    sym.imp.puts();
    sym.imp.fgets();
    sym.imp.puts();
    sym.imp.puts();
    sym.imp.puts();
    sym.imp.puts();
    sym.imp.puts();
    sym.imp.__isoc99_scanf();
    iVar1 = sym.auth(acStack52, var_38h);
    if (iVar1 == 0) {
        sym.imp.puts();
        sym.imp.system();
    }
    uVar2 = (uint32_t)(iVar1 != 0);
    if (iStack20 != *(int32_t *)(in_GS_OFFSET + 0x14)) {
        uVar2 = sym.imp.__stack_chk_fail();
    }
    return uVar2;
}
[0x08048b44]> 
Tom0988 commented 7 months ago

Hi, I want to solve this issue as my microtask in GSOC