国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

Switch平臺(tái)的Arcaea打包與解包(Python)

2023-03-16 22:11 作者:Zaid_J  | 我要投稿


解包(Unpack)


#Arcaea Switch unpacker

#將py文件,arc.pack,arc.json放于同一文件夾中,運(yùn)行py文件即可生成pack文件夾。

#有bug務(wù)必聯(lián)系我!

import json

import os


JSON=open("arc.json")

JSON=json.load(JSON)

JSON=JSON["Groups"]

PACK=open("arc.pack","rb")


for group in JSON:

? ? if not os.path.exists("pack/"+group["Name"]):

? ? ? ? os.makedirs("pack/"+group["Name"])


? ? for entry in group["OrderedEntries"]:

? ? ? ? offset = entry["Offset"]

? ? ? ? length = entry["Length"]

? ? ? ? originalfilename = entry["OriginalFilename"]

? ? ? ? PACK.seek(offset,0)

? ? ? ? data=PACK.read(length)

? ? ? ? PATH="pack/"+group["Name"]+"/"+originalfilename

? ? ? ? if not os.path.exists(os.path.dirname(PATH)):

? ? ? ? ? ? os.makedirs(os.path.dirname(PATH))

? ? ? ? output=open(PATH,"wb")

? ? ? ? output.write(data)

? ? ? ? print(PATH)


打包(Pack)

#Arcaea Switch packer

#將py文件與pack文件夾放于同一文件夾中,運(yùn)行py文件即可生成arc.pack和arc.json。

#有bug務(wù)必聯(lián)系我!

import os

import json

GLOBAL_OFFSET=0

Groups=[]

Dir=["startup","audio_init","buttons","mainmenu","topbar","base_shutters","jackets_large","jackets_small","packs","charts","songselect_bgs","character_sprites","not_large_png","not_large_jpg","not_audio_or_images","audio_wav","not_audio","Fallback"]


def hex_align(data,GLOBAL_OFFSET):

? ? data = bytearray(data)

? ? while len(data) % 16 != 0:

? ? ? ? data.append(0)

? ? ? ? GLOBAL_OFFSET+=1

? ? data = bytes(data)

? ? return data,GLOBAL_OFFSET


output_pack = open("arc.pack","wb+")


for i in Dir:

? ? if i not in os.listdir("pack"):

? ? ? ? os.mkdir("pack/"+i)


for d in os.listdir("pack"):

? ? group={}

? ? OrderedEntries = []

? ? group["Name"] = d

? ? group["Offset"] = GLOBAL_OFFSET


? ? for root,dirs,files in os.walk("pack/"+d):

? ? ? ? for f in files:

? ? ? ? ? ?entry={}

? ? ? ? ? ?PATH=os.path.join(root,f)

? ? ? ? ? ?file = open(PATH,"rb")

? ? ? ? ? ?data = file.read()

? ? ? ? ? ?entry["OriginalFilename"] = PATH.lstrip("pack/").lstrip(d).lstrip("/")

? ? ? ? ? ?entry["Offset"] = GLOBAL_OFFSET

? ? ? ? ? ?entry["Length"] = len(data)

? ? ? ? ? ?GLOBAL_OFFSET+=len(data)

? ? ? ? ? ?OrderedEntries.append(entry)

? ? ? ? ? ?data,GLOBAL_OFFSET=hex_align(data,GLOBAL_OFFSET)

? ? ? ? ? ?output_pack.write(data)

? ? ? ? ? ?print(PATH)


? ? group["Length"]=GLOBAL_OFFSET-group["Offset"]

? ? group["OrderedEntries"]=OrderedEntries

? ? Groups.append(group)


JSON={}

JSON["Groups"]=Groups

with open("arc.json","w",newline="\n") as output_json:

? ? output_json.write(json.dumps(JSON,indent=1))

? ? print("COMPLETE!")



Switch平臺(tái)的Arcaea打包與解包(Python)的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
固镇县| 阜康市| 长乐市| 敖汉旗| 文安县| 淳安县| 喀喇沁旗| 和静县| 任丘市| 麻栗坡县| 荔浦县| 沁阳市| 兴和县| 梁河县| 唐山市| 株洲县| 平遥县| 合山市| 汉中市| 许昌县| 彭阳县| 西丰县| 黔江区| 杭州市| 衢州市| 交口县| 临武县| 扎赉特旗| 时尚| 军事| 金昌市| 阳山县| 喀什市| 墨脱县| 南木林县| 九江市| 忻城县| 盐津县| 柳江县| 海安县| 南涧|