新增proot和android识别
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run

This commit is contained in:
gfdgd xi 2024-07-20 09:37:26 +08:00
parent 30d4986214
commit 3146467477

View File

@ -0,0 +1,27 @@
#!/bin/bash
import os
import sys
import binascii
def Replace(fileName: str):
with open(f"{fileName}", "rb") as file:
data = file.read()
data = data.replace(bytes("/lib64/ld-linux-x86-64.so.2".encode()),
bytes("/data/data/com.termux/gfdgd".encode())) # 替换与被替换需要保证字符数量相同
with open(f"{fileName}", "wb") as file:
file.write(data)
longest = 0
def Find(path: str):
global longest
for i in os.listdir(path):
newpath = f"{path}/{i}"
if (len(newpath) > longest):
longest = len(newpath)
print(f"\r{newpath}" + " " * (longest - len(newpath)), end="")
if (os.path.isfile(newpath)):
Replace(newpath)
if (os.path.isdir(newpath)):
Find(newpath)
Find(sys.argv[1])