参考网址:
sys/python.sh fails with `checking pkg-config flags for r_core... no` · Issue #1943 · radareorg/radare2 · GitHub
进入目录/root/.local/share/radare2/r2pm/git/r2ghidra查看configure文件,查找报错位置
执行指令 :
# pkg-config --cflags r_core
Package libxxhash was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxxhash.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxxhash', required by 'r_hash', not found
Package 'libxxhash', required by 'r_hash', not found
Package 'libxxhash', required by 'r_hash', not found
Package 'libxxhash', required by 'r_hash', not found
Package 'libxxhash', required by 'r_hash', not found
Package 'libxxhash', required by 'r_hash', not found
Package 'libxxhash', required by 'r_hash', not found
安装 libxxhash
apt-get install libxxhash-dev
最后进行:r2pm -ci r2ghidra 进行安装时还是报错:
anal_ghidra_plugin.c:28:10: error: ‘RAnalPlugin’ {aka ‘struct r_anal_plugin_t’} has no member named ‘cpus’
28 | .cpus = "6502,6805,8051,arm,avr,cr16,dalvik,hppa,java,m68k,m8c,mips,mcs96,msp430,pic24,ppc,sh,sparc,stm8,tricore,toy,v850,wasm,x86,z80",
| ^~~~
anal_ghidra_plugin.c:28:17: error: initializer element is not computable at load time
28 | .cpus = "6502,6805,8051,arm,avr,cr16,dalvik,hppa,java,m68k,m8c,mips,mcs96,msp430,pic24,ppc,sh,sparc,stm8,tricore,toy,v850,wasm,x86,z80",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
anal_ghidra_plugin.c:28:17: note: (near initialization for ‘r_anal_plugin_ghidra.bits’)
gmake: *** [<builtin>: anal_ghidra_plugin.o] Error 1
gmake: Leaving directory '/root/.local/share/radare2/r2pm/git/r2ghidra/src'
ERROR make
pdg反编译指令暂时搞不定。
安装r2dec插件,使用pdd反编译
r2pm install r2dec
[0x08048430]> pdd @main
/* r2dec pseudo code output */
/* /root/test/ret2win32 @ 0x8048546 */
#include <stdint.h>
int32_t main (char ** argv) {
int32_t var_4h;
ecx = &argv;
eax = stdout;
setvbuf (eax, 0, 2, 0);
puts ("ret2win by ROP Emporium");
puts ("x86\n");
pwnme ();
puts ("\nExiting");
eax = 0;
ecx = var_4h;
esp = ecx - 4;
return eax;
}