nesrak1 / UABEA

c# uabe for newer versions of unity
MIT License
1.04k stars 133 forks source link

Can it modify the files of mobile unity-games? #351

Closed NPCACES closed 6 days ago

NPCACES commented 1 month ago

I have a mobile game(name:compass live arena). I used the asset-studio to view the assets and found that there was an unused model texture. This texture should appear as the third color of the same model in the game.I want to modify the corresponding texture of the model. I replaced the texture and packaged it and put it in the game folder, but the reading failed.I used the asset-studio to view the original file and found that the dump window of the texture had a string of codes(string path = "archive:/CAB-f757d118dc52ceb296d5ee10590abc43/CAB-f757d118dc52ceb296d5ee10590abc43.resS") at the end.After changing the texture, the code will be changed(string path = "").After I re-add the code and package it, the texture will become the same as the original file.what should I do? {0054B8C6-ACCD-4a1b-95E6-D91C063F1BBC}

nesrak1 commented 1 month ago

I replaced the texture and packaged it and put it in the game folder, but the reading failed.

What indicated that reading failed? Studio or the game itself? Could you give more details about this?

After changing the texture, the code will be changed(string path = "").

That's intentional. The resS file is not modified so changing it back would just put the original texture back.

NPCACES commented 1 month ago

I put the modified files into the game folder replacing the original files. After entering the game, in the clothing selection interface, it kept showing "Loading". I went back and entered the selection interface again, and it automatically downloaded the original file. I don't know what caused it to be unable to be read.I suspect that the failure to read may be due to that string of code, because I tried to modify only the string of code in the original file, and after packaging it and putting it into the game, it was also unable to be read. This means that what I really need to modify may be to modify the ress file, but I don’t know how to modify it, this is where the game data is stored.Divide into several files and use two layers of hash values ​​as folder names and store them in small folders. {FC58A8C8-1645-445a-9B20-9A74FCC3BE3A} {8DB52DAF-C4C8-42d4-A27E-2A346ACA5859} {33F1DFF4-2E2F-4db4-9A2B-48A998D00E2F}

nesrak1 commented 1 month ago

This means that what I really need to modify may be to modify the ress file

That's not what that means. The resS is an option, not a requirement (common misconception). Usually, redownloading comes from a file hash not matching, not the bundle failing to load in the first place. A unity player log through adb may give more information. As to where it could be, it might be the __info file in the screenshot or from something downloaded from the internet.

NPCACES commented 1 month ago

This means that what I really need to modify may be to modify the ress file

That's not what that means. The resS is an option, not a requirement (common misconception). Usually, redownloading comes from a file hash not matching, not the bundle failing to load in the first place. A unity player log through adb may give more information. As to where it could be, it might be the __info file in the screenshot or from something downloaded from the internet.

I put the modified data directly into the folder, so there should be no hash value mismatch.This info file records an id, which will be updated every time it is downloaded or re-downloaded.Because of the file access restrictions of high Android versions, in order to facilitate the modification of test files, I used an emulator to run the game. I planned to use mobile devices for testing and log collection, but I have never learned the relevant knowledge and may not get the logs.

NPCACES commented 4 weeks ago

This means that what I really need to modify may be to modify the ress file

That's not what that means. The resS is an option, not a requirement (common misconception). Usually, redownloading comes from a file hash not matching, not the bundle failing to load in the first place. A unity player log through adb may give more information. As to where it could be, it might be the __info file in the screenshot or from something downloaded from the internet.

I got the logs and got the following error message, what should I do next? 2024/06/09 14:36:37.383 32647 459 Error Unity Error while downloading Asset Bundle: CRC Mismatch. Provided b365024f, calculated 5f3bbf3e from data. Will not load AssetBundle 'https://cps-down.hangame.co.jp/cpl_addressable/android/heroassets_assets_lyrica_131_473c7020044bf2f275ede41596fa7c0e.bundle' 2024/06/09 14:36:37.384 32647 459 Error Unity Curl error 23: Failure writing output to destination

nesrak1 commented 4 weeks ago

Error while downloading Asset Bundle: CRC Mismatch. Provided b365024f, calculated 5f3bbf3e from data.

This is what I expected the issue to be. You need to find where that CRC is stored and change it either to 5f3bbf3e or to 0 to disable the check all the way. Where that CRC is stored can depend on the developer and is up to you to find. In addressables, it's stored in catalog.json as described in the readme, but it doesn't look like your game uses addressables. It could be in __info but I don't know.

NPCACES commented 4 weeks ago

Error while downloading Asset Bundle: CRC Mismatch. Provided b365024f, calculated 5f3bbf3e from data.

This is what I expected the issue to be. You need to find where that CRC is stored and change it either to 5f3bbf3e or to 0 to disable the check all the way. Where that CRC is stored can depend on the developer and is up to you to find. In addressables, it's stored in catalog.json as described in the readme, but it doesn't look like your game uses addressables. It could be in __info but I don't know.

I found a file and it was saved here(/storage/emulated/0/Android/data/com.nhnpa.cpl.gp/files/Catalog/). I don't know if this file is what I need. I didn't find any relevant values(5f3bbf3e) ​​in it. catalog_boot.json.gzThis file will be refreshed every time you enter the game

_info file records an ID, which will be refreshed every time the game reads the corresponding _data file.

NPCACES commented 3 weeks ago

This means that what I really need to modify may be to modify the ress file

That's not what that means. The resS is an option, not a requirement (common misconception). Usually, redownloading comes from a file hash not matching, not the bundle failing to load in the first place. A unity player log through adb may give more information. As to where it could be, it might be the __info file in the screenshot or from something downloaded from the internet.

I still think this ress-file should be modified. I want to know if there is a way to modify it. Replacing the texture should have no effect.

nesrak1 commented 3 weeks ago

I found a file and it was saved here(/storage/emulated/0/Android/data/com.nhnpa.cpl.gp/files/Catalog/). I don't know if this file is what I need. I didn't find any relevant values(5f3bbf3e) ​​in it.

You won't find 5f3bbf3e in it because that's the crc of the bundle you made. b365024f is the crc of the original bundle. Your catalog_boot.json file has that crc for that file listed. If you set it to 0 (which is what UABEA's readme suggests) you can skip the crc check. WindowsTerminal_zY9TC6MRtO

_info file records an ID, which will be refreshed every time the game reads the corresponding _data file.

That's unfortunate because you need the catalog to have crcs that are set to 0 to skip the checks. Either that or you can add bytes at the end to make a crc that matches the original, but that is not in scope for UABEA and you're on your own for this approach.

I still think this ress-file should be modified.

The error is very clear on the crc being the issue of the file. As I said before, resS is an option and not a requirement.

I want to know if there is a way to modify it.

Sure, if you really want to you can copy all of the Texture2D's image data bytes and paste it at the end of the bundle's resS file (assuming there is one). Then, instead of using image data, switch to m_StreamData and set the offset and size to the offset and size of the data you pasted, then set the path to archive:/CAB-name-here/CAB-name-here.resS. You'll be disappointed to find this won't fix your issue.

Replacing the texture should have no effect.

It's not "replacing the texture" that's causing this. A crc means that any change to the file will cause the check the fail. It's as simple as that.

NPCACES commented 2 weeks ago

I found a file and it was saved here(/storage/emulated/0/Android/data/com.nhnpa.cpl.gp/files/Catalog/). I don't know if this file is what I need. I didn't find any relevant values(5f3bbf3e) ​​in it.

You won't find 5f3bbf3e in it because that's the crc of the bundle you made. b365024f is the crc of the original bundle. Your catalog_boot.json file has that crc for that file listed. If you set it to 0 (which is what UABEA's readme suggests) you can skip the crc check. WindowsTerminal_zY9TC6MRtO

_info file records an ID, which will be refreshed every time the game reads the corresponding _data file.

That's unfortunate because you need the catalog to have crcs that are set to 0 to skip the checks. Either that or you can add bytes at the end to make a crc that matches the original, but that is not in scope for UABEA and you're on your own for this approach.

I still think this ress-file should be modified.

The error is very clear on the crc being the issue of the file. As I said before, resS is an option and not a requirement.

I want to know if there is a way to modify it.

Sure, if you really want to you can copy all of the Texture2D's image data bytes and paste it at the end of the bundle's resS file (assuming there is one). Then, instead of using image data, switch to m_StreamData and set the offset and size to the offset and size of the data you pasted, then set the path to archive:/CAB-name-here/CAB-name-here.resS. You'll be disappointed to find this won't fix your issue.

Replacing the texture should have no effect.

It's not "replacing the texture" that's causing this. A crc means that any change to the file will cause the check the fail. It's as simple as that.

So there's no way around it? If so, how should I operate it? I have never learned how to modify this file(catalog_boot.json). I don’t know how to modify this file.

NPCACES commented 2 weeks ago

I found a file and it was saved here(/storage/emulated/0/Android/data/com.nhnpa.cpl.gp/files/Catalog/). I don't know if this file is what I need. I didn't find any relevant values(5f3bbf3e) ​​in it.

You won't find 5f3bbf3e in it because that's the crc of the bundle you made. b365024f is the crc of the original bundle. Your catalog_boot.json file has that crc for that file listed. If you set it to 0 (which is what UABEA's readme suggests) you can skip the crc check. WindowsTerminal_zY9TC6MRtO

I want to know how you got this report, I don't see the relevant sentence in my file(catalog_boot.json).I use this software(Notepad++) to view files.

_info file records an ID, which will be refreshed every time the game reads the corresponding _data file.

The ID recorded in _info file is a purely numeric type. which may have nothing to do with crc I have an unscrupulous request, would you be willing to edit a file(catalog_boot.json) based on this game that would make the mod effective?

nesrak1 commented 2 weeks ago

The screenshot was a modified version of addressables tools example app to print the crc, although the actual value of it isn't really relevant since you'll want to overwrite it. There is an explanation on addressables in the readme. The patchcrc command clears the crc checks.

NPCACES commented 2 weeks ago

The screenshot was a modified version of addressables tools example app to print the crc, although the actual value of it isn't really relevant since you'll want to overwrite it. There is an explanation on addressables in the readme. The patchcrc command clears the crc checks.

Do I need to modify the files in game-apk? A7801FAB29A98D75CD9895235059FCBA

NPCACES commented 2 weeks ago

The screenshot was a modified version of addressables tools example app to print the crc, although the actual value of it isn't really relevant since you'll want to overwrite it. There is an explanation on addressables in the readme. The patchcrc command clears the crc checks.

Do I need to modify the files in game-apk? A7801FAB29A98D75CD9895235059FCBA

It doesn’t seem like this file。I used your tool to clear the check catalog_boot.json ,but it didn't seem to do anything, the modified _data file still didn't load, I honestly don't know what to do anymore, modding this game is too difficult for me