r2frida icon indicating copy to clipboard operation
r2frida copied to clipboard

hi, what's this problems?

Open wangzhou25 opened this issue 2 years ago • 2 comments

r2frida

wangzhou25 avatar Mar 25 '22 14:03 wangzhou25

cant reproduce. can you provide some more details like, the version of frida, the version of ios/android you are testing this? also, i assume you are using the last version of r2 and the last version of r2frida.

to reduce the test coverage, can you verify if reading works when seeking to an aligned address? for example by typing: s..0;x

Another thing you can test is to set the export R2FRIDA_SAFE_IO=1 environment var before launching r2 frida://.. this env var workarounds a bug in frida on android for 32bit.

trufae avatar Mar 25 '22 17:03 trufae

Thinks for reply, my device type is android 8.1,

I tryed set export R2FRIDA_SAFE_IO=1, it still doesn't work

the vesion info:

wangzhou@Mac:~$ radare2 -v radare2 5.6.5 2 @ darwin-x86-64 git. commit: 619d9cb8ccc5bb182e4174b7ad96f2f4bded0a7f build: 2022-03-10__23:43:10

[0x00000000]> :?V {"version":"15.1.17.17.g7e4d9df"} [0x00000000]> ?V 5.6.5 aka commit 2

I install it by sudo r2pm -ci r2frida, install log like this:

Cleaning r2frida... clean Done For r2frida /Users/wangzhou/.local/share/radare2/r2pm/db/r2frida TGZ= Cleaning up /Users/wangzhou/.local/share/radare2/r2pm/git/r2frida... HEAD 现在位于 f74849c Add rl78 plugin 更新 f74849c..0ce4b31 Fast-forward README.md | 6 ++---- db/hexagon | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 db/hexagon [r2pm] Updating package database /Users/wangzhou/.local/share/radare2/r2pm/db ... 已经是最新的。 error: 路径规格 'r2-5.6.5' 未匹配任何 git 已知文件 已经是最新的。 Install Done For r2frida checking build system type... x86_64-unknown-darwin checking host system type... x86_64-unknown-darwin checking target system type... x86_64-unknown-darwin checking for working directories... current using prefix '/usr/local' checking for pkg-config... /opt/local/bin/pkg-config checking for c compiler... gcc checking exec r2 -v... ok Using PKGCONFIG: /opt/local/bin/pkg-config checking pkg-config flags for r_core... yes checking for curl... /usr/bin/curl checking for wget... /usr/local/bin/wget checking for git... /usr/local/bin/git checking for xz... /opt/local/bin/xz creating ./config.mk creating ./config.h cleaning temporally files... done

Final report:

  • R2_VERSION = radare2 5.6.5 2 @ darwin-x86-64 git. commit: 619d9cb8ccc5bb182e4174b7ad96f2f4bded0a7f build: 2022-03-10__23:43:10 git submodule update --init rm -f ext/frida mkdir -p ext/frida-macos-15.1.17/_ curl -Ls https://github.com/frida/frida/releases/download/15.1.17/frida-core-devkit-15.1.17-macos-x86_64.tar.xz | xz -d | tar -C ext/frida-macos-15.1.17/_ -xf - mv ext/frida-macos-15.1.17//* ext/frida-macos-15.1.17 rmdir ext/frida-macos-15.1.17/ #mv ext/frida ext/frida-macos-15.1.17 cd ext && ln -fs frida-macos-15.1.17 frida [ "readlink ext/frida" = frida-macos-15.1.17 ] ||
    (cd ext && rm -f frida ; ln -fs frida-macos-15.1.17 frida) make io_frida.dylib wget -O src/_agent.js https://github.com/nowsecure/r2frida/releases/download/v5.6.2/_agent.js --2022-03-25 19:53:00-- https://github.com/nowsecure/r2frida/releases/download/v5.6.2/_agent.js 正在解析主机 github.com (github.com)... 13.234.176.102 正在连接 github.com (github.com)|13.234.176.102|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 302 Found 位置:https://objects.githubusercontent.com/github-production-release-asset-2e65be/35610263/9a0ddebf-a92a-4462-abd7-cd0ee24bd6dc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220325%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220325T115302Z&X-Amz-Expires=300&X-Amz-Signature=7082109cb6244bb010ce9012b9607ef1aa32c6dca6a679e223bdc280eab9842e&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=35610263&response-content-disposition=attachment%3B%20filename%3D_agent.js&response-content-type=application%2Foctet-stream [跟随至新的 URL] --2022-03-25 19:53:03-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/35610263/9a0ddebf-a92a-4462-abd7-cd0ee24bd6dc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220325%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220325T115302Z&X-Amz-Expires=300&X-Amz-Signature=7082109cb6244bb010ce9012b9607ef1aa32c6dca6a679e223bdc280eab9842e&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=35610263&response-content-disposition=attachment%3B%20filename%3D_agent.js&response-content-type=application%2Foctet-stream 正在解析主机 objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.108.133, ... 正在连接 objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:171004 (167K) [application/octet-stream] 正在保存至: “src/_agent.js”

src/_agent.js 100%[=====================================================================================================================>] 167.00K 156KB/s 用时 1.1s

2022-03-25 19:53:06 (156 KB/s) - 已保存 “src/_agent.js” [171004/171004])

r2 -nfqcpc src/_agent.js | grep 0x > src/_agent.h cc -c -DFRIDA_VERSION_STRING="15.1.17" -fPIC -g -I/usr/local/include/libr -I/opt/local/libexec/openssl3/include -I/usr/local/include/libr -I/usr/local/include/libr/sdb -Iext/frida src/io_frida.c -o src/io_frida.o pkg-config --cflags r_core -I/usr/local/include/libr -I/opt/local/libexec/openssl3/include -I/usr/local/include/libr -I/usr/local/include/libr/sdb c++ src/io_frida.o -o io_frida.dylib -shared -fPIC -g -L/usr/local/lib -L/opt/local/libexec/openssl3/lib -L/usr/local/lib -lr_core -lssl -lcrypto -lr_config -lr_debug -lr_bin -lr_anal -lr_bp -lr_egg -lr_asm -lr_lang -lr_parse -lr_flag -lr_reg -lr_search -lr_syscall -lr_fs -lr_magic -lr_io -lr_socket -lr_cons -lr_crypto -lr_hash -lr_util -ldl -Wl,-exported_symbol,_radare_plugin -Wl,-no_compact_unwind ext/frida/libfrida-core.a -lresolv -framework Foundation -lbsm -framework AppKit ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Foundation are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//AppKit.framework/AppKit.tbd and library file /System/Library/Frameworks//AppKit.framework/AppKit are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation.tbd and library file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//ApplicationServices.framework/Versions/A/ApplicationServices.tbd and library file /System/Library/Frameworks//ApplicationServices.framework/Versions/A/ApplicationServices are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/Versions/A/CoreFoundation are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics.tbd and library file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText.tbd and library file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO.tbd and library file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices.tbd and library file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork.tbd and library file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList are out of sync. Falling back to library file for linking. mkdir -p /"/Users/wangzhou/.local/share/radare2/plugins" cp -f io_frida.dylib* /"/Users/wangzhou/.local/share/radare2/plugins"

wangzhou25 avatar Mar 26 '22 02:03 wangzhou25

Please try again with latest r2 and r2frida, i fixed a related issue that was happening on some circunstancies that could be the reason why this was happening.

thanks for reporting! ill close the ticket because this was a well known issue that was partly depending on a bug in Frida and r2frida is now handling it properly

trufae avatar Nov 27 '23 17:11 trufae