当前位置: 首页 > news >正文

r2pm -ci r2ghidra 时报错:checking pkg-config flags for r_core... no

参考网址:

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 time28 |         .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;
}

终于有时间了接着安装r2ghidra插件,接着上面报错:

 找到r2ghidra的默认的路径:~/.local/share/radare2/r2pm/git/r2ghidra

在./src路径下找到anal_ghidra_plugin.c文件,按照“has no member named”报错,找到一篇文档:C语言,C++编译遇到问题:has no member named ''XXX‘_ZDF19的博客-CSDN博客

文档中找到的两个方法都没有用,还要自己进行解决,估计是“cpus”没有定义,查看源文件

 27  #if R2_VERSION_NUMBER >= 5060928          .endian = R_SYS_ENDIAN_LITTLE | R_SYS_ENDIAN_BIG,29 #endif30          .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",31 

查看当前系统的r2版本

 r2 -V
5.5.0  r2
5.5.0  r_anal
5.5.0  r_lib
5.5.0  r_egg
5.5.0  r_asm
5.5.0  r_bin
5.5.0  r_cons
5.5.0  r_flag
5.5.0  r_core

应该是大于50609

把29行的#endif下移如下,搞定

 27  #if R2_VERSION_NUMBER >= 5060928          .endian = R_SYS_ENDIAN_LITTLE | R_SYS_ENDIAN_BIG,2930          .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",31  #endif

http://www.lryc.cn/news/93633.html

相关文章:

  • 【宿舍管理系统】注册登录页面的实现(前端)
  • python写入excel,(二) 言简意赅傻瓜式写法
  • 我用ChatGPT写2023高考语文作文(六):北京卷II
  • Vue中如何进行图表绘制
  • 【Soft-prompt Tuning for Large Language Models to Evaluate Bias 论文略读】
  • Qt 定时器与定时事件
  • 《UNUX环境高级编程》(1)UNIX基础
  • MATLAB 入门之旅摘要
  • chatgpt赋能python:Python小数运算:解决精度问题的最佳实践
  • Linux 安装Docker完整教程(六)
  • 手机连接adb 相关问题汇总
  • MySQL数据相关操作
  • 2023年5月青少年软件编程(Python) 等级考试试卷(四级)
  • Python selenium自动化测试模型图解
  • 【详解】篮球记分牌硬件及代码
  • FreeRTOS实时操作系统(二)系统文件代码学习
  • 分布式驱动电动汽车定速巡航控制
  • 如何启动和关闭分布式集群
  • WLAN基本概述及简单组网配置
  • 响应式Web设计单元测试
  • linux计划任务管理
  • 研一,有点迷茫。
  • 【新版】系统架构设计师 - 软件工程
  • html实现好看的个人介绍,个人主页模板3(附源码)
  • 某大厂工作3年,被劣驱良了。。。
  • 爱奇艺大数据加速:从Hive到Spark SQL
  • c++构造函数的多个细节拷问
  • Redis入门 - Lua脚本
  • Creating Serial Numbers (C#)
  • pycharm使用之torch_geometric安装