unable to repack properly
When I tried to repackage a data.unity3d file, I found that even if I didn’t modify anything, the file he packed still couldn’t run normally, and no matter whether I used L4Z or LZAM, he couldn’t make him pack the same file as before. File link: https://1drv.ms/u/s!Ah0MLfDa4AHqajuahlRKrWL2O7Q?e=h2iChD
Running with the repackaged resources gives the following error

If this is one of these packed web files, UABEA can't handle it out of the box. We already had this conversation in a different issue, but some web files start with the standard bundle header so they look like just a bundle, but in reality there are many other files also packed after it as well. Whenever UABEA saves, it strips the rest of the data since it's not part of the bundle. I don't have an answer for how to handle it but I'm sure there's a separate listing file that shows which part of the packed file extracts to other files.
This is indeed one of the web package files. It comes from the ba2.data file. Is there any other way to modify it?
The last time this was asked was issue #223. I don't have a solution right now.
Are you still interested in solving this, I can provide more details
I have successfully modified global-metadata.dat and encapsulated it back to achieve string replacement
Did you do that by overwriting the original file in a hex editor? Or something else? What would be best is to find a way to automate how to extract and repack the files.
Almost, I achieved it by replacing the binary
https://1drv.ms/u/s!Ah0MLfDa4AHqebRTCXYTIhzbE2o?e=NfRTEW This is the complete game file, which can be run through Nginx
The millennium_quest\static_prod2\Build\ba2.data.br file is the data file of the game, don't care about the br suffix, it has been decompressed
The millennium_quest\static_prod2\Build\ba2.wasm.br file is the WASM of the game. It passed the Il2CppDumper test, and its function should be similar to libil2cpp.so
The ba2.data.br file header contains the file type and packaged file path
The global-metadata.dat contained in the ba2.data.br file can be replaced by binary replacement, and it can run normally after testing
A simple binary replacement script
with open('./ba2.data', 'rb') as f:
data = f.read()
with open('./global-metadata.dat', 'rb') as f:
metadata = f.read()
with open('./global-metadata_new.dat', 'rb') as f:
new_metadata = f.read()
# 替换二进制
new_data = data.replace(metadata, new_metadata)
with open('./ba2_new.data', 'wb') as f:
f.write(new_data)
Everything was going fine until I tried to replace the data.unity3d repackaged by UABEA and I got an error no matter if I modified the file or not