Jump to content

DerPopo

Members
  • Posts

    172
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by DerPopo

  1. Due to the lack of proper streaming support compatible with the bundle format, LZ4 is not supported for compression. I don't want to load the complete file into memory either since it would cause a RAM footprint of ~1.5x the uncompressed file size, and bundle files can be 4GB+. It was already quite an endeavour to rewrite the original LZ4 decompression routine LZ4_decompress_generic for file streaming, and the compressor is way more complex. For this reason, UABE only supports LZMA compression, which is much slower than LZ4.
  2. I think I will create a plugin for asset tables since tinkering around with asset dumps isn't very convenient. Directly editing assets in the asset view, navigating to a PPtr reference and having a modeless view dialog (similar to the container list) also are things I'd like to add. By the way, I've created a Collada exporter for the Mesh plugin along with skeleton and blend shape support for SkinnedMeshRenderer assets using the assimp library (and modifications). It works fine so far, so it might be in the next beta release. Since I've got lots of other things to do, I can't tell when that release is ready though. The game possibly uses 2D meshes, while the mesh plugin only supports 3D meshes. Thanks for the sample file! I've identified the issues with .txt and .json dump import and it will be fixed in the next release. Which problems occur when you try to mod the game? I haven't found any issues with a 2017.3.1f1 project. The other critical bug you've mentioned will be fixed in the next release.
  3. 2.2 beta 2 (Happy New Year edition) is out with Unity 2017.3 support and bug fixes! ______ Currently, the best way is to edit the json dump of the ResourceManager asset (Export Dump, select json instead of txt). Locate the ResourceManager_Dependency that belongs to the asset with (Base) by searching for the Path ID (make sure it also appears under m_Container with the same m_FileID and the correct name), and add your asset to the container by inserting a new entry to m_Dependencies with your asset's Path ID and the proper File ID. You can look up the File ID of your asset by looking at the View->Dependencies dialog. The drop down list lists absolute File IDs (matching those in the main dialog) and the matching .assets files. Then look up the relative File ID by selecting globalgamemanagers and adding 1 to the number next to the .assets file name you looked up. Use the relative File ID for the entry in ResourceManager. There was an issue with crunched texture mip maps. They should be working now. UABE generates the mip maps on its own from a single texture, always combining four pixels to one for each mip map level. Crunch uses a different filter, I haven't touched the settings for it. Not yet, but .fbx Mesh & AnimationClip export is on my TODO list. The .dat files contain the asset data in one of Unity's own asset formats. They are only useful with a hex editor or when copying some assets to another project built with the same Unity version, since they don't have any indication which file format and version they have.
  4. Have you also tried .json export/import? Anyway, could you send me a dump that causes the issue so I can reproduce it?
  5. You can export a dump of materials, and the textures belonging to it. Exporting the materials to a compatible format (which?) would require a new plugin and support for exporting the shader linked to that material (and there are three or more different shader formats across the Unity versions supported by UABE). That crash is a bug and will be fixed. It automatically assigns a Path ID for the new asset (which you can change), and you can enter the File ID from the drop-down list in View->Dependencies. Note that you can only add a single asset through File->Add, not a new .assets file. In case you are not the same person, please refer to https://github.com/DerPopo/UABE/issues/169#issuecomment-352243453 . Currently there is no option to do that in UABE. You could do it with a hex editor (though you need to resize the dependencies list, manually insert the new dependency entry, apply 4-byte alignment for the first asset, then update the metadata size, total file size and first asset offset in the file header) or through the UABE 2.1 API (which still has a bug saving .assets files that might be an issue in some cases). I'll get 2.2 API ready when I find time for it. You could select all assets in globalgamemanagers (i.e. if you open globalgamemanagers in UABE, select all assets with File ID 0) and do a raw or dump export, and find out which exported asset the search term is in. I'm not sure what you mean, since there are MonoBehaviour assets and MonoBehaviour type classes. The first one is listed in .assets files and can be edited with UABE (export dump, allow UABE to extract script information or use "Tools->Get script information" first, do whatever you want to the dump file, import dump). The second one is in assembly files which you can edit with tools like dnSpy or ILSpy+Reflexil, or compiled il2cpp on some restrictive platforms such as iOS afaik, which probably are far more complicated to edit. Could you be more specific? Which files did you open for the screenshots (if possible, upload it somewhere and send me a link via PM), which texture did you replace (name, file id, path id)? The file in the second screenshot looks like a single .assets file without dependencies, and it doesn't look like anything is missing. The first file looks like a different one.
  6. You're welcome! I do consider UABE to be a long term project. However, I don't want to make myself feel obliged to it by accepting donations since it's hard to predict how much time I will have for it in the future. Still, thank you for the offer! You can select multiple assets either by dragging with the mouse or through ctrl+click / shift+click. If you're referring to the game assemblies such as Assembly-CSharp, you can either use dnSpy or tools such as ILSpy or JustDecompile with the Reflexil plugin. If you've got a bundle file with .dlls embedded (e.g. some older web builds), you can export and import these files as well. In case you mean MonoBehaviour assets (these contain default values used to instantiate a MonoBehaviour object), you can export a dump, allow UABE to extract the script information, modify the dump and import it back.
  7. UABE 2.2 beta1 is out with support for 2017.1/2, batch import, MonoBehaviour dumps for non-bundled assets, massive performance improvements and almost 101% of the changelog. Sadly, I had to cancel lootboxes due to the Battlefront II disaster. It's actually just there to hide a space invader on the 7dtd forums.
  8. 2.2 is mostly finished and only needs a final bit of polishing and testing. I'll probably release it as beta first and remove that tag once it has proved stable and major-bug-free for long enough. It'll be by far the biggest update with 34467 changed lines of code in 40 commits (vs. 19 for UABE 2.0) so far. I don't want to imagine how long it will take to write the changelog
  9. Texture assets have a field that specifies which compression type/pixel format is used. Currently, the command line is only able to export/import .assets files from/to bundles. Enhanced command line support is planned, but it won't be in UABE 2.2. You can take a look at the API (Visual C++ 2010 Release mode only). You need to open a FILE* using fopen or similar functions, create an AssetsFile instance with AssetsReaderFromFile and (LPARAM)pFile, create an AssetsFileTable, locate the asset you want with curFileType==28 (you'll need absolutePos and curFileSize members of AssetFileInfoEx), create an AssetTypeInstance and then call ReadTextureFile and GetTextureData. For the AssetTypeInstance, you'll either need a class database (for most separate .assets files) or just the type tree inside (for most bundled .assets files). You can use the menu entry Options->Edit Type Package in UABE and export the type database you need from the classdata.tpk file. Then use the ClassDatabaseFile class to read it, locate the class you need using the classId, and then create an AssetTypeTemplateField and call FromClassDatabase with fieldIndex 0. Create an array of AssetTypeTemplateField* (or just pass a pointer to a AssetTypeTemplateField* and set baseFieldCount to 1) and use that on the AssetTypeInstance constructor. If the .assets file has a proper TypeTree (hasTypeTree == true), you can enumerate through AssetsFile::typeTree.pTypes_Unity5 or 4 (header.format >= 0x0D for 5) with fieldCount entries. If an entry exists for classId==28, you can create an AssetTypeTemplateField with From0D (pass the type pointer and fieldIndex 0) or From07 (pass a pointer to the Type_07::base field), and use it the same way as explained above to create an AssetTypeInstance. If you're reading bundles, create an Asset(s)BundleFile instance with the FILE*, locate the entry or entries you're looking for and call MakeAssetsFileReader, which you can then use to create an AssetsFile. To find out whether you have to look in assetsLists3 or bundleInf6 (different type pointers stored in the same union), just check if bundleHeader3.fileVersion is 3 or 6. Note that if TextureFile::m_StreamData.size is not 0, you probably have a reference to a streamed asset. If it's in a bundle file, the m_StreamData.path string should start with "archive:/". The first part of the archive path is a bundle file name, derived from one of the bundle entry names. The second part (separated with a "/") is the actual bundle entry name you're looking for. You can open a reader through Asset(s)BundleFile::MakeAssetsFileReader as above. Otherwise, the m_StreamData.path string is just a file name relative to the .assets file. The texture data starts at m_StreamData.offset and has m_StreamData.size bytes. Read it into a memory buffer, set TextureFile::pPictureData and _pictureDataSize accordingly and call GetTextureData. GetTextureData converts any supported texture format to RGBA32, so make sure your output buffer has m_Width*m_Height*4 bytes. Also make sure you have TexToolWrap.dll and PVRTexLib.dll next to the AssetsTools.dll if you want to decompress EAC, ETC, ETC2, PVRTC and/or ASTC textures. I'm using lodepng (lodepng_encode32 function) to create a PNG out of the uncompressed data. If you want to use Java for your main programm, I recommend creating a wrapper library in C++ that can only export textures using this procedure since it'd be quite a lot work to make a full wrapper of AssetsTools.dll. In 2.2, the file callback/LPARAM parameter pairs will be replaced by proper virtual classes.
  10. Unity 2017.1 is not supported in the current release. Both compressed meshes and 2017.1 textures will be supported in the next release. I have no idea if such a setting exists. In case it's only textures, exporting and then importing them through UABE will copy the .resS data to the asset itself. I don't know whether that's feasible in your case since there is no batch import. I might add this feature (move the resource to the asset) as a batch plugin option for UABE 2.2. Is the asset in a bundle file? If so, the error probably occurs because Unity's global string table has new entries (which, in fact, are "Gradient" and "Type*"). It should be possible to work around that by exporting the .assets file from the bundle with the type tree stripped since UABE's 5.6.0f3 database doesn't refer to the global string table. Since these file formats require the PowerVR texture library, you need TexToolWrap.dll and PVRTexLib.dll in the same path as the tool. AssetsTools automatically tries to load the library.
  11. You'll have to use AssetsFile to read this, constructed with the file reader. Then, you can construct an AssetsFileTable to get a list of assets. Could you give me the values of m_Source, m_Offset and m_Size of the AudioClip? Alternatively, you can also export a dump and upload it here or to pastebin (PM me with a link in that case).
  12. The error you're getting shouldn't happen with any supported bundle file, especially if UABE can open it. Is the file we're talking about a bundle file (AssetsBundleFileFormat) or a .assets, mainData, globalgamemangers or levelX file (AssetsFile)? If the header starts with a string (UnityRaw, UnityWeb, UnityFS, UnityArchive), it's a bundle file. Also, make sure you are using Visual C++ 2010 in Release mode since different standard libraries aren't compatible to each other. The texture format has changed slightly in 2017.1. The next UABE version will support it but I can't tell when it will be ready.
  13. Have you tried the 2.1d API? Did you copy the 2.1 files that aren't in the hotfix into the 2.1d folder? The plugins will always be listed once they're in the Plugins folder, it doesn't matter whether it can find class information. Also make sure you are only selecting assets of one type, since it tries to find plugins supporting all selected assets. Edit : You can use the type package updated for 5.6.0f3 from the main post, it'll be more compatible to 5.6.3p3 than the 5.5 one. I haven't done that much work on UABE so far this month but I've at least finalized the new plugin system and fixed some major bugs so .assets files created by UABE will be better and bundle files with large lz4 blocks will be read properly. Batch import for assets and progress indicators are the next big things to do.
  14. Only plugins (Texture2D and AudioClip) use the .resS/.resource files. Raw or dump export won't export the resource data since that's not included in the selected assets. If it doesn't show any plugins when Texture2D or AudioClip assets are selected, you probably are starting the 2.1d bugfix files without having copied the 2.1 files. The info you've quoted is outdated. UABE does support editing .assets files. Adding custom sounds is complicated but possible : https://7daystodie.com/forums/showthread.php?32600-Overriding-vanilla-files-(assets-)&p=314195&viewfull=1#post314195 You'll also need to add an entry to the ResourceManager (globalgamemanagers) or AssetBundle file table including the AudioClip asset path for the .xml. You can do that by exporting it as a dump, modifying it to add the new entry and reimporting it. It depends on the mesh. If the mesh has a skeleton, the skeleton data will be lost when exporting to .obj. You'll need to add the modified mesh to the scene (drag&drop) and build the project. The project's .assets file(s) will contain the Mesh asset which you can export to a raw file and import back to the original .assets file. I do want to add .fbx support at some point but I haven't had the time to study the FBX SDK. I can't tell when it'll be finished. I'm actively working on it but there's still a lot to be done.
  15. The next update will have lots of additions, such as extracting MonoBehaviour types, compressing bundles, generating mip maps, multithreaded DXT compression, JSON dumps, massive performance improvements for big files, compressed mesh support, support for more than 2048 files and bug fixes. I'm currently reworking the file methods and the plugin system and am planning to add batch import, progress indicators as well as some command line improvements.
  16. I don't know when the next version will be released but I'm working on it at the moment. MonoBehaviour dump support looks good so far and will make it into the next release. Recompressing bundle files will also be in the next release. Slow LZMA compression works already but I'm trying to implement LZ4 compression too. Animations and skeleton data aren't supported by UABE so far. If you have a file that makes UABE crash, could you send me one via PM (and upload it to a file sharing service such as dropbox)? The file is called AssetBundleExtractor in newer versions. I'll update the Usage.txt for that. Batch import isn't supported right now but since I'm doing some plugin system improvements, I'll take a look at it. Could you send me the .assets or bundle file you created the dump from via PM?
  17. The package file error likely is because the current directory doesn't contain the classdata.tpk file. Either use cd in cmd to go to the path of UABE or copy the .tpk file to the current directory. That error isn't the cause for the missing exports though, but it could cause issues attaching to the cmd window simply because of the delay until the message is closed. Alternatively, if it doesn't show any program output, it should be possible to redirect the output to a log file through "AssetBundleExtractor batchexport batchfile > logfile.txt". The unreadable file is no bundle file (probably game specific) or it's a compressed / encrypted one. The only thing that could reveal more to that is the game code. Sorry for the late response. I've put your repo on my watch list so you can ask me through issues. You can also ask me via forum PMs. These are one byte fields so endian swapping is not required in this case. I couldn't reproduce that issue (at least with my current internal version) but I'll definitely see if I can find files it crashes on. Thanks for the report! Probably the type information UABE chose isn't accurate for the second bundle's Unity version. Could you tell me the Unity version of that file? It can be looked up with a hex editor or simply with notepad, searching for version names such as "5.5.0f3" at the beginning of the file. Meshes are more complicated to export due to format changes and undocumented behaviour regarding offsets in the raw mesh data and the meaning of some important values. The mesh has multiple channels (from 0 to 4 : position, normal, color, uv1, uv2) that may be located in different streams (in the same data buffer but at separate offsets). Each vertex is described through these channels which have a stream index, an offset value (describing the relative position of that channel for each vertex), a format value (0 = 32bit float, 1 = 16bit float, not sure whether 2 is 32bit int) and a dimension count (amount of floats/ints). In newer Unity versions, the stream info is in another field but for older files, the stream location has to be calculated through the stride of each vertex in a stream (i.e. the amount of bytes of the stream's channels) multiplied by the amount of vertices. In some cases, the offset of the last stream is the size of the buffer minus the byte size of that stream. I don't know much of compressed meshes though. Did you download UABE 2.1 first and then copy the 2.1d files in the 2.1 folder (overwriting existing ones)? Could you send me the .unity3d file via PM (or any file with an AudioClip it fails to extract)?
  18. Batch extraction should automatically decompress the files. If it doesn't, could you give me one of the bundle files where it fails? It looks like some of the textures use ASTC_RGB, which is not supported at the moment. I'll see if I can change that but so far I can't decode it properly, even though it should be equivalent to ASTC_RGBA from what I've heard. I couldn't reproduce that crash (at least on my current development version) but I've added some buffer length checks that I should have put there before. The View Data dialog allows directly showing other assets referenced through PPtrs. If you need the dump of an asset "inside" a PPtr, you can use the m_FileID and the m_PathID fields. m_FileID is relative to the .assets file where the dumped asset is located. To find the "absolute" file ID of a PPtr (as shown in UABE's list) with a m_FileID value bigger than 0, use "View->Dependencies", select the absolute file ID of the dumped asset in the upper list and look up the name of the targeted .assets file where the number is m_FileID-1. The number left to this file name in the upper list is the absolute file ID. If the m_FileID value is 0, the PPtr refers to the same .assets file with the same absolute ID as the dumped asset. The reference is valid if m_PathID is not 0, in which case the m_PathID value is equal to the path ID as shown in the asset list. With both the absolute ID of the targeted asset and the m_PathID, you can find the referenced asset in the list (using "View->Go to asset" if necessary). The dump doesn't resolve the references because it would easily cause issues reimporting because it would either have to discard the changes to referenced assets or change assets that the user didn't select. More problems would arise when the same asset is referenced twice or when an endless recursion occurs. The only workaround to that is ignoring any additional reference to an asset already shown but that isn't a good solution either because it worsens the readability of the dump (as exporting references recursively does in either case). There currently is no C# wrapper for AssetsTools and it's not easily possible to create one without writing an intermediate wrapper library in C++ (Visual C++ 2010 in Release mode).
  19. The .tga has to be imported through the texture plugin (Plugins -> Edit). .tga is not the file format Unity uses, the plugin only converts it to/from .tga and decompresses/compresses the texture, which usually is DXT1 or DXT5 on PC.
  20. It just causes more aliasing on textures and flickering of details when moving around. Mipmapping just stores several downscaled variants of the texture that simply don't longer contain these details. Some textures have their alpha value set to 0 and some image tools either display it as a white image or discard all non-white pixels but keep the transparency. I don't know of any issues in UABE causing such behaviour.
  21. While that's certainly possible with batch extraction, it would cause issues in the file save dialog as it shouldn't create the folder before the user presses save (and it doesn't allow slashes in the file name. I'll look into it. I've just not changed that text since 1.0. If you downloaded the newest version, it's not 1.0 no matter what that text says. You can create the type database as described in the github issue and use the order as shown in the inspector. The next UABE release will be able to extract the information automatically so these steps won't be required anymore in that case (except if a special case is not handled properly).
  22. I'm working on a type information extraction tool for scripts. The tool itself works so far but I still need to integrate it into UABE and make sure it always produces "perfect" matches so the hashes are equal to Unity's. It will add many new options to modding by being able to modify all default variables stored in scripts instantiated with MonoBehaviour assets. There is a batch extraction command line option for bundles. It's described in Usage.txt. The bundles should be located in a separate folder so no other files could cause issues. If it successfully extracted the bundles, you can open them in UABE separately or all at the same time (the file dialog allows multiple selections).
  23. I've updated the type package to include a database for 5.6.0f3. You can find it on the main post. Edit : Another small bugfix, 2.1d, has been released. Probably the Unity version that game uses has a slightly different Mesh format than the class database used by UABE. Except creating a type database for each and every Unity release, there's not much I can do about it. UABE already has class databases for all semi-major Unity releases from 3.4 to 5.6, for each of which I had to manually update my type extractor tool. Stuff like object properties specific to the game is usually located in MonoBehaviour assets linked to the GameObject through the component list. These contain the values of local variables in script classes that are most often located in Assembly-CSharp.dll. Except for bundles where all the type information is already located in the .assets files, UABE can only show the common properties of all MonoBehaviours such as the MonoScript reference. Tools like ILSpy may help finding the variables and their order. If you need to look at batches of MonoBehaviours, maybe this github issue can help you. For single files, it's likely easier to view the raw asset in a hex editor. Note that all variables are aligned at 4 bytes.
  24. The textures referenced by the material can be extracted (View Data should show all references) but the shaders are stored in a binary format, at least in newer Unity versions. Theoretically it should be possible to reproduce the materials but decoding the shaders to shader code is an issue at the moment. Animations are mostly useless until the full models (including bones) can be extracted. The files have a simple protection. Each byte in the file is the original byte XORed with 0x47. I've already sent this tool to some who have asked so I can just post it here as well : https://www.dropbox.com/s/b77kryvb9p0a9kb/xor47h.zip?dl=0 Drag the protected file into xor47h.exe and it'll output the unprotected file with "-xor". If you want to batch export bundles, create a text file like '+DIR <full directory path of the bundles>' (Windows line ending), create a batch file containing 'AssetBundleExtractor batchexport <full batch file path, if it contains spaces start and end with ">' and start it. Make sure the folder only contains valid bundle files, so in case of Tarkov only the unprotected .bundle files. You can select multiple .assets files in the open dialog, sort by type, select all Meshes you want to extract and use the plugin as usual. Repeat the same thing for the textures.
×
×
  • Create New...