disunity
disunity copied to clipboard
but how to pack the file again?
this unpack works great, but how to pack the file again?
I think you're referring to asset bundle repacking, right? That should be relatively easy to implement. However, there still are a few unknown fields in the file format that I need to figure out, just to make sure the resulting files won't end up corrupt. I think it will be possible in relatively near future.
Just wanted to second my interest in repacking functionality.
Thanks for this excellent tool!
Repacking would be incredibly, incredibly useful. Is there any update on that? I'd be willing to donate if need be :)
Im also interested in repacking assets.
I'd be interested too.
I think I can start working on that, soon. However, I have some concerns about that feature and wonder what the repacking would be used for? I hope it's just for harmless mods, but I assume it could also be used to embed malware or to cheat in multiplayer games.
Game modding is an example. If I had that feature I could finish a pet project for endless space http://forums.amplitude-studios.com/showthread.php?20961-ES-Eve-Online
I'm mainly interested in doing localizations, which is impossible to achieve without being able to repack the assets, so I'd definitely be interested in this, too.
That would be phenomenal. Though I understand your concern. Personally, I've wanted this for so long to be able to play with and adjust aesthetic sounds and images in some of the games I play (some of the sounds are particularly annoying). Absolutely no malicious intent, and all client side.
I suspect that if someone really wanted to cheat online, they'd find other ways.
On Apr 6, 2014, at 5:43 AM, ata4 [email protected] wrote:
I think I can start working on that, soon. However, I have some concerns about that feature and wonder what the repacking would be used for? I hope it's just for harmless mods, but I assume it could also be used to embed malware or to cheat in multiplayer games.
— Reply to this email directly or view it on GitHub.
I'm trying to protect my game by obfuscating dll's in webbuild your tool helped me a lot with unpacking,thank you! but is there a way to pack my files back to build? unity 3d obfucator isnt a solution
If you're using 0.3.1, you can use the command "bundle-inject". The extracted folder needs to be in the same folder as the .unity3d for it to work. And it's also not guaranteed to work, so better test it extensively after repacking.
Can you help me to import *.tga file to assets file as TEX file ??? Thanks
Has anyone gotten bundle-inject to work?
I've tried many different methods (extract, extract-raw), but if I'm even able to get it to inject anything, when I try to re-extract to test if it worked properly, I get an error about invalid arguments. Most of the time I get an error on the inject step itself, with IOExceptions. Any idea why this might be the case? The folder and .unity3d file are in the same place.
Can you post the full exception message, please?
tried now it works JUST FINE! A LOT OF THANKS TO YOU, ata4!!!
here is my command line, if anyone has problems:
C:\Users\greag_000\Desktop\work\disunity-master\disunity>disunity.bat bundle-ext ract testSecurity.unity3d [info] DisUnity v0.3.1 [info] Processing testSecurity.unity3d [info] Uncompressing asset bundle, this may take a while [info] Extracting Assembly-CSharp.dll [info] Extracting sharedassets0.assets [info] Extracting resources/unity_builtin_extra [info] Extracting mainData [info] Extracting Assembly-CSharp.dll.mdb
C:\Users\greag_000\Desktop\work\disunity-master\disunity>disunity.bat bundle-inj ect testSecurity.unity3d [info] DisUnity v0.3.1 [info] Processing testSecurity.unity3d [info] Uncompressing asset bundle, this may take a while [info] Injecting Assembly-CSharp.dll [info] Injecting sharedassets0.assets [info] Injecting resources/unity_builtin_extra [info] Injecting mainData [info] Injecting Assembly-CSharp.dll.mdb [info] Compressing asset bundle, this may take a while
Here's my output:
Windows:
$ ../../disunity_v0.3.1/disunity.bat extract sounds0.unity3d [info] DisUnity v0.3.1 [info] Processing sounds0.unity3d [info] Processing sounds0.unity3d:CAB-sounds0 [info] Writing AudioClip ....
$ ../../disunity_v0.3.1/disunity.bat bundle-inject sounds0.unity3d [info] DisUnity v0.3.1 [info] Processing sounds0.unity3d [info] Injecting CAB-sounds0 [error] DisUnityProcessor: Can't process sounds0.unity3d, caused by java.nio.file.AccessDeniedException: sounds0\CAB-sounds0 at sun.nio.fs.WindowsException.translateToIOException(Unknown Source) at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(Unknown Source) at java.nio.channels.FileChannel.open(Unknown Source) at java.nio.channels.FileChannel.open(Unknown Source) at info.ata4.io.buffer.ByteBufferUtils.openReadOnly(ByteBufferUtils.java:155) at info.ata4.io.buffer.ByteBufferUtils.openReadOnly(ByteBufferUtils.java:170) at info.ata4.unity.cli.action.BundleInjectAction.processAssetBundle(BundleInjectAction.java:63) at info.ata4.unity.cli.DisUnityProcessor.processAssetBundle(DisUnityProcessor.java:162) at info.ata4.unity.cli.DisUnityProcessor.run(DisUnityProcessor.java:116) at info.ata4.unity.cli.DisUnityCli.run(DisUnityCli.java:119) at info.ata4.unity.cli.DisUnityCli.main(DisUnityCli.java:55)
If I remove the CAB folder, and take everything inside it and put it into the immediate folder:
$ mv CAB-sounds0/* . $ rm -rf CAB-sounds0/ $ ../../disunity_v0.3.1/disunity.bat bundle-inject sounds0.unity3d [info] DisUnity v0.3.1 [info] Processing sounds0.unity3d
$ rm -rf sounds0 $ ../../disunity_v0.3.1/disunity.bat extract sounds0.unity3d [info] DisUnity v0.3.1 [info] Processing sounds0.unity3d [error] DisUnityProcessor: Can't process sounds0.unity3d, caused by java.lang.IllegalArgumentException at java.nio.Buffer.limit(Unknown Source) at info.ata4.io.buffer.ByteBufferUtils.getSlice(ByteBufferUtils.java:230) at info.ata4.unity.asset.bundle.AssetBundle.load(AssetBundle.java:96) at info.ata4.io.file.FileHandler.open(FileHandler.java:28) at info.ata4.unity.cli.DisUnityProcessor.processAssetBundle(DisUnityProcessor.java:157) at info.ata4.unity.cli.DisUnityProcessor.run(DisUnityProcessor.java:116) at info.ata4.unity.cli.DisUnityCli.run(DisUnityCli.java:119) at info.ata4.unity.cli.DisUnityCli.main(DisUnityCli.java:55)
And on Linux it's the same thing. If I try to use "extract-raw" to make sure I get everything, I get this:
$ disunity.sh bundle-inject sounds0.unity3d [info] DisUnity v0.3.1 [info] Processing sounds0.unity3d [info] Injecting CAB-sounds0 [error] DisUnityProcessor: Can't process sounds0.unity3d, caused by java.io.IOException: No such device at sun.nio.ch.FileChannelImpl.map0(Native Method) at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:874) at info.ata4.io.buffer.ByteBufferUtils.openReadOnly(ByteBufferUtils.java:156) at info.ata4.io.buffer.ByteBufferUtils.openReadOnly(ByteBufferUtils.java:170) at info.ata4.unity.cli.action.BundleInjectAction.processAssetBundle(BundleInjectAction.java:63) at info.ata4.unity.cli.DisUnityProcessor.processAssetBundle(DisUnityProcessor.java:162) at info.ata4.unity.cli.DisUnityProcessor.run(DisUnityProcessor.java:116) at info.ata4.unity.cli.DisUnityCli.run(DisUnityCli.java:119) at info.ata4.unity.cli.DisUnityCli.main(DisUnityCli.java:55)
You need to use bundle-extract
first, not extract
. Extracted asset content can't be injected yet, you need to edit the .assets file with the Unity editor.
Sorry, a bit confused. When I do that, I get another file of the same exact size, entitled CAB-(name of unity file). I see that that is an assets file ([warning] DisUnityProcessor: Command "bundle-extract" doesn't support asset files, skipping CAB-(file)).
I don't get a .assets file in particular though. Running extract on that extracted bundle nets me the AudioClip files, but are you saying I can't edit those?
The CAB file is the actual .assets file, it just doesn't have the extension. You seem to have asset bundles for a standalone game, they're uncompressed and contain just that one file, that's why the .unity3d and CAB files have nearly the same size.
However, the CAB can't be edited with the Unity editor right now, because it doesn't contain the required structure metadata.
So even though I can obtain the underlying files from that .assets file, I can't use any injection methods?
No, that requires advanced file editing support for asset files. The extracted files can't be put back into the asset file like in zip files, for example. Asset bundles are more like zip files, that's why I recently added the inject command.
There is an asset file repacker available somewhere, will post it later because I'm currently on mobile, but unfortunately it's closed-source and it only allows to replace files that have the same file size as the original one, at least for me, which makes it essentially useless for localization work :/
Am 04.06.2014 um 13:25 schrieb "ata4" [email protected]:
No, that requires advanced file editing support for asset files.
Reply to this email directly or view it on GitHub.
Hmm, alright. That's a shame, but thanks guys.
So here's the tool I was talking about, if anyone was interested: http://forum.xentax.com/viewtopic.php?f=10&t=10085
I think the best would be an ASCII interchange format, maybe even the YAML format available in Unity Pro. Then you could switch between binary and human-readable formats, which opens the possibility for third-party editors. Even if it's just a simple text editor.
First of all, thank you a lot for your effort! I am trying to manipulate some specific, already existing files in a file (just for some visual modification in the client side) and i dont succed at repacking. Is it currently possible to do that?
Migano, show your output. It is possible, to extract bundle, modify specific files and inject back to bundle.
I cannot produce output, since i dont know the syntax to inject correctly. My readme file does not contain information about any commands related to injecting. I have the .unity3d file and a folder containing the original content from the unity3d file (created with "extract") and a folder with the original content with some modifyed files. How do i proceed?
Running:
- disunity extract file.unity3d (works fine)
- disunity bundle-inject file.unity3d results in:
DisUnityProcessor: Cant process file.unity3d [...] caused by java.nio.file.AccessDeniedException: folder\CAB-folder
This appears even without changing anything at the folder\CAB-folder structure and running the console as admin.
I forgot to add the command to the readme, that's correct. I'll add it soon, but your usage looks correct to me. Can you please provide a full stacktrace?