frida 16.5.7 abi安装问题

2024-11-21

背景

安装 frida 16.5.7 失败。看一下日志吧。 abi 一直失败的原因是 fetch-abi-bits.py 读入的 node 版本错误,导致无法获取到正确的 node ABI bits。造成后续无法编译。

失败日志


Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Program node found: YES (C:\Users\${username}\AppData\Local\Temp\xfs-48f1bac7\node.CMD)
Program npm found: YES (C:\Program Files\nodejs\npm.CMD)
'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte
Unusable script 'C:\\Users\\${username}\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
Program python3 found: YES (C:\Users\${username}\AppData\Local\Programs\Python\Python310\python.exe)
Message: Fetching ABI bits
Running command: C:\Users\${username}\AppData\Local\Programs\Python\Python310\python.exe M:\source\rev-template\.yarn\unplugged\frida-npm-16.5.7-0f2ff73405\node_modules\frida\scripts/fetch-abi-bits.py node "" win x64 C:\Users\${username}\AppData\Local\Temp\xfs-48f1bac7\node.CMD "C:\Program Files\nodejs\npm.CMD" M:\source\rev-template\.yarn\unplugged\frida-npm-16.5.7-0f2ff73405\node_modules\frida\build
--- stdout ---

--- stderr ---
Traceback (most recent call last):
  File "M:\source\rev-template\.yarn\unplugged\frida-npm-16.5.7-0f2ff73405\node_modules\frida\scripts\fetch-abi-bits.py", line 343, in <module>
    main(sys.argv)
  File "M:\source\rev-template\.yarn\unplugged\frida-npm-16.5.7-0f2ff73405\node_modules\frida\scripts\fetch-abi-bits.py", line 52, in main
    abi = subprocess.run([node, "-e", f"console.log(require('node-abi').getAbi('{target}', '{runtime}'))"],
  File "C:\Users\${username}\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '[WindowsPath('C:/Users/${username}/AppData/Local/Temp/xfs-48f1bac7/node.CMD'), '-e', "console.log(require('node-abi').getAbi('', 'node'))"]' returned non-zero exit status 1.



这里应该打印更详细的日志的,如:

https://nodejs.org/dist/9.5.1/node-9.5.1-headers.tar.gz
HTTP Error 404: Not Found

无文件导致解析失败。

成功

C:\Users\${username}\AppData\Local\Programs\Python\Python310\python.exe M:\source\rev-template\.yarn\unplugged\frida-npm-16.5.7-0f2ff73405\node_modules\frida\scripts/fetch-abi-bits.py node "" win x64 "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\npm.CMD" M:\source\rev-template\.yarn\unplugged\frida-npm-16.5.7-0f2ff73405\node_modules\frida\build%~dp0\node.exe
abi: 115
node_defines: _GLIBCXX_USE_CXX11_ABI=1 NODE_OPENSSL_CONF_NAME=nodejs_conf NODE_OPENSSL_HAS_QUIC ICU_NO_USER_DATA_OVERRIDE WIN32 _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE _HAS_EXCEPTIONS=0 USING_V8_SHARED=1 USING_UV_SHARED=1 OPENSSL_NO_PINSHARED OPENSSL_THREADS
node_incdir: abi-bits\include\node
node_lib: abi-bits\lib\node.lib

结论

更多时候,升级依赖应该自己尝试,依赖的小版本也许可以无痛升级,但一旦版本对于当前环境不适合的时候就无法运行了。没测试过的依赖升级是极其危险的。

copyright ©2019-2024 shenzhen
粤ICP备20041170号-1