Jump to content

DerPopo

Members
  • Posts

    172
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by DerPopo

  1. The .assets.resS files contain raw data referenced by the .assets file (i.e. it has no file format and is just data of any kind glued into one file). AudioClip and Texture2D assets with the data stored in .resS files can be extracted. Use View Data on Sprites to see which textures are referenced, and you can export the texture. AnimationClip files can't be exported right now (Meshes are exported without bones atm, so animations wouldn't work on them)
  2. Release 2.0 is out! It's the largest release so far with 14118 line insertions and 1642 deletions, resulting in 31 lines in the changelog (it's actually more than that). The main features are a mod installer creator along with the option to restore a previous session (by loading an installer package), direct editing of assets in bundles, better support for older Unity versions + 5.4, lots of bugfixes and improvements. See the changelog on the main post for more details. I did extensive bug hunting but there likely are still some things I've missed. Feel free to suggest improvements or to ask questions.
  3. @sam ata Take a look at the TextureFileFormat.h. You have to call ReadTextureFile on an empty TextureFile structure with the value field to the texture and call GetTextureData on it (it'll write the RGBA32 data with width*height*4 bytes to pOutBuf). To write the raw data to .png, you can use a library such as lodepng or stb_image. __ Release 2.0 is almost ready, I'm doing some final bughunting and improvements.
  4. Read the ClassDatabaseFile (I think there aren't many changes for MovieTextures, so it's only about Unity4/5), search the MovieTexture type in it using the type id (0x98), create an AssetTypeTemplateField (AssetTypeClass.h) and call FromClassDatabase with fieldIndex 0. To heavily reduce the memory and computing overhead, I recommend to change the m_MovieData array type to TypelessData : for (DWORD i = 0; i < templateBase.childrenCount; i++) { if (!strcmp(templateBase.children[i].name, "m_MovieData") && templateBase.children[i].childrenCount > 0) { templateBase.children[i].children[0].type = "TypelessData"; break; } } You'll need to store a pointer to the template field in a variable and create an AssetTypeInstance with baseFieldCount = 1, ppBaseFields = &<template field pointer>, reader/readerPar = <your asset reader/readerPar>, filePos = <in .assets file the absolute position of the asset>. Then, call GetBaseField() and if it doesn't return NULL, continue. In this code sample, the returned value is stored in pBase : AssetTypeValueField *pNameField = pBase->Get("m_Name"); AssetTypeValueField *pAudioClipFileIDField = pBase->Get("m_AudioClip")->Get("m_FileID"); AssetTypeValueField *pAudioClipPathIDField = pBase->Get("m_AudioClip")->Get("m_PathID"); AssetTypeValueField *pMovieDataField = pBase->Get("m_MovieData")->Get(0UL); if (!pNameField->IsDummy() && !pAudioClipFileIDField->IsDummy() && !pAudioClipPathIDField->IsDummy() && !pMovieDataField->IsDummy()) { /*do what you want with the data*/ If you changed the type to TypelessData, pMovieDataField->GetValue()->AsByteArray() will return a struct pointer with size and data variables, otherwise you'd have to get the array size via pMovieDataField->GetValue()->AsArray()->size and call (BYTE)pMovieDataField->Get(i)->GetValue()->AsInt() for each byte to generate a buffer. This data is a .ogv file which many players support. Usually, you don't have to care for the audio data. In all cases I've seen, the audio data is inside the .ogv file. 7dtd doesn't make use of MovieTextures (afaik) but it should be usable inside a mod, also with SDX. MovieTextures contain video and audio data and are sometimes used for cutscenes in other Unity games, I'm not sure whether they also are used ingame.
  5. I'm trying to get it released next week. I have finished the TerrainData plugin and done some other important changes. Now the remaining things to do (except bugfixes) are the option to merge installer files (done) and to add custom icons (done), the option to use installer files like "savegames" for UABE (done), mprovements to the search as stated here (done), support for split .resource files (done), opening multiple .assets at the same time (done), exporting multiple dumps/raw files (done) and maybe an indicator for changed assets in the list (done). m_PropertiesHash is inside MonoScript, which only basically a reference to a script (e.g. in Assembly-CSharp.dll). The data you are looking for is inside MonoBehaviours, which are different for each script. If you open the assembly in a decompiler (such as Telerik JustDecompile), you can find out what data specific to the script is stored after the data you can already see. If you want to view the data in UABE, see https://github.com/DerPopo/UABE/issues/63 .
  6. You'll have to wait for the next release, which will be able to export the height map from terrain data.
  7. Here's a sample code to determine whether a bundle file is compressed : bool is6_compressed = false; if (bundleFile.bundleHeader3.fileVersion == 6) { is6_compressed = (bundleFile.bundleHeader6.flags & 0x3F) != 0; for (DWORD i = 0; i < bundleFile.listCount; i++) { for (DWORD k = 0; k < bundleFile.bundleInf6[i].blockCount; k++) { if ((bundleFile.bundleInf6[i].blockInf[k].flags & 0x3F) != 0) { is6_compressed = true; break; } } } } if (((bundleFile.bundleHeader3.fileVersion == 3) && !strcmp(bundleFile.bundleHeader3.signature, "UnityWeb")) || is6_compressed)) { //compressed, needs decompression first } The next release (2.0) isn't completely finished yet. The mod installer stuff is almost finished except importing other installer files and also opening a previous session. There also are some bugs to fix.
  8. The next version will use another method that doesn't play the sound to a .wav, so the frequency won't be changed and there won't be a 4096 samples granularity (making the files longer).
  9. It's always 1, except if an error occured. It's not actually of any use and it'll likely be removed soon.
  10. Fixed it. It was because of a Unity5-only buffer that often has a zero-length that was still allocated but not freed because of the zero-length. The assets info window is opened when you open an .assets file or if you open a bundle and press Info. If you haven't opened a bundle, the initial window won't show an opened file. The Mesh converter doesn't support all Unity versions yet. Could you tell me which one it is in your case? You can find it in an output_log.txt (given that you opened the game before) or in any of the .assets files with a hex editor. An example version is "5.0.1f1".
  11. So far, I haven't written a doumentation. I have some explanations though : here, here and https://7daystodie.com/forums/showthread.php?p=459961#post459961. UABE is developed in C++, Visual Studio 2010 (compiled in Release mode) to be more precise. To process every asset type except MonoBehaviours, you need to create an AssetTypeInstance as mentioned in the third example. The single type database files (one per Unity version) contain their full version and a version mask. The full version just simplifies identifying the versions when it's required. It could be removed but it's only 8 bytes anyway. TypeTree::version is a field stored in the .assets files. I don't use it since there haven't been multiple versions in any of the .assets file versions but always max. 1 unique version per AssetsFileHeader::format.
  12. Looks like it isn't in the headers yet. Export a class database file from the package using UABE and open it through ClassDatabaseFile::Read.
  13. UABE has a ClassDatabasePackage file (classdata.tpk) that consists of several ClassDatabaseFiles, each for one Unity version. You could either create a ClassDatabasePackage instance, load the .tpk file and pick one of the header.fileCount ClassDatabaseFiles or directly open a database file (you can export them from within UABE). Select the ClassDatabaseType you need, create an AssetTypeTemplateField (AssetTypeClass.h) and call FromClassDatabase with fieldIndex 0. With the template base field, you can create an AssetTypeInstance with baseFieldCount = 1, ppBaseFields as a 1-item array of template fields and the reader to the asset. With it, you can recursively go through the fields and their values. In case you want the deserialized asset data of e.g. an AudioClip with a byte array, change the template field type of this array (the child of m_AudioData usually named "array") to "TypelessData" so it doesn't create a value field plus value struct for every single byte. In case the .assets or the bundle file contains the type data, you can also use AssetTypeTemplateField::From07 or From0D. Most often, compressed Unity 5.3+ bundle files (except for web builds) only have a compressed file table, which is small anyway. UABE currently can't directly read compressed files and has to work with a decompressed one. Therefore, it won't open files that aren't decompressed. The decompressed and modified files can also be used within the game (except if a bug breaks them). Take a look at the InputManager in the asset list. Export a dump of it, change the sensitivity, import the changed dump and save the .assets file. I didn't test it myself though.
  14. Reimport the .assets file to the unpacked bundle file and save the modified bundle file. The bundle file basically contains one/multiple .assets file/s and in some cases additional data. If a Unity game reads a bundle file, it won't accept an .assets file. For the first thing, you need to call AssetsBundleFile::MakeAssetsFileReader. If bundleHeader3.fileVersion is 3, you need to specify one entry of count entries in assetsLists3->ppEntries. If bundleHeader3.fileVersion is 6, you need to specify the reference to one entry of directoryCount entries in bundleInf6->dirInf. MakeAssetsFileReader returns an AssetsFileReader function. Pass the original reader (usually AssetsReaderFromFile), the pointer to a reader parameter (usually (LPARAM)pFile) that will be updated on success and the entry pointer as I mentioned above. The entry also contains the file size, which you'll probably need. You can use the reader and the reader parameter to read the data to a memory buffer and write this data to a file. The data you want starts at position 0. For the second thing, you can create an AssetsFileTable. The constructor takes a pointer to the AssetsFile and a bool whether names should be read from every single asset (it does lots of random access so it's much slower if true). Then either call one of the getAssetInfo functions or manually go through the pAssetFileInfo list (assetFileInfoCount entries). The AssetFileInfoEx structure contains the absolute position (in the reader you passed to the AssetsFile) and the size (curFileSize). The API can't directly read compressed bundles. If it's compressed, it only reads the header and you have to use the Unpack function for the rest.
  15. Thanks! I will look into improving the search. As for the window, I might make it save the previous size so it's easier to keep the "ideal" size. It looks like either the file wasn't opened properly OR the compiler versions don't match (i.e. you need VC++ 2010 and compile in Release mode so functions taking standard C/C++ library parameters such as FILE or std::vector work properly). _____ For the next release, I am working on a mod creator similar to the one in grim's UAE that allows to capture modifications to .assets and to bundles and export them to a standalone .exe installer. Because I had to do some background work for it, .assets in bundles also can be modified directly without exporting them first. I'll also improve Unity 4.x support by adding more asset type information (4.0.0f7 and 4.7.2f1 is done so far) and making the asset type plugins compatible to it.
  16. At least not on purpose. I'll look if it works properly (or not).
  17. The textures are in the BlockTextureAtlases and TerrainTextures bundles. As always, create a backup of the original file. Extract the .assets file out of the bundle (the .assets file table first has to be decompressed), open it, select the texture to change, press Plugins and select Edit, Import, OK, and press File->Save in the asset list and save to another file name. Then open the decompressed bundle, import the new .assets file and save the bundle file which can then be used for the game. I'll probably improve this so the .assets file can also be changed in the bundle without extracting it first. Maybe I'll also remove the need to save a decompressed copy first. Putting a * before and after the name includes all file names containing the query. I might look into porting the window code from Win32 to X11, which basically is the platform-dependant part of the code (and maybe some differences between VC++ and g++). The tool also works good with Wine but native support would still be better of course.
  18. It allows you to develop tools which read/write .assets and bundle files using AssetsTools.dll . It doesn't contain UABE itself.
  19. Direct mesh importing is not supported yet but you could build a scene with Unity that contains your meshes (the Unity versions should match), export the meshes raw with UABE and import the raw files to 7dtd's assets (by creating a new asset for each asset to import). If you import GameObjects, the references to the dependencies must be patched (export dump, correct the PPtrs with an editor, import dump). Creating a dependency to .assets file with the custom meshes would be easier. I'll look into creating a dependency editor to greatly simplify these things.
  20. Hold ctrl or shift and click another item, now multiple should be selected.
  21. The Unity Editor doesn't open .assets files or bundles. UABE can do both (despite its name). Press the Info button or open the exported .assets file to view the content. There are some plugins for different asset types such as textures and text. The AudioClip plugin supports exporting AudioClips to a .wav file. Changing a sound is already possible but very cumbersome (through the correct FMOD API or through the Unity Editor, then manually changing the file reference). I will look into adding an import option though.
  22. 1. I might look into improving the mesh plugin to support bones, using another file format (like fbx) instead of obj. Also, the mesh plugin mirrors the data, simply because it is (or was) stored mirrored. It might have changed in the meantime. 2. UABE doesn't compare the names of files in the asset list. If the files have their m_Name field different than what is displayed in the list, it likely is due to the ResourceManager asset (which contains a name table). If only the names shown in the list differ with the exported names, then it's because it adds numbers at the end to not overwrite other exported files because they have the same name.
  23. Unity's Mesh file format is not related to .obj files, which is why importing the raw data doesn't work. There is no support for importing meshes but you could use a matching Unity editor, create a new project with that .obj file placed in the scene, generate that project and export the mesh as raw data and import the raw data into the other game. Generally, import raw data should not be used with any data extracted by a plugin. If there is a plugin that supports importing, it should be used instead.
  24. V1.9 has been released. There now is an improved 5.3 bundle support, a new type database bundle file format, support for many new texture file formats and more. MSVC++ 2013 redistributable is required for the support of mobile compressed textures. The program will still work as usual if it isn't installed but will show a warning message (instead of "msvcr120.dll is missing", which would suggest to go to some untrustworthy dll download site).
  25. V1.8.1 has been released. It supports Unity 5.3 bundles and adds compression options for the class databases (LZMA is used by default). Unity 5.3 seems to have renamed mainData by globalgamemanagers (the file without an ending) in case you wonder where mainData is.
×
×
  • Create New...