内部网站建设app/百度怎样免费发布信息
windows系统frida==12.8.0安装思路
陈桂林老师在《安卓Frida逆向与协议分析》这本书里面介绍的frida调试组合是:
python==3.8.0frida==12.8.0
frida-tools==5.3.0
object==1.8.4
通过上面链接提供的思路,也就表示在Linux中也是类似的安装流程。
首先需要准备frida==12.8.0
的源码包以及对应的egg
文件
frida-12.8.0源码包
对应的egg文件
对应的下载链接是:
源码包
egg文件
当然,解压完之后需要修改源码包的setup.py
文件,跳过xmlrpc
的检查
//setup.py# -*- coding: utf-8 -*-
from __future__ import print_functionimport codecs
try:from io import BytesIO
except:try:from cStringIO import StringIO as BytesIOexcept:from StringIO import StringIO as BytesIO
import os
import platform
import re
from setuptools import setup
from setuptools.command.build_ext import build_ext
from setuptools.extension import Extension
import shutil
import struct
import sys
try:from urllib.request import urlopen, Request
except:from urllib2 import urlopen, Request
try:import xmlrpclib
except ImportError:import xmlrpc.client as xmlrpclib
import zipfilepackage_dir = os.path.dirname(os.path.realpath(__file__))
pkg_info = os.path.join(package_dir, "PKG-INFO")
in_source_package = os.path.isfile(pkg_info)
if in_source_package:with codecs.open(pkg_info, "r", 'utf-8') as f:version_line = [line.rstrip("\r") for line in f.read().split("\n") if line.startswith("Version: ")][0]frida_version = version_line[9:]long_description = None
else:frida_version = os.environ['FRIDA_VERSION']long_description = codecs.open(os.path.join(package_dir, "README.md"), "r", 'utf-8').read()frida_extension = os.environ['FRIDA_EXTENSION']
frida_major_version = int(frida_version.split(".")[0])class FridaPrebuiltExt(build_ext):def build_extension(self, ext):target = self.get_ext_fullpath(ext.name)target_extension = os.path.splitext(target)[1]target_dir = os.path.dirname(target)try:os.makedirs(target_dir)except:passif in_source_package:python_version = sys.version_info[0:2]python_major_version = python_version[0]system = platform.system()arch = struct.calcsize('P') * 8if system == 'Windows':os_version = "win-amd64" if arch == 64 else "win32"elif system == 'Darwin':os_version = "macosx-10.6-intel" if python_major_version == 3 else "macosx-10.9-intel"elif system == 'Linux':machine = platform.machine()if machine == "" or "86" in machine:os_version = "linux-x86_64" if arch == 64 else "linux-i686"else:os_version = "linux-" + machine# 注释掉或删除以下网络查询部分# network_error = None# try:# print("querying pypi for available prebuilds")# client = xmlrpclib.ServerProxy("https://pypi.python.org/pypi", transport=UrllibTransport())# urls = client.release_urls("frida", frida_version)# ...# except Exception as e:# network_error = e# 直接指定预构建扩展文件路径egg_filename = "frida-{}-py{}.{}-{}.egg".format(frida_version, python_version[0], python_version[1], os_version)egg_path = os.path.expanduser("~/{}".format(egg_filename))print("looking for prebuilt extension in home directory, i.e.", egg_path)try:with open(egg_path, "rb") as f:egg_data = f.read()except:print("no prebuilt extension found in home directory")raise Exception("Please download the appropriate .egg file and place it in your home directory.")egg_file = BytesIO(egg_data)print("extracting prebuilt extension")egg_zip = zipfile.ZipFile(egg_file)extension_member = [info for info in egg_zip.infolist() if info.filename.endswith(target_extension)][0]extension_data = egg_zip.read(extension_member)if system == 'Windows' and python_major_version >= 3:extension_data = re.sub(b"python[3-9][0-9].dll", "python{0}{1}.dll".format(*python_version).encode('utf-8'), extension_data)with open(target, 'wb') as f:f.write(extension_data)else:shutil.copyfile(frida_extension, target)setup(name="frida",version=frida_version,description="Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers",long_description=long_description,long_description_content_type="text/markdown",author="Frida Developers",author_email="oleavr@frida.re",url="https://www.frida.re",license="wxWindows Library Licence, Version 3.1",zip_safe=True,keywords="frida debugger dynamic instrumentation inject javascript windows macos linux ios iphone ipad android qnx",classifiers=["Development Status :: 5 - Production/Stable","Environment :: Console","Environment :: MacOS X","Environment :: Win32 (MS Windows)","Intended Audience :: Developers","Intended Audience :: Science/Research","License :: OSI Approved","Natural Language :: English","Operating System :: MacOS :: MacOS X","Operating System :: Microsoft :: Windows","Operating System :: POSIX :: Linux","Programming Language :: Python :: 2","Programming Language :: Python :: 2.7","Programming Language :: Python :: 3","Programming Language :: Python :: 3.4","Programming Language :: Python :: 3.5","Programming Language :: Python :: 3.6","Programming Language :: Python :: 3.7","Programming Language :: Python :: Implementation :: CPython","Programming Language :: JavaScript","Topic :: Software Development :: Debuggers","Topic :: Software Development :: Libraries :: Python Modules"],packages=['frida'],ext_modules=[Extension('_frida', [])],cmdclass={'build_ext': FridaPrebuiltExt}
)
同样需要注意的地方是,egg文件的命名在上面的setup.py已经拼接成frida-12.8.0-py3.8-linux-x86_64.egg
所以需要将文件名修改成这个。
最后执行:python setup.py install
另外两个objection
和frida-tools
能够正常pip安装,所以随后这套环境成功搭建!