首页
社区
课程
招聘
[原创]编译frida16.0.2 python 模块
发表于: 2022-10-26 17:48 7670

[原创]编译frida16.0.2 python 模块

2022-10-26 17:48
7670

frida 库是在编写frida的hook脚本时必须引入的依赖,其在windows平台的编译过程如下。

修改配置项和部分源码

注意: 如下的步骤需要在全局代理的情况下进行,同时对git设置代理,例如

git config --global http.proxy http:127.0.0.1:1080

Run:

编译完成后验证是否可用, 编写python脚本使用它:(venv):

验证脚本 test.py:

例如:

Frida编译2022

git clone --recurse-submodules https://github.com/frida/frida
git checkout 16.0.2
git clone --recurse-submodules https://github.com/frida/frida
git checkout 16.0.2
原始:
    <PythonLocation Condition="'$(PythonLocation)'=='' AND '$(Platform)'=='x64'">$(ProgramFiles)\Python310< / PythonLocation>
    <PythonLocation Condition="'$(PythonLocation)'=='' AND '$(Platform)'=='Win32'">$(MSBuildProgramFiles32)\Python310< / PythonLocation>
 
例如修改为:
    <PythonLocation Condition="'$(PythonLocation)'=='' AND '$(Platform)'=='x64'">C:\Users\29265\AppData\Local\Programs\Python\Python310< / PythonLocation>
    <PythonLocation Condition="'$(PythonLocation)'=='' AND '$(Platform)'=='Win32'">C:\Users\29265\AppData\Local\Programs\Python\Python310-32< / PythonLocation>
原始:
    <PythonLocation Condition="'$(PythonLocation)'=='' AND '$(Platform)'=='x64'">$(ProgramFiles)\Python310< / PythonLocation>
    <PythonLocation Condition="'$(PythonLocation)'=='' AND '$(Platform)'=='Win32'">$(MSBuildProgramFiles32)\Python310< / PythonLocation>
 
例如修改为:
    <PythonLocation Condition="'$(PythonLocation)'=='' AND '$(Platform)'=='x64'">C:\Users\29265\AppData\Local\Programs\Python\Python310< / PythonLocation>
    <PythonLocation Condition="'$(PythonLocation)'=='' AND '$(Platform)'=='Win32'">C:\Users\29265\AppData\Local\Programs\Python\Python310-32< / PythonLocation>
例如
 
原始:
    throw new Error.NOT_SUPPORTED ("Unsupported ABI: “%s”; please file a bug", abi);
修改为:
    throw new Error.NOT_SUPPORTED ("Unsupported ABI: \"%s\"; please file a bug", abi);
例如
 
原始:
    throw new Error.NOT_SUPPORTED ("Unsupported ABI: “%s”; please file a bug", abi);
修改为:
    throw new Error.NOT_SUPPORTED ("Unsupported ABI: \"%s\"; please file a bug", abi);
 
 
import sys
 
print(sys.path)
sys.path.append("D:\frida_source\frida\build\frida-windows\x64-Release\lib\python3.10\site-packages")
 
import frida
proname = r'notepad.exe'
session = frida.attach(proname)
script = session.create_script('''
rpc.exports.eM = function (){
  return Process.enumerateModules();
};
''')
 
def on_msg(msg,data):
  print("[signal message] msg:", msg,"data:", data)
 
script.on('message',on_msg)
script.load()
 
ms = script.exports.e_m()
print([m['name'] for m in ms])
import sys
 
print(sys.path)
sys.path.append("D:\frida_source\frida\build\frida-windows\x64-Release\lib\python3.10\site-packages")
 
import frida
proname = r'notepad.exe'
session = frida.attach(proname)
script = session.create_script('''
rpc.exports.eM = function (){

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

最后于 2022-10-27 13:21 被descosmos编辑 ,原因: 修改问题
收藏
免费 2
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//