Files
r2ghidra/test/db/extras/r2ghidra_ccode
T
pancake ab2d3b9b48 Update ghidra-native to 0.7.3
* Implement the new Scope::findSymbolBefore/After by asking the cache
* Look up join records through AddrSpace::findJoin
* Iterate main ops now that INDIRECTs live in their own container
* Follow the new size argument of pushUnnamedLocation
* Refresh test expectations for the new decompiler and sleigh output
2026-11-06 00:44:50 +01:00

56 lines
1.1 KiB
Plaintext

# ConsoleApplication1.exe is radare2-testbins/pe/ConsoleApplication1.exe; the ELF
# fixtures are built by test/bins/Makefile.
NAME=ccode strips the Windows API-set DLL prefix from import names
FILE=bins/pe/ConsoleApplication1.exe
CMDS=<<EOF
aaaa
s sub.api_ms_win_crt_stdio_l1_1_0.dll__set_fmode
e r2ghidra.ccode=true
pdg~_set_fmode
EOF
EXPECT=<<EOF
void _set_fmode(void)
_set_fmode();
EOF
RUN
NAME=ccode preserves the whole ELF import name
FILE=bins/elf/x86_64-pthread-lock.so
CMDS=<<EOF
aa
s entry0
e r2ghidra.ccode=true
pdg~pthread_mutex_lock
EOF
EXPECT=<<EOF
pthread_mutex_lock(arg1);
EOF
RUN
NAME=ccode keeps leading underscores of sym.imp names
FILE=bins/hello-arm
CMDS=<<EOF
aa
s sym._start_main
e r2ghidra.ccode=true
pdg~__libc_init
EOF
EXPECT=<<EOF
__libc_init(param_1,0,*(iRam00000424 + 0x418),&uStack_14);
EOF
RUN
NAME=ccode honors r2ghidra.casts and keeps necessary truncations
FILE=bins/elf/x86_64-cast-test.o
CMDS=<<EOF
aa
s sym.cast_test
e r2ghidra.ccode=true
e r2ghidra.casts=true
pdg~return
EOF
EXPECT=<<EOF
return (int64_t)(int)arg1 + 0x100000000;
EOF
RUN