Jump to content

DerPopo

Members
  • Posts

    172
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by DerPopo

  1. Why I can't open .assets.resS files?

    When I try to open this it says "invalid file or unknown version".

    And how I can extract AnimationClip, AnimatorControler and Sprite?

    When I click on Plugins, there's nothing that I can use to extract...

     

    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. Is there any way to export MovieTexture via API?

     

    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.

     

    wait, what are you talking about? it is about 7dtd ? what is it MovieTexture ?

    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. Oh okay, and when will this version be released and is their any program that currently has this feature that I can export the terrain, because I need to do this asap thanks. =)

     

    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).

     

    Thanks for the tool, it's really great!

     

    There's one feature I think we would all like though: reading the public variables from induvidual components on prefabs.

    Right now, all I'm getting is the m_PropertiesHash. Is there anything we can do with that hash?

     

    Since the prefabs are not stored in a scene, the data keeping track of the values assigned to the component could be stored somewhere in the resources.asset bundle, along with everything else, right? And since we have the .dll files containing the code of the components, it seems to me (with my small understanding of how this tool actually works), that there should be a way for us to find out what the properties are.

     

    Just in case I'm stupid, is there something I can do with the m_PropertiesHash right now that I'm not seeing?

     

    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. Hello no one seems to be helping me ANYWHERE. But how can I extract a Unity Terrain with this or with any other program?

     

    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. Is there a way to change what audio frequency FMOD outputs the sounds in? It seems to be extracting everything in 48kHz regardless of the sounds' original audio frequency...

     

    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. That's a memory leak.

    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.

     

    Fantastic work on UABE!

     

    I've just started with it and I want to pull items out of a .assets file.

     

    I fire up UABE, file -> open, select 'sharedassets0.assets' and then the 'Assets Bundle Info' display comes up.

     

    I can export individual items to .dat or .txt from this window, but when I click 'ok' the window disappears and UABE thinks I don't have a file open.

     

    I've been able to export an OBJ file from a mesh but the resulting file is all messed up once opened in unity. The vertices are strewn all over the place.

     

    Am I doing something wrong or have I stumbled across a use case that UABE wasn't built for?

     

    Thanks!

     

    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".

  10. Hello DerPopo, First grats is a great work this, very helpful. I wonder if you have any documentation about how to use the API to read/write assets?.

     

    Another Question, in which lenguage are you development this tool is C++? I'm working on something similar but I want display the info directly in the Unity Editor and only I'm trying to get the Size of each component in the assetBundle.

     

    For your program I guess the first step is decompress the bundle if this is not, after look into the serialized file, get all the components and finally process each one into right Type of Component to get all the properties, Am I right? At least this is how I'm thinking to aboard this.

     

    Again an impressive work, cheers, and any comment if I'm going in the right way will be appreciated.

     

    P.S If you can indicate me how to use your API thanks

     

    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.

     

    Why does the class database file(U5.3.1p3) which export from classdata.tpk include 5.3.* and 5.3.1p3 versions.

    I mean that the 5.3.* version does not include 5.3.1p3?

     

    All of the class database files has include two versions.

     

     

    What does the AssetsFile::typeTree.version mean?

     

    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.

  11. :eagerness:Great!

    I have extracted AssetsFile from AssetsBundle file successfully!

    But, how to get the asset data(The "View Data" function do)?

    The ClassDatabaseFile and the Type_07::classId maybe useful, but I don't known how to use them.

     

    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.

     

     

     

    That's what I don't get... When I open the packed bundle it automatically asks me if I want to unpack it.. if I do, I have to give it a file name and get the bundle unpacked. When I then import the changed assets file and save it, it's no longer packed (and therefore bigger).

     

    If I don't unpack it, nothing happens and I don't have an open file I can import to or save again.

     

    ? :(

     

    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).

     

    I am a complete noob when it comes to this kind of stuff and was wondering if someone could help me.

     

    I am trying to play a game that was made in Unity, but the game has no setting for mouse sensitivity and the windows mouse speed setting has no affect on the game.

     

    I downloaded Unity Personal and then realized I cannot edit the game files. Is the mouse sensitivity something that I would be able to change through an assets file and would I be able to use this program to accomplish this? I already downloaded it and started looking through the assets files, but I really don't know what I am looking for or how to edit the file if I find the correct one.

     

    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.

  12. 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.

     

    It work now! Thank you very much!

     

    There is a few problems:

    --How to extract assets file from assetsbundle file?

    --How to get asset data just like Material from assets file ?

     

    I can only unpack assetbundle file if compressed and get the asset name from AssetsFileTable.

    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.

  13. Hello DerPopo !

     

    I often use your Utility - it is very important to me !

     

    Because of this - suggestions for improvement.

    I think these are not complicated changes would much easier to make it to use.

     

    - search... - i've been told that you need to put "*" ...before I thought it was just broken. And need Hot Key.

    - window after loading asset there is a very small, i have every time to make it resize bigger.

     

    I think that monitors with a resolution of 800x600 are no longer used, and if anyone works for them - the better that they suffer and not those who have a large monitor :D

     

    Do not think for insolence. With Respect ! :)

    Again, Thank You so much for this Tool !

    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.

     

    where's the API documents ?

     

    It always return false when I use AssetsBundleFile.Read to read assetbundle file.

    It just tell me "AssetsBundleHeader06: A file read error occured!"

     

    Hmmmm... I just AssetsBundleFile.Read after open the assetbundle file.

     

    is something wrong?

     

    TKS for help:adoration:

     

    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.

  14. I don't really understand how this tool work. I used it some while a12 or something and managed to replace a terrain texture with some flaws. The shader did not work on it. Now I have forgot how the tool works or there have been some changes somewhere.

     

    Soo I does anyone know how to add or replace a terrain texture? And would be kind to explain how.

     

    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.

     

    I second this. Thank you for this tool, Popo.

    One minor suggestion: the search function could be improved. As it is now it only searches for the exact word and not for files containing the word.

     

    Putting a * before and after the name includes all file names containing the query.

     

    DerPopo, is there any chance that those of modding under Linux could get source code, or at least a Mono build?

     

    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.

  15. 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.

  16. I'm confused how to use this, or if I am using it correctly.

     

    I downloaded this, opened it, clicked file, navigated to the 7D2D Bundles folder, and clicked the BlockTextureAtlases. I then click Export, it told me to save, so I saved it as 7D2DBlockTextures on my desktop. I then opened unity to try to import, trying custom assets package and import asset, but it won't show up, so am I doing this correctly? I am very new to assets and unity and importing/exporting stuff.

     

    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 good Utility, I used for substitution of textures.

    I need to change sound files of a dynamic ambient of biomes to return beautiful old atmospheric ambients.

    Very much I wait for this opportunity !

    Whether there are what news about a plug-in for EXPORT AudioClip ?

     

    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.

  17. 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.

  18. 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.

  19. 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).

  20. 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...