当前位置:   article > 正文

Frida-dexdump使用

Frida-dexdump使用

配置Pc端

pip install frida-dexdump  #下载frida-dexdump 这个会下载最新版 请注意查看版本

配置客户端

  1. frida GitHub地址:https://github.com/frida/frida/releases #注意要下server版本的
  2. adb push frida-server /data/local/tmp #将文件push到虚拟机
  3. adb shell
  4. cd /data/local/tmp
  5. chmod 777 frida-server #权限
  6. ./frida-server #启动服务

开始dump操作

frida-dexdump -U -f 包名

对dex文件操作

  1. #这个用于对dex文件进行合并并反编译 更改三个参数就行 dex目录 输出目录 jadx的目录
  2. import subprocess
  3. import os
  4. def merge_dex_files(dex_directory, output_dir, jadx_path):
  5. # Check if the dex_directory exists
  6. if not os.path.exists(dex_directory):
  7. print(f"The directory {dex_directory} does not exist.")
  8. return
  9. # Create output directory if it doesn't exist
  10. if not os.path.exists(output_dir):
  11. os.makedirs(output_dir)
  12. # List all files in the given directory
  13. dex_files = [os.path.join(dex_directory, f) for f in os.listdir(dex_directory) if f.endswith('.dex')]
  14. if not dex_files:
  15. print("No DEX files found in the directory.")
  16. return
  17. # Base jadx command
  18. jadx_command = [jadx_path, '-d', output_dir]
  19. # Add all DEX files to the command
  20. jadx_command.extend(dex_files)
  21. try:
  22. print(f"Running command: {' '.join(jadx_command)}")
  23. # Run the command
  24. result = subprocess.run(jadx_command, capture_output=True, text=True)
  25. # Print stdout and stderr
  26. print("Output:\n", result.stdout)
  27. print("Error Output:\n", result.stderr)
  28. # Check for errors
  29. result.check_returncode()
  30. print("DEX files successfully merged and decompiled into:", output_dir)
  31. except subprocess.CalledProcessError as e:
  32. print("Error during merging and decompiling DEX files:", e)
  33. print("Output:", e.output)
  34. print("Error Output:", e.stderr)
  35. if __name__ == "__main__":
  36. # Directory containing DEX files
  37. dex_directory = "/xxx/com.google.android.apps.maps-server_recovery_process_scheduled/" # Replace with the path to your DEX files directory
  38. # Output directory for the merged and decompiled code
  39. output_dir = "xxx/Dex-aijiami"
  40. # Path to jadx executable
  41. jadx_path = "xxx/jadx-master/build/jadx/bin/jadx"
  42. # Merge and decompile the DEX files
  43. merge_dex_files(dex_directory, output_dir, jadx_path)

会有很多的Dex文件 但大多都是很小很小的壳 查找一个比较大的文件 然后继续使用jadx进行反编译就可以查看大多数java代码 如果只想看目录可以使用Android studio

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号