我最近不得不制作一个让电路运行得更快的生存工艺 2 mod 的版本
我通过堆栈溢出找到了这个脚本来解压一个单声道捆绑应用程序
我已经修改了.dll,但是我需要重新打包,而且我对pyelftools一无所知
脚本:
from elftools.elf.elffile import ELFFile
from zipfile import ZipFile
from cStringIO import StringIO
import gzip, string
data = open('libmonodroid_bundle_app.so').read()
f = StringIO(data)
elffile = ELFFile(f)
section = elffile.get_section_by_name('.dynsym')
for symbol in section.iter_symbols():
if symbol['st_shndx'] != 'SHN_UNDEF' and symbol.name.startswith('assembly_data_'):
print symbol.name
dll_data = data[symbol['st_value']:symbol['st_value']+symbol['st_size']]
dll_data = gzip.GzipFile(fileobj=StringIO(dll_data)).read()
outfile = open(symbol.name[14:].replace('_dll', '.dll'), 'w+'); print symbol.name[14:].replace('_dll', '.dll')
outfile.write(dll_data)
outfile.close()