├── AssetStudio
├── 7zip
│ ├── 7z.dll
│ ├── Compress
│ │ ├── LZ
│ │ │ ├── IMatchFinder.cs
│ │ │ ├── LzOutWindow.cs
│ │ │ ├── LzInWindow.cs
│ │ │ └── LzBinTree.cs
│ │ ├── LZMA
│ │ │ └── LzmaBase.cs
│ │ └── RangeCoder
│ │ │ ├── RangeCoderBit.cs
│ │ │ ├── RangeCoderBitTree.cs
│ │ │ └── RangeCoder.cs
│ ├── Common
│ │ ├── OutBuffer.cs
│ │ ├── CRC.cs
│ │ ├── InBuffer.cs
│ │ └── CommandLineParser.cs
│ ├── ICoder.cs
│ └── SevenZipHelper.cs
├── Resources
│ ├── preview.png
│ └── reverse.ico
├── FMOD Studio API
│ └── fmod.dll
├── GOHierarchy.cs
├── Program.cs
├── Properties
│ ├── Settings.settings
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ └── Settings.Designer.cs
├── AssetPreloadData.cs
├── Classes
│ ├── RectTransform.cs
│ ├── MeshFilter.cs
│ ├── BuildSettings.cs
│ ├── Transform.cs
│ ├── PlayerSettings.cs
│ ├── Renderer.cs
│ ├── TextAsset.cs
│ ├── GameObject.cs
│ ├── Material.cs
│ ├── SkinnedMeshRenderer.cs
│ ├── Font.cs
│ └── AudioClip.cs
├── app.config
├── ExportOptions.cs
├── AboutBox1.cs
├── AboutBox.cs
├── helpers.cs
├── ExportOptions.resx
├── BundleFile.cs
├── EndianStream.cs
├── AssetStudio.csproj
└── AboutBox1.Designer.cs
├── AssetStudio.sln
├── License.md
├── .gitattributes
├── README.md
└── .gitignore
/AssetStudio/7zip/7z.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RaduMC/AssetStudio/HEAD/AssetStudio/7zip/7z.dll
--------------------------------------------------------------------------------
/AssetStudio/Resources/preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RaduMC/AssetStudio/HEAD/AssetStudio/Resources/preview.png
--------------------------------------------------------------------------------
/AssetStudio/Resources/reverse.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RaduMC/AssetStudio/HEAD/AssetStudio/Resources/reverse.ico
--------------------------------------------------------------------------------
/AssetStudio/FMOD Studio API/fmod.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RaduMC/AssetStudio/HEAD/AssetStudio/FMOD Studio API/fmod.dll
--------------------------------------------------------------------------------
/AssetStudio/7zip/Compress/LZ/IMatchFinder.cs:
--------------------------------------------------------------------------------
1 | // IMatchFinder.cs
2 |
3 | using System;
4 |
5 | namespace SevenZip.Compression.LZ
6 | {
7 | interface IInWindowStream
8 | {
9 | void SetStream(System.IO.Stream inStream);
10 | void Init();
11 | void ReleaseStream();
12 | Byte GetIndexByte(Int32 index);
13 | UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit);
14 | UInt32 GetNumAvailableBytes();
15 | }
16 |
17 | interface IMatchFinder : IInWindowStream
18 | {
19 | void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
20 | UInt32 matchMaxLen, UInt32 keepAddBufferAfter);
21 | UInt32 GetMatches(UInt32[] distances);
22 | void Skip(UInt32 num);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/AssetStudio.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssetStudio", "AssetStudio\AssetStudio.csproj", "{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|x86 = Debug|x86
9 | Release|x86 = Release|x86
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x86.ActiveCfg = Debug|x86
13 | {24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x86.Build.0 = Debug|x86
14 | {24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x86.ActiveCfg = Release|x86
15 | {24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x86.Build.0 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Common/OutBuffer.cs:
--------------------------------------------------------------------------------
1 | // OutBuffer.cs
2 |
3 | namespace SevenZip.Buffer
4 | {
5 | public class OutBuffer
6 | {
7 | byte[] m_Buffer;
8 | uint m_Pos;
9 | uint m_BufferSize;
10 | System.IO.Stream m_Stream;
11 | ulong m_ProcessedSize;
12 |
13 | public OutBuffer(uint bufferSize)
14 | {
15 | m_Buffer = new byte[bufferSize];
16 | m_BufferSize = bufferSize;
17 | }
18 |
19 | public void SetStream(System.IO.Stream stream) { m_Stream = stream; }
20 | public void FlushStream() { m_Stream.Flush(); }
21 | public void CloseStream() { m_Stream.Close(); }
22 | public void ReleaseStream() { m_Stream = null; }
23 |
24 | public void Init()
25 | {
26 | m_ProcessedSize = 0;
27 | m_Pos = 0;
28 | }
29 |
30 | public void WriteByte(byte b)
31 | {
32 | m_Buffer[m_Pos++] = b;
33 | if (m_Pos >= m_BufferSize)
34 | FlushData();
35 | }
36 |
37 | public void FlushData()
38 | {
39 | if (m_Pos == 0)
40 | return;
41 | m_Stream.Write(m_Buffer, 0, (int)m_Pos);
42 | m_Pos = 0;
43 | }
44 |
45 | public ulong GetProcessedSize() { return m_ProcessedSize + m_Pos; }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/License.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Radu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Common/CRC.cs:
--------------------------------------------------------------------------------
1 | // Common/CRC.cs
2 |
3 | namespace SevenZip
4 | {
5 | class CRC
6 | {
7 | public static readonly uint[] Table;
8 |
9 | static CRC()
10 | {
11 | Table = new uint[256];
12 | const uint kPoly = 0xEDB88320;
13 | for (uint i = 0; i < 256; i++)
14 | {
15 | uint r = i;
16 | for (int j = 0; j < 8; j++)
17 | if ((r & 1) != 0)
18 | r = (r >> 1) ^ kPoly;
19 | else
20 | r >>= 1;
21 | Table[i] = r;
22 | }
23 | }
24 |
25 | uint _value = 0xFFFFFFFF;
26 |
27 | public void Init() { _value = 0xFFFFFFFF; }
28 |
29 | public void UpdateByte(byte b)
30 | {
31 | _value = Table[(((byte)(_value)) ^ b)] ^ (_value >> 8);
32 | }
33 |
34 | public void Update(byte[] data, uint offset, uint size)
35 | {
36 | for (uint i = 0; i < size; i++)
37 | _value = Table[(((byte)(_value)) ^ data[offset + i])] ^ (_value >> 8);
38 | }
39 |
40 | public uint GetDigest() { return _value ^ 0xFFFFFFFF; }
41 |
42 | static uint CalculateDigest(byte[] data, uint offset, uint size)
43 | {
44 | CRC crc = new CRC();
45 | // crc.Init();
46 | crc.Update(data, offset, size);
47 | return crc.GetDigest();
48 | }
49 |
50 | static bool VerifyDigest(uint digest, byte[] data, uint offset, uint size)
51 | {
52 | return (CalculateDigest(data, offset, size) == digest);
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Common/InBuffer.cs:
--------------------------------------------------------------------------------
1 | // InBuffer.cs
2 |
3 | namespace SevenZip.Buffer
4 | {
5 | public class InBuffer
6 | {
7 | byte[] m_Buffer;
8 | uint m_Pos;
9 | uint m_Limit;
10 | uint m_BufferSize;
11 | System.IO.Stream m_Stream;
12 | bool m_StreamWasExhausted;
13 | ulong m_ProcessedSize;
14 |
15 | public InBuffer(uint bufferSize)
16 | {
17 | m_Buffer = new byte[bufferSize];
18 | m_BufferSize = bufferSize;
19 | }
20 |
21 | public void Init(System.IO.Stream stream)
22 | {
23 | m_Stream = stream;
24 | m_ProcessedSize = 0;
25 | m_Limit = 0;
26 | m_Pos = 0;
27 | m_StreamWasExhausted = false;
28 | }
29 |
30 | public bool ReadBlock()
31 | {
32 | if (m_StreamWasExhausted)
33 | return false;
34 | m_ProcessedSize += m_Pos;
35 | int aNumProcessedBytes = m_Stream.Read(m_Buffer, 0, (int)m_BufferSize);
36 | m_Pos = 0;
37 | m_Limit = (uint)aNumProcessedBytes;
38 | m_StreamWasExhausted = (aNumProcessedBytes == 0);
39 | return (!m_StreamWasExhausted);
40 | }
41 |
42 |
43 | public void ReleaseStream()
44 | {
45 | // m_Stream.Close();
46 | m_Stream = null;
47 | }
48 |
49 | public bool ReadByte(byte b) // check it
50 | {
51 | if (m_Pos >= m_Limit)
52 | if (!ReadBlock())
53 | return false;
54 | b = m_Buffer[m_Pos++];
55 | return true;
56 | }
57 |
58 | public byte ReadByte()
59 | {
60 | // return (byte)m_Stream.ReadByte();
61 | if (m_Pos >= m_Limit)
62 | if (!ReadBlock())
63 | return 0xFF;
64 | return m_Buffer[m_Pos++];
65 | }
66 |
67 | public ulong GetProcessedSize()
68 | {
69 | return m_ProcessedSize + m_Pos;
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/AssetStudio/GOHierarchy.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 | using System.Windows.Forms;
38 |
39 | namespace AssetStudio
40 | {
41 | public class GOHierarchy : TreeView
42 | {
43 | protected override void WndProc(ref Message m)
44 | {
45 | // Filter WM_LBUTTONDBLCLK
46 | if (m.Msg != 0x203) base.WndProc(ref m);
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/AssetStudio/Program.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Windows.Forms;
37 |
38 | namespace AssetStudio
39 | {
40 | static class Program
41 | {
42 | ///
43 | /// The main entry point for the application.
44 | ///
45 | [STAThread]
46 | static void Main()
47 | {
48 | Application.EnableVisualStyles();
49 | Application.SetCompatibleTextRenderingDefault(false);
50 | Application.Run(new AssetStudioForm());
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/AssetStudio/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | True
7 |
8 |
9 | True
10 |
11 |
12 | True
13 |
14 |
15 | True
16 |
17 |
18 | 0
19 |
20 |
21 | True
22 |
23 |
24 | False
25 |
26 |
27 | True
28 |
29 |
30 | True
31 |
32 |
33 | 2.54
34 |
35 |
36 | 0
37 |
38 |
39 | False
40 |
41 |
42 | True
43 |
44 |
45 | True
46 |
47 |
48 |
--------------------------------------------------------------------------------
/AssetStudio/AssetPreloadData.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 | using System.Windows.Forms;
38 |
39 | namespace AssetStudio
40 | {
41 | public class AssetPreloadData : ListViewItem
42 | {
43 | public long m_PathID;
44 | public int Offset;
45 | public int Size;
46 | public int Type1;
47 | public ushort Type2;
48 |
49 | public string TypeString;
50 | public int exportSize;
51 | public string InfoText;
52 | public string extension;
53 |
54 | public AssetsFile sourceFile;
55 | public string uniqueID;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/RectTransform.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | public class RectTransform
41 | {
42 | public Transform m_Transform;
43 |
44 | public RectTransform(AssetPreloadData preloadData)
45 | {
46 | m_Transform = new Transform(preloadData);
47 |
48 | //var sourceFile = preloadData.sourceFile;
49 | //var a_Stream = preloadData.sourceFile.a_Stream;
50 |
51 | /*
52 | float[2] AnchorsMin
53 | float[2] AnchorsMax
54 | float[2] Pivod
55 | float Width
56 | float Height
57 | float[2] ?
58 | */
59 |
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/AssetStudio/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | True
12 |
13 |
14 | True
15 |
16 |
17 | True
18 |
19 |
20 | True
21 |
22 |
23 | 0
24 |
25 |
26 | True
27 |
28 |
29 | False
30 |
31 |
32 | True
33 |
34 |
35 | True
36 |
37 |
38 | 2.54
39 |
40 |
41 | 0
42 |
43 |
44 | False
45 |
46 |
47 | True
48 |
49 |
50 | True
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Compress/LZ/LzOutWindow.cs:
--------------------------------------------------------------------------------
1 | // LzOutWindow.cs
2 |
3 | namespace SevenZip.Compression.LZ
4 | {
5 | public class OutWindow
6 | {
7 | byte[] _buffer = null;
8 | uint _pos;
9 | uint _windowSize = 0;
10 | uint _streamPos;
11 | System.IO.Stream _stream;
12 |
13 | public uint TrainSize = 0;
14 |
15 | public void Create(uint windowSize)
16 | {
17 | if (_windowSize != windowSize)
18 | {
19 | // System.GC.Collect();
20 | _buffer = new byte[windowSize];
21 | }
22 | _windowSize = windowSize;
23 | _pos = 0;
24 | _streamPos = 0;
25 | }
26 |
27 | public void Init(System.IO.Stream stream, bool solid)
28 | {
29 | ReleaseStream();
30 | _stream = stream;
31 | if (!solid)
32 | {
33 | _streamPos = 0;
34 | _pos = 0;
35 | TrainSize = 0;
36 | }
37 | }
38 |
39 | public bool Train(System.IO.Stream stream)
40 | {
41 | long len = stream.Length;
42 | uint size = (len < _windowSize) ? (uint)len : _windowSize;
43 | TrainSize = size;
44 | stream.Position = len - size;
45 | _streamPos = _pos = 0;
46 | while (size > 0)
47 | {
48 | uint curSize = _windowSize - _pos;
49 | if (size < curSize)
50 | curSize = size;
51 | int numReadBytes = stream.Read(_buffer, (int)_pos, (int)curSize);
52 | if (numReadBytes == 0)
53 | return false;
54 | size -= (uint)numReadBytes;
55 | _pos += (uint)numReadBytes;
56 | _streamPos += (uint)numReadBytes;
57 | if (_pos == _windowSize)
58 | _streamPos = _pos = 0;
59 | }
60 | return true;
61 | }
62 |
63 | public void ReleaseStream()
64 | {
65 | Flush();
66 | _stream = null;
67 | }
68 |
69 | public void Flush()
70 | {
71 | uint size = _pos - _streamPos;
72 | if (size == 0)
73 | return;
74 | _stream.Write(_buffer, (int)_streamPos, (int)size);
75 | if (_pos >= _windowSize)
76 | _pos = 0;
77 | _streamPos = _pos;
78 | }
79 |
80 | public void CopyBlock(uint distance, uint len)
81 | {
82 | uint pos = _pos - distance - 1;
83 | if (pos >= _windowSize)
84 | pos += _windowSize;
85 | for (; len > 0; len--)
86 | {
87 | if (pos >= _windowSize)
88 | pos = 0;
89 | _buffer[_pos++] = _buffer[pos++];
90 | if (_pos >= _windowSize)
91 | Flush();
92 | }
93 | }
94 |
95 | public void PutByte(byte b)
96 | {
97 | _buffer[_pos++] = b;
98 | if (_pos >= _windowSize)
99 | Flush();
100 | }
101 |
102 | public byte GetByte(uint distance)
103 | {
104 | uint pos = _pos - distance - 1;
105 | if (pos >= _windowSize)
106 | pos += _windowSize;
107 | return _buffer[pos];
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/MeshFilter.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | public class MeshFilter
41 | {
42 | public long preloadIndex;
43 | public PPtr m_GameObject = new PPtr();
44 | public PPtr m_Mesh = new PPtr();
45 |
46 | public MeshFilter(AssetPreloadData preloadData)
47 | {
48 | var sourceFile = preloadData.sourceFile;
49 | var a_Stream = preloadData.sourceFile.a_Stream;
50 | a_Stream.Position = preloadData.Offset;
51 |
52 | if (sourceFile.platform == -2)
53 | {
54 | uint m_ObjectHideFlags = a_Stream.ReadUInt32();
55 | PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
56 | PPtr m_PrefabInternal = sourceFile.ReadPPtr();
57 | }
58 |
59 | m_GameObject = sourceFile.ReadPPtr();
60 | m_Mesh = sourceFile.ReadPPtr();
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | **AssetStudio** is an independent tool for exploring, extracting and exporting assets.
2 |
3 | **None of the repo, the tool, nor the repo owner is affiliated with, or sponsored or authorized by, Unity Technologies or its affiliates.**
4 |
5 | **This project is no longer maintained. Thank you all for your feedback and testing.**
6 |
7 | It is the continuation of my Importer script for 3ds Max, and comprises all my research and reverse engineering file formats. It has been thoroughly tested with builds from most platforms, ranging from Web, PC, Linux, MacOS to Xbox360, PS3, Android and iOS.
8 | This project is no longer maintained and is probably not compatible with recent builds.
9 |
10 | #### Current features
11 |
12 | * Export to FBX, with complete hierarchy, transformations, materials and textures. Geometry is exported with normals, tangents, UV coordinates, vertex colors and deformers. Skeleton nodes can be exported either as bones or dummy deformers..
13 | * Extraction of assets that can be used as standalone resources:
14 | * Textures: DDS (Alpha8bpp, ARGB16bpp, RGB24bpp, ARGB32bpp, BGRA32bpp, RGB565, DXT1, DXT5, RGBA16bpp)
15 | * PVR (PVRTC_RGB2, PVRTC_RGBA2, PVRTC_RGBA4, PVRTC_RGB4, ETC_RGB4)
16 | * Audio clips: mp3, ogg, wav, xbox wav (including streams from .resS files)
17 | * Fonts: ttf, otf
18 | * Text Assets
19 | * Shaders
20 | * Real-time preview window for the above-mentioned assets
21 | * Diagnostics mode with useful tools for research
22 |
23 |
24 | #### UI guide
25 |
26 | | Item | Action
27 | | :---------------------------- | :----------------------------
28 | | File -> Load file/folder | Open Assetfiles and load their assets. Load file can also decompress and load bundle files straight into memory
29 | | File -> Extract bundle/folder | Extract Assetfiles from bundle files compressed with lzma or l4z
30 | | Scene Hierarchy search box | Search nodes using * and ? wildcards. Press Enter to loop through results or Ctrl+Enter to select all matching nodes
31 | | Asset List filter box | Enter a keyword to filter the list of available assets; wildcards are added automatically
32 | | Diagnostics | press Ctrl+Alt+D to bring up a hidden menu and a new list
33 | | Bulid class structures | Create human-readable structures for each type of asset; available only in Web builds!
34 |
35 | Other interface elements have tooltips or are self-explanatory.
36 |
37 |
38 |
39 | #### DISCLAIMER
40 | The reposiotory, code and tools provided herein are for educational purposes only.
41 | The information not meant to change or impact the original code, product or service.
42 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
43 | The user of this repository, code and tools is responsible for his own actions.
44 |
45 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
46 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Compress/LZMA/LzmaBase.cs:
--------------------------------------------------------------------------------
1 | // LzmaBase.cs
2 |
3 | namespace SevenZip.Compression.LZMA
4 | {
5 | internal abstract class Base
6 | {
7 | public const uint kNumRepDistances = 4;
8 | public const uint kNumStates = 12;
9 |
10 | // static byte []kLiteralNextStates = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
11 | // static byte []kMatchNextStates = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
12 | // static byte []kRepNextStates = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
13 | // static byte []kShortRepNextStates = {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
14 |
15 | public struct State
16 | {
17 | public uint Index;
18 | public void Init() { Index = 0; }
19 | public void UpdateChar()
20 | {
21 | if (Index < 4) Index = 0;
22 | else if (Index < 10) Index -= 3;
23 | else Index -= 6;
24 | }
25 | public void UpdateMatch() { Index = (uint)(Index < 7 ? 7 : 10); }
26 | public void UpdateRep() { Index = (uint)(Index < 7 ? 8 : 11); }
27 | public void UpdateShortRep() { Index = (uint)(Index < 7 ? 9 : 11); }
28 | public bool IsCharState() { return Index < 7; }
29 | }
30 |
31 | public const int kNumPosSlotBits = 6;
32 | public const int kDicLogSizeMin = 0;
33 | // public const int kDicLogSizeMax = 30;
34 | // public const uint kDistTableSizeMax = kDicLogSizeMax * 2;
35 |
36 | public const int kNumLenToPosStatesBits = 2; // it's for speed optimization
37 | public const uint kNumLenToPosStates = 1 << kNumLenToPosStatesBits;
38 |
39 | public const uint kMatchMinLen = 2;
40 |
41 | public static uint GetLenToPosState(uint len)
42 | {
43 | len -= kMatchMinLen;
44 | if (len < kNumLenToPosStates)
45 | return len;
46 | return (uint)(kNumLenToPosStates - 1);
47 | }
48 |
49 | public const int kNumAlignBits = 4;
50 | public const uint kAlignTableSize = 1 << kNumAlignBits;
51 | public const uint kAlignMask = (kAlignTableSize - 1);
52 |
53 | public const uint kStartPosModelIndex = 4;
54 | public const uint kEndPosModelIndex = 14;
55 | public const uint kNumPosModels = kEndPosModelIndex - kStartPosModelIndex;
56 |
57 | public const uint kNumFullDistances = 1 << ((int)kEndPosModelIndex / 2);
58 |
59 | public const uint kNumLitPosStatesBitsEncodingMax = 4;
60 | public const uint kNumLitContextBitsMax = 8;
61 |
62 | public const int kNumPosStatesBitsMax = 4;
63 | public const uint kNumPosStatesMax = (1 << kNumPosStatesBitsMax);
64 | public const int kNumPosStatesBitsEncodingMax = 4;
65 | public const uint kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);
66 |
67 | public const int kNumLowLenBits = 3;
68 | public const int kNumMidLenBits = 3;
69 | public const int kNumHighLenBits = 8;
70 | public const uint kNumLowLenSymbols = 1 << kNumLowLenBits;
71 | public const uint kNumMidLenSymbols = 1 << kNumMidLenBits;
72 | public const uint kNumLenSymbols = kNumLowLenSymbols + kNumMidLenSymbols +
73 | (1 << kNumHighLenBits);
74 | public const uint kMatchMaxLen = kMatchMinLen + kNumLenSymbols - 1;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/BuildSettings.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | public class BuildSettings
41 | {
42 | public string m_Version;
43 |
44 | public BuildSettings(AssetPreloadData preloadData)
45 | {
46 | var sourceFile = preloadData.sourceFile;
47 | var a_Stream = preloadData.sourceFile.a_Stream;
48 | a_Stream.Position = preloadData.Offset;
49 |
50 | int levels = a_Stream.ReadInt32();
51 | for (int l = 0; l < levels; l++) { string level = a_Stream.ReadAlignedString(a_Stream.ReadInt32()); }
52 |
53 | if (sourceFile.version[0] == 5)
54 | {
55 | int preloadedPlugins = a_Stream.ReadInt32();
56 | for (int l = 0; l < preloadedPlugins; l++) { string preloadedPlugin = a_Stream.ReadAlignedString(a_Stream.ReadInt32()); }
57 | }
58 |
59 | a_Stream.Position += 4; //bool flags
60 | if (sourceFile.fileGen >= 8) { a_Stream.Position += 4; } //bool flags
61 | if (sourceFile.fileGen >= 9) { a_Stream.Position += 4; } //bool flags
62 | if (sourceFile.version[0] == 5 ||
63 | (sourceFile.version[0] == 4 && (sourceFile.version[1] >= 3 ||
64 | (sourceFile.version[1] == 2 && sourceFile.buildType[0] != "a"))))
65 | { a_Stream.Position += 4; } //bool flags
66 |
67 | m_Version = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/Transform.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | public class Transform
41 | {
42 | public PPtr m_GameObject = new PPtr();
43 | public float[] m_LocalRotation;
44 | public float[] m_LocalPosition;
45 | public float[] m_LocalScale;
46 | public List m_Children = new List();
47 | public PPtr m_Father = new PPtr();//can be transform or type 224 (as seen in Minions)
48 |
49 | public Transform(AssetPreloadData preloadData)
50 | {
51 | var sourceFile = preloadData.sourceFile;
52 | var a_Stream = preloadData.sourceFile.a_Stream;
53 | a_Stream.Position = preloadData.Offset;
54 |
55 | if (sourceFile.platform == -2)
56 | {
57 | uint m_ObjectHideFlags = a_Stream.ReadUInt32();
58 | PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
59 | PPtr m_PrefabInternal = sourceFile.ReadPPtr();
60 | }
61 |
62 | m_GameObject = sourceFile.ReadPPtr();
63 | m_LocalRotation = new float[] { a_Stream.ReadSingle(), a_Stream.ReadSingle(), a_Stream.ReadSingle(), a_Stream.ReadSingle() };
64 | m_LocalPosition = new float[] { a_Stream.ReadSingle(), a_Stream.ReadSingle(), a_Stream.ReadSingle() };
65 | m_LocalScale = new float[] { a_Stream.ReadSingle(), a_Stream.ReadSingle(), a_Stream.ReadSingle() };
66 | int m_ChildrenCount = a_Stream.ReadInt32();
67 | for (int j = 0; j < m_ChildrenCount; j++)
68 | {
69 | m_Children.Add(sourceFile.ReadPPtr());
70 | }
71 | m_Father = sourceFile.ReadPPtr();
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Compress/RangeCoder/RangeCoderBit.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SevenZip.Compression.RangeCoder
4 | {
5 | struct BitEncoder
6 | {
7 | public const int kNumBitModelTotalBits = 11;
8 | public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
9 | const int kNumMoveBits = 5;
10 | const int kNumMoveReducingBits = 2;
11 | public const int kNumBitPriceShiftBits = 6;
12 |
13 | uint Prob;
14 |
15 | public void Init() { Prob = kBitModelTotal >> 1; }
16 |
17 | public void UpdateModel(uint symbol)
18 | {
19 | if (symbol == 0)
20 | Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
21 | else
22 | Prob -= (Prob) >> kNumMoveBits;
23 | }
24 |
25 | public void Encode(Encoder encoder, uint symbol)
26 | {
27 | // encoder.EncodeBit(Prob, kNumBitModelTotalBits, symbol);
28 | // UpdateModel(symbol);
29 | uint newBound = (encoder.Range >> kNumBitModelTotalBits) * Prob;
30 | if (symbol == 0)
31 | {
32 | encoder.Range = newBound;
33 | Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
34 | }
35 | else
36 | {
37 | encoder.Low += newBound;
38 | encoder.Range -= newBound;
39 | Prob -= (Prob) >> kNumMoveBits;
40 | }
41 | if (encoder.Range < Encoder.kTopValue)
42 | {
43 | encoder.Range <<= 8;
44 | encoder.ShiftLow();
45 | }
46 | }
47 |
48 | private static UInt32[] ProbPrices = new UInt32[kBitModelTotal >> kNumMoveReducingBits];
49 |
50 | static BitEncoder()
51 | {
52 | const int kNumBits = (kNumBitModelTotalBits - kNumMoveReducingBits);
53 | for (int i = kNumBits - 1; i >= 0; i--)
54 | {
55 | UInt32 start = (UInt32)1 << (kNumBits - i - 1);
56 | UInt32 end = (UInt32)1 << (kNumBits - i);
57 | for (UInt32 j = start; j < end; j++)
58 | ProbPrices[j] = ((UInt32)i << kNumBitPriceShiftBits) +
59 | (((end - j) << kNumBitPriceShiftBits) >> (kNumBits - i - 1));
60 | }
61 | }
62 |
63 | public uint GetPrice(uint symbol)
64 | {
65 | return ProbPrices[(((Prob - symbol) ^ ((-(int)symbol))) & (kBitModelTotal - 1)) >> kNumMoveReducingBits];
66 | }
67 | public uint GetPrice0() { return ProbPrices[Prob >> kNumMoveReducingBits]; }
68 | public uint GetPrice1() { return ProbPrices[(kBitModelTotal - Prob) >> kNumMoveReducingBits]; }
69 | }
70 |
71 | struct BitDecoder
72 | {
73 | public const int kNumBitModelTotalBits = 11;
74 | public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
75 | const int kNumMoveBits = 5;
76 |
77 | uint Prob;
78 |
79 | public void UpdateModel(int numMoveBits, uint symbol)
80 | {
81 | if (symbol == 0)
82 | Prob += (kBitModelTotal - Prob) >> numMoveBits;
83 | else
84 | Prob -= (Prob) >> numMoveBits;
85 | }
86 |
87 | public void Init() { Prob = kBitModelTotal >> 1; }
88 |
89 | public uint Decode(RangeCoder.Decoder rangeDecoder)
90 | {
91 | uint newBound = (uint)(rangeDecoder.Range >> kNumBitModelTotalBits) * (uint)Prob;
92 | if (rangeDecoder.Code < newBound)
93 | {
94 | rangeDecoder.Range = newBound;
95 | Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
96 | if (rangeDecoder.Range < Decoder.kTopValue)
97 | {
98 | rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
99 | rangeDecoder.Range <<= 8;
100 | }
101 | return 0;
102 | }
103 | else
104 | {
105 | rangeDecoder.Range -= newBound;
106 | rangeDecoder.Code -= newBound;
107 | Prob -= (Prob) >> kNumMoveBits;
108 | if (rangeDecoder.Range < Decoder.kTopValue)
109 | {
110 | rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
111 | rangeDecoder.Range <<= 8;
112 | }
113 | return 1;
114 | }
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/AssetStudio/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System.Reflection;
34 | using System.Runtime.CompilerServices;
35 | using System.Runtime.InteropServices;
36 |
37 | // General Information about an assembly is controlled through the following
38 | // set of attributes. Change these attribute values to modify the information
39 | // associated with an assembly.
40 | [assembly: AssemblyTitle("AssetStudio")]
41 | [assembly: AssemblyDescription("- Compatible with all versions from 2.5.0 to 5.2.2\r\n- Compatible with Web, PC, iOS, Android, PS3, Xbox 360, OSX and Linux games/apps\r\n- Automatically merges .split\r\n- 3D objets exported to FBX\r\n- Able to load audio streams from .resS files\r\n- Real-time preview window and export function for textures, audio clips, shaders and fonts\r\n - Textures: DDS (Alpha8bpp, ARGB16bpp, RGB24bpp, ARGB32bpp, BGRA32bpp, RGB565, DXT1, DXT5, RGBA16bpp)\r\n PVR (PVRTC_RGB2, PVRTC_RGBA2, PVRTC_RGBA4, PVRTC_RGB4, ETC_RGB4)\r\n - Audio clips: mp3, ogg, wav, xbox wav\r\n - Shader files are exported in plain-text\r\n - Fonts: ttf, otf")]
42 | [assembly: AssemblyConfiguration("")]
43 | [assembly: AssemblyCompany("")]
44 | [assembly: AssemblyProduct("AssetStudio")]
45 | [assembly: AssemblyCopyright("")]
46 | [assembly: AssemblyTrademark("")]
47 | [assembly: AssemblyCulture("")]
48 |
49 | // Setting ComVisible to false makes the types in this assembly not visible
50 | // to COM components. If you need to access a type in this assembly from
51 | // COM, set the ComVisible attribute to true on that type.
52 | [assembly: ComVisible(false)]
53 |
54 | // The following GUID is for the ID of the typelib if this project is exposed to COM
55 | [assembly: Guid("05c04c20-dd89-4895-9f06-33d5cfbfe925")]
56 |
57 | // Version information for an assembly consists of the following four values:
58 | //
59 | // Major Version
60 | // Minor Version
61 | // Build Number
62 | // Revision
63 | //
64 | // You can specify all the values or you can default the Build and Revision Numbers
65 | // by using the '*' as shown below:
66 | // [assembly: AssemblyVersion("1.0.*")]
67 | [assembly: AssemblyVersion("0.5.0.0")]
68 | [assembly: AssemblyFileVersion("0.0.0.0")]
69 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/PlayerSettings.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | public class PlayerSettings
41 | {
42 | public string companyName = "";
43 | public string productName = "";
44 |
45 | public PlayerSettings(AssetPreloadData preloadData)
46 | {
47 | var sourceFile = preloadData.sourceFile;
48 | var a_Stream = preloadData.sourceFile.a_Stream;
49 | a_Stream.Position = preloadData.Offset;
50 |
51 | if (sourceFile.version[0] >= 3)
52 | {
53 | if (sourceFile.version[0] == 3 && sourceFile.version[1] <2) { string AndroidLicensePublicKey = a_Stream.ReadAlignedString(a_Stream.ReadInt32()); }
54 | else { bool AndroidProfiler = a_Stream.ReadBoolean(); a_Stream.AlignStream(4); }
55 |
56 | int defaultScreenOrientation = a_Stream.ReadInt32();
57 | int targetDevice = a_Stream.ReadInt32();
58 |
59 | if (sourceFile.version[0] < 5 || (sourceFile.version[0] == 5 && sourceFile.version[1] < 1))
60 | { int targetGlesGraphics = a_Stream.ReadInt32(); }
61 |
62 | if ((sourceFile.version[0] == 5 && sourceFile.version[1] < 1) || (sourceFile.version[0] == 4 && sourceFile.version[1] == 6 && sourceFile.version[2] >= 3))
63 | { int targetIOSGraphics = a_Stream.ReadInt32(); }
64 |
65 | if (sourceFile.version[0] == 5 && (sourceFile.version[1] > 2 || (sourceFile.version[1] == 2 && sourceFile.version[2] >= 1)))
66 | { bool useOnDemandResources = a_Stream.ReadBoolean(); a_Stream.AlignStream(4); }
67 |
68 | int targetResolution = a_Stream.ReadInt32();
69 |
70 | if (sourceFile.version[0] == 3 && sourceFile.version[1] <= 1) { bool OverrideIPodMusic = a_Stream.ReadBoolean(); a_Stream.AlignStream(4); }
71 | else if (sourceFile.version[0] == 3 && sourceFile.version[1] <= 4) { }
72 | else { int accelerometerFrequency = a_Stream.ReadInt32(); }//3.5.0 and up
73 | }
74 | //fail in version 5 beta
75 | companyName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
76 | productName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/Renderer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | class Renderer
41 | {
42 | public PPtr m_GameObject;
43 | public bool m_Enabled;
44 | public byte m_CastShadows; //bool prior to version 5
45 | public bool m_ReceiveShadows;
46 | public ushort m_LightmapIndex;
47 | public ushort m_LightmapIndexDynamic;
48 | public PPtr[] m_Materials;
49 |
50 | public Renderer(AssetPreloadData preloadData)
51 | {
52 | var sourceFile = preloadData.sourceFile;
53 | var a_Stream = preloadData.sourceFile.a_Stream;
54 | a_Stream.Position = preloadData.Offset;
55 |
56 | if (sourceFile.platform == -2)
57 | {
58 | uint m_ObjectHideFlags = a_Stream.ReadUInt32();
59 | PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
60 | PPtr m_PrefabInternal = sourceFile.ReadPPtr();
61 | }
62 |
63 | m_GameObject = sourceFile.ReadPPtr();
64 |
65 | if (sourceFile.version[0] < 5)
66 | {
67 | m_Enabled = a_Stream.ReadBoolean();
68 | m_CastShadows = a_Stream.ReadByte();
69 | m_ReceiveShadows = a_Stream.ReadBoolean();
70 | m_LightmapIndex = a_Stream.ReadByte();
71 | }
72 | else
73 | {
74 | m_Enabled = a_Stream.ReadBoolean();
75 | a_Stream.AlignStream(4);
76 | m_CastShadows = a_Stream.ReadByte();
77 | m_ReceiveShadows = a_Stream.ReadBoolean();
78 | a_Stream.AlignStream(4);
79 |
80 | m_LightmapIndex = a_Stream.ReadUInt16();
81 | m_LightmapIndexDynamic = a_Stream.ReadUInt16();
82 | }
83 |
84 | if (sourceFile.version[0] >= 3) { a_Stream.Position += 16; } //Vector4f m_LightmapTilingOffset
85 | if (sourceFile.version[0] >= 5) { a_Stream.Position += 16; } //Vector4f m_LightmapTilingOffsetDynamic
86 |
87 | m_Materials = new PPtr[a_Stream.ReadInt32()];
88 | for (int m = 0; m < m_Materials.Length; m++)
89 | {
90 | m_Materials[m] = sourceFile.ReadPPtr();
91 | }
92 |
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Compress/RangeCoder/RangeCoderBitTree.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SevenZip.Compression.RangeCoder
4 | {
5 | struct BitTreeEncoder
6 | {
7 | BitEncoder[] Models;
8 | int NumBitLevels;
9 |
10 | public BitTreeEncoder(int numBitLevels)
11 | {
12 | NumBitLevels = numBitLevels;
13 | Models = new BitEncoder[1 << numBitLevels];
14 | }
15 |
16 | public void Init()
17 | {
18 | for (uint i = 1; i < (1 << NumBitLevels); i++)
19 | Models[i].Init();
20 | }
21 |
22 | public void Encode(Encoder rangeEncoder, UInt32 symbol)
23 | {
24 | UInt32 m = 1;
25 | for (int bitIndex = NumBitLevels; bitIndex > 0; )
26 | {
27 | bitIndex--;
28 | UInt32 bit = (symbol >> bitIndex) & 1;
29 | Models[m].Encode(rangeEncoder, bit);
30 | m = (m << 1) | bit;
31 | }
32 | }
33 |
34 | public void ReverseEncode(Encoder rangeEncoder, UInt32 symbol)
35 | {
36 | UInt32 m = 1;
37 | for (UInt32 i = 0; i < NumBitLevels; i++)
38 | {
39 | UInt32 bit = symbol & 1;
40 | Models[m].Encode(rangeEncoder, bit);
41 | m = (m << 1) | bit;
42 | symbol >>= 1;
43 | }
44 | }
45 |
46 | public UInt32 GetPrice(UInt32 symbol)
47 | {
48 | UInt32 price = 0;
49 | UInt32 m = 1;
50 | for (int bitIndex = NumBitLevels; bitIndex > 0; )
51 | {
52 | bitIndex--;
53 | UInt32 bit = (symbol >> bitIndex) & 1;
54 | price += Models[m].GetPrice(bit);
55 | m = (m << 1) + bit;
56 | }
57 | return price;
58 | }
59 |
60 | public UInt32 ReverseGetPrice(UInt32 symbol)
61 | {
62 | UInt32 price = 0;
63 | UInt32 m = 1;
64 | for (int i = NumBitLevels; i > 0; i--)
65 | {
66 | UInt32 bit = symbol & 1;
67 | symbol >>= 1;
68 | price += Models[m].GetPrice(bit);
69 | m = (m << 1) | bit;
70 | }
71 | return price;
72 | }
73 |
74 | public static UInt32 ReverseGetPrice(BitEncoder[] Models, UInt32 startIndex,
75 | int NumBitLevels, UInt32 symbol)
76 | {
77 | UInt32 price = 0;
78 | UInt32 m = 1;
79 | for (int i = NumBitLevels; i > 0; i--)
80 | {
81 | UInt32 bit = symbol & 1;
82 | symbol >>= 1;
83 | price += Models[startIndex + m].GetPrice(bit);
84 | m = (m << 1) | bit;
85 | }
86 | return price;
87 | }
88 |
89 | public static void ReverseEncode(BitEncoder[] Models, UInt32 startIndex,
90 | Encoder rangeEncoder, int NumBitLevels, UInt32 symbol)
91 | {
92 | UInt32 m = 1;
93 | for (int i = 0; i < NumBitLevels; i++)
94 | {
95 | UInt32 bit = symbol & 1;
96 | Models[startIndex + m].Encode(rangeEncoder, bit);
97 | m = (m << 1) | bit;
98 | symbol >>= 1;
99 | }
100 | }
101 | }
102 |
103 | struct BitTreeDecoder
104 | {
105 | BitDecoder[] Models;
106 | int NumBitLevels;
107 |
108 | public BitTreeDecoder(int numBitLevels)
109 | {
110 | NumBitLevels = numBitLevels;
111 | Models = new BitDecoder[1 << numBitLevels];
112 | }
113 |
114 | public void Init()
115 | {
116 | for (uint i = 1; i < (1 << NumBitLevels); i++)
117 | Models[i].Init();
118 | }
119 |
120 | public uint Decode(RangeCoder.Decoder rangeDecoder)
121 | {
122 | uint m = 1;
123 | for (int bitIndex = NumBitLevels; bitIndex > 0; bitIndex--)
124 | m = (m << 1) + Models[m].Decode(rangeDecoder);
125 | return m - ((uint)1 << NumBitLevels);
126 | }
127 |
128 | public uint ReverseDecode(RangeCoder.Decoder rangeDecoder)
129 | {
130 | uint m = 1;
131 | uint symbol = 0;
132 | for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
133 | {
134 | uint bit = Models[m].Decode(rangeDecoder);
135 | m <<= 1;
136 | m += bit;
137 | symbol |= (bit << bitIndex);
138 | }
139 | return symbol;
140 | }
141 |
142 | public static uint ReverseDecode(BitDecoder[] Models, UInt32 startIndex,
143 | RangeCoder.Decoder rangeDecoder, int NumBitLevels)
144 | {
145 | uint m = 1;
146 | uint symbol = 0;
147 | for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
148 | {
149 | uint bit = Models[startIndex + m].Decode(rangeDecoder);
150 | m <<= 1;
151 | m += bit;
152 | symbol |= (bit << bitIndex);
153 | }
154 | return symbol;
155 | }
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/TextAsset.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | class TextAsset
41 | {
42 | public string m_Name;
43 | public byte[] m_Script;
44 | public string m_PathName;
45 |
46 | public TextAsset(AssetPreloadData preloadData, bool readSwitch)
47 | {
48 | var sourceFile = preloadData.sourceFile;
49 | var a_Stream = preloadData.sourceFile.a_Stream;
50 | a_Stream.Position = preloadData.Offset;
51 | preloadData.extension = ".txt";
52 |
53 | if (sourceFile.platform == -2)
54 | {
55 | uint m_ObjectHideFlags = a_Stream.ReadUInt32();
56 | PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
57 | PPtr m_PrefabInternal = sourceFile.ReadPPtr();
58 | }
59 |
60 | m_Name = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
61 |
62 | int m_Script_size = a_Stream.ReadInt32();
63 |
64 | if (readSwitch) //asset is read for preview or export
65 | {
66 | m_Script = new byte[m_Script_size];
67 | a_Stream.Read(m_Script, 0, m_Script_size);
68 |
69 | if (m_Script[0] == 93) { m_Script = SevenZip.Compression.LZMA.SevenZipHelper.Decompress(m_Script); }
70 | if (m_Script[0] == 60 || (m_Script[0] == 239 && m_Script[1] == 187 && m_Script[2] == 191 && m_Script[3] == 60)) { preloadData.extension = ".xml"; }
71 | }
72 | else
73 | {
74 | byte lzmaTest = a_Stream.ReadByte();
75 | if (lzmaTest == 93)
76 | {
77 | a_Stream.Position += 4;
78 | preloadData.exportSize = a_Stream.ReadInt32(); //actualy int64
79 | a_Stream.Position -= 8;
80 | }
81 | else { preloadData.exportSize = m_Script_size; }
82 |
83 | a_Stream.Position += m_Script_size - 1;
84 |
85 | if (m_Name != "") { preloadData.Text = m_Name; }
86 | else { preloadData.Text = preloadData.TypeString + " #" + preloadData.uniqueID; }
87 | preloadData.SubItems.AddRange(new string[] { preloadData.TypeString, preloadData.exportSize.ToString() });
88 | }
89 | a_Stream.AlignStream(4);
90 |
91 | m_PathName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
92 | }
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | build/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 |
28 | # MSTest test Results
29 | [Tt]est[Rr]esult*/
30 | [Bb]uild[Ll]og.*
31 |
32 | # NUNIT
33 | *.VisualState.xml
34 | TestResult.xml
35 |
36 | # Build Results of an ATL Project
37 | [Dd]ebugPS/
38 | [Rr]eleasePS/
39 | dlldata.c
40 |
41 | # DNX
42 | project.lock.json
43 | artifacts/
44 |
45 | *_i.c
46 | *_p.c
47 | *_i.h
48 | *.ilk
49 | *.meta
50 | *.obj
51 | *.pch
52 | *.pdb
53 | *.pgc
54 | *.pgd
55 | *.rsp
56 | *.sbr
57 | *.tlb
58 | *.tli
59 | *.tlh
60 | *.tmp
61 | *.tmp_proj
62 | *.log
63 | *.vspscc
64 | *.vssscc
65 | .builds
66 | *.pidb
67 | *.svclog
68 | *.scc
69 |
70 | # Chutzpah Test files
71 | _Chutzpah*
72 |
73 | # Visual C++ cache files
74 | ipch/
75 | *.aps
76 | *.ncb
77 | *.opensdf
78 | *.sdf
79 | *.cachefile
80 |
81 | # Visual Studio profiler
82 | *.psess
83 | *.vsp
84 | *.vspx
85 |
86 | # TFS 2012 Local Workspace
87 | $tf/
88 |
89 | # Guidance Automation Toolkit
90 | *.gpState
91 |
92 | # ReSharper is a .NET coding add-in
93 | _ReSharper*/
94 | *.[Rr]e[Ss]harper
95 | *.DotSettings.user
96 |
97 | # JustCode is a .NET coding add-in
98 | .JustCode
99 |
100 | # TeamCity is a build add-in
101 | _TeamCity*
102 |
103 | # DotCover is a Code Coverage Tool
104 | *.dotCover
105 |
106 | # NCrunch
107 | _NCrunch_*
108 | .*crunch*.local.xml
109 |
110 | # MightyMoose
111 | *.mm.*
112 | AutoTest.Net/
113 |
114 | # Web workbench (sass)
115 | .sass-cache/
116 |
117 | # Installshield output folder
118 | [Ee]xpress/
119 |
120 | # DocProject is a documentation generator add-in
121 | DocProject/buildhelp/
122 | DocProject/Help/*.HxT
123 | DocProject/Help/*.HxC
124 | DocProject/Help/*.hhc
125 | DocProject/Help/*.hhk
126 | DocProject/Help/*.hhp
127 | DocProject/Help/Html2
128 | DocProject/Help/html
129 |
130 | # Click-Once directory
131 | publish/
132 |
133 | # Publish Web Output
134 | *.[Pp]ublish.xml
135 | *.azurePubxml
136 | ## TODO: Comment the next line if you want to checkin your
137 | ## web deploy settings but do note that will include unencrypted
138 | ## passwords
139 | #*.pubxml
140 |
141 | *.publishproj
142 |
143 | # NuGet Packages
144 | *.nupkg
145 | # The packages folder can be ignored because of Package Restore
146 | **/packages/*
147 | # except build/, which is used as an MSBuild target.
148 | !**/packages/build/
149 | # Uncomment if necessary however generally it will be regenerated when needed
150 | #!**/packages/repositories.config
151 |
152 | # Windows Azure Build Output
153 | csx/
154 | *.build.csdef
155 |
156 | # Windows Store app package directory
157 | AppPackages/
158 |
159 | # Visual Studio cache files
160 | # files ending in .cache can be ignored
161 | *.[Cc]ache
162 | # but keep track of directories ending in .cache
163 | !*.[Cc]ache/
164 |
165 | # Others
166 | ClientBin/
167 | [Ss]tyle[Cc]op.*
168 | ~$*
169 | *~
170 | *.dbmdl
171 | *.dbproj.schemaview
172 | *.pfx
173 | *.publishsettings
174 | node_modules/
175 | orleans.codegen.cs
176 |
177 | # RIA/Silverlight projects
178 | Generated_Code/
179 |
180 | # Backup & report files from converting an old project file
181 | # to a newer Visual Studio version. Backup files are not needed,
182 | # because we have git ;-)
183 | _UpgradeReport_Files/
184 | Backup*/
185 | UpgradeLog*.XML
186 | UpgradeLog*.htm
187 |
188 | # SQL Server files
189 | *.mdf
190 | *.ldf
191 |
192 | # Business Intelligence projects
193 | *.rdl.data
194 | *.bim.layout
195 | *.bim_*.settings
196 |
197 | # Microsoft Fakes
198 | FakesAssemblies/
199 |
200 | # Node.js Tools for Visual Studio
201 | .ntvs_analysis.dat
202 |
203 | # Visual Studio 6 build log
204 | *.plg
205 |
206 | # Visual Studio 6 workspace options file
207 | *.opt
208 |
209 | # LightSwitch generated files
210 | GeneratedArtifacts/
211 | _Pvt_Extensions/
212 | ModelManifest.xml
213 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/ICoder.cs:
--------------------------------------------------------------------------------
1 | // ICoder.h
2 |
3 | using System;
4 |
5 | namespace SevenZip
6 | {
7 | ///
8 | /// The exception that is thrown when an error in input stream occurs during decoding.
9 | ///
10 | class DataErrorException : ApplicationException
11 | {
12 | public DataErrorException(): base("Data Error") { }
13 | }
14 |
15 | ///
16 | /// The exception that is thrown when the value of an argument is outside the allowable range.
17 | ///
18 | class InvalidParamException : ApplicationException
19 | {
20 | public InvalidParamException(): base("Invalid Parameter") { }
21 | }
22 |
23 | public interface ICodeProgress
24 | {
25 | ///
26 | /// Callback progress.
27 | ///
28 | ///
29 | /// input size. -1 if unknown.
30 | ///
31 | ///
32 | /// output size. -1 if unknown.
33 | ///
34 | void SetProgress(Int64 inSize, Int64 outSize);
35 | };
36 |
37 | public interface ICoder
38 | {
39 | ///
40 | /// Codes streams.
41 | ///
42 | ///
43 | /// input Stream.
44 | ///
45 | ///
46 | /// output Stream.
47 | ///
48 | ///
49 | /// input Size. -1 if unknown.
50 | ///
51 | ///
52 | /// output Size. -1 if unknown.
53 | ///
54 | ///
55 | /// callback progress reference.
56 | ///
57 | ///
58 | /// if input stream is not valid
59 | ///
60 | void Code(System.IO.Stream inStream, System.IO.Stream outStream,
61 | Int64 inSize, Int64 outSize, ICodeProgress progress);
62 | };
63 |
64 | /*
65 | public interface ICoder2
66 | {
67 | void Code(ISequentialInStream []inStreams,
68 | const UInt64 []inSizes,
69 | ISequentialOutStream []outStreams,
70 | UInt64 []outSizes,
71 | ICodeProgress progress);
72 | };
73 | */
74 |
75 | ///
76 | /// Provides the fields that represent properties idenitifiers for compressing.
77 | ///
78 | public enum CoderPropID
79 | {
80 | ///
81 | /// Specifies default property.
82 | ///
83 | DefaultProp = 0,
84 | ///
85 | /// Specifies size of dictionary.
86 | ///
87 | DictionarySize,
88 | ///
89 | /// Specifies size of memory for PPM*.
90 | ///
91 | UsedMemorySize,
92 | ///
93 | /// Specifies order for PPM methods.
94 | ///
95 | Order,
96 | ///
97 | /// Specifies Block Size.
98 | ///
99 | BlockSize,
100 | ///
101 | /// Specifies number of postion state bits for LZMA (0 <= x <= 4).
102 | ///
103 | PosStateBits,
104 | ///
105 | /// Specifies number of literal context bits for LZMA (0 <= x <= 8).
106 | ///
107 | LitContextBits,
108 | ///
109 | /// Specifies number of literal position bits for LZMA (0 <= x <= 4).
110 | ///
111 | LitPosBits,
112 | ///
113 | /// Specifies number of fast bytes for LZ*.
114 | ///
115 | NumFastBytes,
116 | ///
117 | /// Specifies match finder. LZMA: "BT2", "BT4" or "BT4B".
118 | ///
119 | MatchFinder,
120 | ///
121 | /// Specifies the number of match finder cyckes.
122 | ///
123 | MatchFinderCycles,
124 | ///
125 | /// Specifies number of passes.
126 | ///
127 | NumPasses,
128 | ///
129 | /// Specifies number of algorithm.
130 | ///
131 | Algorithm,
132 | ///
133 | /// Specifies the number of threads.
134 | ///
135 | NumThreads,
136 | ///
137 | /// Specifies mode with end marker.
138 | ///
139 | EndMarker
140 | };
141 |
142 |
143 | public interface ISetCoderProperties
144 | {
145 | void SetCoderProperties(CoderPropID[] propIDs, object[] properties);
146 | };
147 |
148 | public interface IWriteCoderProperties
149 | {
150 | void WriteCoderProperties(System.IO.Stream outStream);
151 | }
152 |
153 | public interface ISetDecoderProperties
154 | {
155 | void SetDecoderProperties(byte[] properties);
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Compress/LZ/LzInWindow.cs:
--------------------------------------------------------------------------------
1 | // LzInWindow.cs
2 |
3 | using System;
4 |
5 | namespace SevenZip.Compression.LZ
6 | {
7 | public class InWindow
8 | {
9 | public Byte[] _bufferBase = null; // pointer to buffer with data
10 | System.IO.Stream _stream;
11 | UInt32 _posLimit; // offset (from _buffer) of first byte when new block reading must be done
12 | bool _streamEndWasReached; // if (true) then _streamPos shows real end of stream
13 |
14 | UInt32 _pointerToLastSafePosition;
15 |
16 | public UInt32 _bufferOffset;
17 |
18 | public UInt32 _blockSize; // Size of Allocated memory block
19 | public UInt32 _pos; // offset (from _buffer) of curent byte
20 | UInt32 _keepSizeBefore; // how many BYTEs must be kept in buffer before _pos
21 | UInt32 _keepSizeAfter; // how many BYTEs must be kept buffer after _pos
22 | public UInt32 _streamPos; // offset (from _buffer) of first not read byte from Stream
23 |
24 | public void MoveBlock()
25 | {
26 | UInt32 offset = (UInt32)(_bufferOffset) + _pos - _keepSizeBefore;
27 | // we need one additional byte, since MovePos moves on 1 byte.
28 | if (offset > 0)
29 | offset--;
30 |
31 | UInt32 numBytes = (UInt32)(_bufferOffset) + _streamPos - offset;
32 |
33 | // check negative offset ????
34 | for (UInt32 i = 0; i < numBytes; i++)
35 | _bufferBase[i] = _bufferBase[offset + i];
36 | _bufferOffset -= offset;
37 | }
38 |
39 | public virtual void ReadBlock()
40 | {
41 | if (_streamEndWasReached)
42 | return;
43 | while (true)
44 | {
45 | int size = (int)((0 - _bufferOffset) + _blockSize - _streamPos);
46 | if (size == 0)
47 | return;
48 | int numReadBytes = _stream.Read(_bufferBase, (int)(_bufferOffset + _streamPos), size);
49 | if (numReadBytes == 0)
50 | {
51 | _posLimit = _streamPos;
52 | UInt32 pointerToPostion = _bufferOffset + _posLimit;
53 | if (pointerToPostion > _pointerToLastSafePosition)
54 | _posLimit = (UInt32)(_pointerToLastSafePosition - _bufferOffset);
55 |
56 | _streamEndWasReached = true;
57 | return;
58 | }
59 | _streamPos += (UInt32)numReadBytes;
60 | if (_streamPos >= _pos + _keepSizeAfter)
61 | _posLimit = _streamPos - _keepSizeAfter;
62 | }
63 | }
64 |
65 | void Free() { _bufferBase = null; }
66 |
67 | public void Create(UInt32 keepSizeBefore, UInt32 keepSizeAfter, UInt32 keepSizeReserv)
68 | {
69 | _keepSizeBefore = keepSizeBefore;
70 | _keepSizeAfter = keepSizeAfter;
71 | UInt32 blockSize = keepSizeBefore + keepSizeAfter + keepSizeReserv;
72 | if (_bufferBase == null || _blockSize != blockSize)
73 | {
74 | Free();
75 | _blockSize = blockSize;
76 | _bufferBase = new Byte[_blockSize];
77 | }
78 | _pointerToLastSafePosition = _blockSize - keepSizeAfter;
79 | }
80 |
81 | public void SetStream(System.IO.Stream stream) { _stream = stream; }
82 | public void ReleaseStream() { _stream = null; }
83 |
84 | public void Init()
85 | {
86 | _bufferOffset = 0;
87 | _pos = 0;
88 | _streamPos = 0;
89 | _streamEndWasReached = false;
90 | ReadBlock();
91 | }
92 |
93 | public void MovePos()
94 | {
95 | _pos++;
96 | if (_pos > _posLimit)
97 | {
98 | UInt32 pointerToPostion = _bufferOffset + _pos;
99 | if (pointerToPostion > _pointerToLastSafePosition)
100 | MoveBlock();
101 | ReadBlock();
102 | }
103 | }
104 |
105 | public Byte GetIndexByte(Int32 index) { return _bufferBase[_bufferOffset + _pos + index]; }
106 |
107 | // index + limit have not to exceed _keepSizeAfter;
108 | public UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit)
109 | {
110 | if (_streamEndWasReached)
111 | if ((_pos + index) + limit > _streamPos)
112 | limit = _streamPos - (UInt32)(_pos + index);
113 | distance++;
114 | // Byte *pby = _buffer + (size_t)_pos + index;
115 | UInt32 pby = _bufferOffset + _pos + (UInt32)index;
116 |
117 | UInt32 i;
118 | for (i = 0; i < limit && _bufferBase[pby + i] == _bufferBase[pby + i - distance]; i++);
119 | return i;
120 | }
121 |
122 | public UInt32 GetNumAvailableBytes() { return _streamPos - _pos; }
123 |
124 | public void ReduceOffsets(Int32 subValue)
125 | {
126 | _bufferOffset += (UInt32)subValue;
127 | _posLimit -= (UInt32)subValue;
128 | _pos -= (UInt32)subValue;
129 | _streamPos -= (UInt32)subValue;
130 | }
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/SevenZipHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 |
5 | namespace SevenZip.Compression.LZMA
6 | {
7 | public static class SevenZipHelper
8 | {
9 |
10 | static int dictionary = 1 << 23;
11 |
12 | // static Int32 posStateBits = 2;
13 | // static Int32 litContextBits = 3; // for normal files
14 | // UInt32 litContextBits = 0; // for 32-bit data
15 | // static Int32 litPosBits = 0;
16 | // UInt32 litPosBits = 2; // for 32-bit data
17 | // static Int32 algorithm = 2;
18 | // static Int32 numFastBytes = 128;
19 |
20 | static bool eos = false;
21 |
22 |
23 |
24 |
25 |
26 | static CoderPropID[] propIDs =
27 | {
28 | CoderPropID.DictionarySize,
29 | CoderPropID.PosStateBits,
30 | CoderPropID.LitContextBits,
31 | CoderPropID.LitPosBits,
32 | CoderPropID.Algorithm,
33 | CoderPropID.NumFastBytes,
34 | CoderPropID.MatchFinder,
35 | CoderPropID.EndMarker
36 | };
37 |
38 | // these are the default properties, keeping it simple for now:
39 | static object[] properties =
40 | {
41 | (Int32)(dictionary),
42 | (Int32)(2),
43 | (Int32)(3),
44 | (Int32)(0),
45 | (Int32)(2),
46 | (Int32)(128),
47 | "bt4",
48 | eos
49 | };
50 |
51 |
52 | public static byte[] Compress(byte[] inputBytes)
53 | {
54 |
55 | MemoryStream inStream = new MemoryStream(inputBytes);
56 | MemoryStream outStream = new MemoryStream();
57 | SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder();
58 | encoder.SetCoderProperties(propIDs, properties);
59 | encoder.WriteCoderProperties(outStream);
60 | long fileSize = inStream.Length;
61 | for (int i = 0; i < 8; i++)
62 | outStream.WriteByte((Byte)(fileSize >> (8 * i)));
63 | encoder.Code(inStream, outStream, -1, -1, null);
64 | return outStream.ToArray();
65 | }
66 |
67 | public static byte[] Decompress(byte[] inputBytes)
68 | {
69 | MemoryStream newInStream = new MemoryStream(inputBytes);
70 |
71 | SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
72 |
73 | newInStream.Seek(0, 0);
74 | MemoryStream newOutStream = new MemoryStream();
75 |
76 | byte[] properties2 = new byte[5];
77 | if (newInStream.Read(properties2, 0, 5) != 5)
78 | throw (new Exception("input .lzma is too short"));
79 | long outSize = 0;
80 | for (int i = 0; i < 8; i++)
81 | {
82 | int v = newInStream.ReadByte();
83 | if (v < 0)
84 | throw (new Exception("Can't Read 1"));
85 | outSize |= ((long)(byte)v) << (8 * i);
86 | }
87 | decoder.SetDecoderProperties(properties2);
88 |
89 | long compressedSize = newInStream.Length - newInStream.Position;
90 | decoder.Code(newInStream, newOutStream, compressedSize, outSize, null);
91 |
92 | byte[] b = newOutStream.ToArray();
93 |
94 | return b;
95 | }
96 |
97 |
98 | public static MemoryStream StreamDecompress(MemoryStream newInStream)
99 | {
100 | SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
101 |
102 | newInStream.Seek(0, 0);
103 | MemoryStream newOutStream = new MemoryStream();
104 |
105 | byte[] properties2 = new byte[5];
106 | if (newInStream.Read(properties2, 0, 5) != 5)
107 | throw (new Exception("input .lzma is too short"));
108 | long outSize = 0;
109 | for (int i = 0; i < 8; i++)
110 | {
111 | int v = newInStream.ReadByte();
112 | if (v < 0)
113 | throw (new Exception("Can't Read 1"));
114 | outSize |= ((long)(byte)v) << (8 * i);
115 | }
116 | decoder.SetDecoderProperties(properties2);
117 |
118 | long compressedSize = newInStream.Length - newInStream.Position;
119 | decoder.Code(newInStream, newOutStream, compressedSize, outSize, null);
120 |
121 | newOutStream.Position = 0;
122 | return newOutStream;
123 | }
124 |
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/AssetStudio/ExportOptions.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.ComponentModel;
36 | using System.Data;
37 | using System.Drawing;
38 | using System.IO;
39 | using System.Linq;
40 | using System.Text;
41 | using System.Windows.Forms;
42 |
43 | namespace AssetStudio
44 | {
45 | public partial class ExportOptions : Form
46 | {
47 | public string selectedPath = "";
48 |
49 | public ExportOptions()
50 | {
51 | InitializeComponent();
52 | exportNormals.Checked = (bool)Properties.Settings.Default["exportNormals"];
53 | exportTangents.Checked = (bool)Properties.Settings.Default["exportTangents"];
54 | exportUVs.Checked = (bool)Properties.Settings.Default["exportUVs"];
55 | exportColors.Checked = (bool)Properties.Settings.Default["exportColors"];
56 | exportDeformers.Checked = (bool)Properties.Settings.Default["exportDeformers"];
57 | convertDummies.Checked = (bool)Properties.Settings.Default["convertDummies"];
58 | convertDummies.Enabled = (bool)Properties.Settings.Default["exportDeformers"];
59 | scaleFactor.Value = (decimal)Properties.Settings.Default["scaleFactor"];
60 | upAxis.SelectedIndex = (int)Properties.Settings.Default["upAxis"];
61 | showExpOpt.Checked = (bool)Properties.Settings.Default["showExpOpt"];
62 | }
63 |
64 | private void exportOpnions_CheckedChanged(object sender, EventArgs e)
65 | {
66 | Properties.Settings.Default[((CheckBox)sender).Name] = ((CheckBox)sender).Checked;
67 | Properties.Settings.Default.Save();
68 | }
69 |
70 | private void fbxOKbutton_Click(object sender, EventArgs e)
71 | {
72 | Properties.Settings.Default["exportNormals"] = exportNormals.Checked;
73 | Properties.Settings.Default["exportTangents"] = exportTangents.Checked;
74 | Properties.Settings.Default["exportUVs"] = exportUVs.Checked;
75 | Properties.Settings.Default["exportColors"] = exportColors.Checked;
76 | Properties.Settings.Default["exportDeformers"] = exportDeformers.Checked;
77 | Properties.Settings.Default["scaleFactor"] = scaleFactor.Value;
78 | Properties.Settings.Default["upAxis"] = upAxis.SelectedIndex;
79 | this.DialogResult = DialogResult.OK;
80 | this.Close();
81 | }
82 |
83 | private void fbxCancel_Click(object sender, EventArgs e)
84 | {
85 | this.DialogResult = DialogResult.Cancel;
86 | this.Close();
87 | }
88 |
89 | private void exportDeformers_CheckedChanged(object sender, EventArgs e)
90 | {
91 | exportOpnions_CheckedChanged(sender, e);
92 | convertDummies.Enabled = exportDeformers.Checked;
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/GameObject.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 | using System.Windows.Forms;
38 |
39 | namespace AssetStudio
40 | {
41 | public class GameObject : TreeNode
42 | {
43 | public PPtr m_Transform;
44 | public PPtr m_Renderer;
45 | public PPtr m_MeshFilter;
46 | public PPtr m_SkinnedMeshRenderer;
47 | public int m_Layer;
48 | public string m_Name;
49 | public ushort m_Tag;
50 | public bool m_IsActive;
51 |
52 | public string uniqueID = "0";//this way file and folder TreeNodes will be treated as FBX scene
53 |
54 | public GameObject(AssetPreloadData preloadData)
55 | {
56 | if (preloadData != null)
57 | {
58 | var sourceFile = preloadData.sourceFile;
59 | var a_Stream = preloadData.sourceFile.a_Stream;
60 | a_Stream.Position = preloadData.Offset;
61 |
62 | uniqueID = preloadData.uniqueID;
63 |
64 | if (sourceFile.platform == -2)
65 | {
66 | uint m_ObjectHideFlags = a_Stream.ReadUInt32();
67 | PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
68 | PPtr m_PrefabInternal = sourceFile.ReadPPtr();
69 | }
70 |
71 | int m_Component_size = a_Stream.ReadInt32();
72 | for (int j = 0; j < m_Component_size; j++)
73 | {
74 | int m_Component_type = a_Stream.ReadInt32();
75 |
76 | switch (m_Component_type)
77 | {
78 | case 4:
79 | m_Transform = sourceFile.ReadPPtr();
80 | break;
81 | case 23:
82 | m_Renderer = sourceFile.ReadPPtr();
83 | break;
84 | case 33:
85 | m_MeshFilter = sourceFile.ReadPPtr();
86 | break;
87 | case 137:
88 | m_SkinnedMeshRenderer = sourceFile.ReadPPtr();
89 | break;
90 | default:
91 | PPtr m_Component = sourceFile.ReadPPtr();
92 | break;
93 | }
94 | }
95 |
96 | m_Layer = a_Stream.ReadInt32();
97 | int namesize = a_Stream.ReadInt32();
98 | m_Name = a_Stream.ReadAlignedString(namesize);
99 | if (m_Name == "") { m_Name = "GameObject #" + uniqueID; }
100 | m_Tag = a_Stream.ReadUInt16();
101 | m_IsActive = a_Stream.ReadBoolean();
102 |
103 | base.Text = m_Name;
104 | //name should be unique
105 | base.Name = uniqueID;
106 | }
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Compress/RangeCoder/RangeCoder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SevenZip.Compression.RangeCoder
4 | {
5 | class Encoder
6 | {
7 | public const uint kTopValue = (1 << 24);
8 |
9 | System.IO.Stream Stream;
10 |
11 | public UInt64 Low;
12 | public uint Range;
13 | uint _cacheSize;
14 | byte _cache;
15 |
16 | long StartPosition;
17 |
18 | public void SetStream(System.IO.Stream stream)
19 | {
20 | Stream = stream;
21 | }
22 |
23 | public void ReleaseStream()
24 | {
25 | Stream = null;
26 | }
27 |
28 | public void Init()
29 | {
30 | StartPosition = Stream.Position;
31 |
32 | Low = 0;
33 | Range = 0xFFFFFFFF;
34 | _cacheSize = 1;
35 | _cache = 0;
36 | }
37 |
38 | public void FlushData()
39 | {
40 | for (int i = 0; i < 5; i++)
41 | ShiftLow();
42 | }
43 |
44 | public void FlushStream()
45 | {
46 | Stream.Flush();
47 | }
48 |
49 | public void CloseStream()
50 | {
51 | Stream.Close();
52 | }
53 |
54 | public void Encode(uint start, uint size, uint total)
55 | {
56 | Low += start * (Range /= total);
57 | Range *= size;
58 | while (Range < kTopValue)
59 | {
60 | Range <<= 8;
61 | ShiftLow();
62 | }
63 | }
64 |
65 | public void ShiftLow()
66 | {
67 | if ((uint)Low < (uint)0xFF000000 || (uint)(Low >> 32) == 1)
68 | {
69 | byte temp = _cache;
70 | do
71 | {
72 | Stream.WriteByte((byte)(temp + (Low >> 32)));
73 | temp = 0xFF;
74 | }
75 | while (--_cacheSize != 0);
76 | _cache = (byte)(((uint)Low) >> 24);
77 | }
78 | _cacheSize++;
79 | Low = ((uint)Low) << 8;
80 | }
81 |
82 | public void EncodeDirectBits(uint v, int numTotalBits)
83 | {
84 | for (int i = numTotalBits - 1; i >= 0; i--)
85 | {
86 | Range >>= 1;
87 | if (((v >> i) & 1) == 1)
88 | Low += Range;
89 | if (Range < kTopValue)
90 | {
91 | Range <<= 8;
92 | ShiftLow();
93 | }
94 | }
95 | }
96 |
97 | public void EncodeBit(uint size0, int numTotalBits, uint symbol)
98 | {
99 | uint newBound = (Range >> numTotalBits) * size0;
100 | if (symbol == 0)
101 | Range = newBound;
102 | else
103 | {
104 | Low += newBound;
105 | Range -= newBound;
106 | }
107 | while (Range < kTopValue)
108 | {
109 | Range <<= 8;
110 | ShiftLow();
111 | }
112 | }
113 |
114 | public long GetProcessedSizeAdd()
115 | {
116 | return _cacheSize +
117 | Stream.Position - StartPosition + 4;
118 | // (long)Stream.GetProcessedSize();
119 | }
120 | }
121 |
122 | class Decoder
123 | {
124 | public const uint kTopValue = (1 << 24);
125 | public uint Range;
126 | public uint Code;
127 | // public Buffer.InBuffer Stream = new Buffer.InBuffer(1 << 16);
128 | public System.IO.Stream Stream;
129 |
130 | public void Init(System.IO.Stream stream)
131 | {
132 | // Stream.Init(stream);
133 | Stream = stream;
134 |
135 | Code = 0;
136 | Range = 0xFFFFFFFF;
137 | for (int i = 0; i < 5; i++)
138 | Code = (Code << 8) | (byte)Stream.ReadByte();
139 | }
140 |
141 | public void ReleaseStream()
142 | {
143 | // Stream.ReleaseStream();
144 | Stream = null;
145 | }
146 |
147 | public void CloseStream()
148 | {
149 | Stream.Close();
150 | }
151 |
152 | public void Normalize()
153 | {
154 | while (Range < kTopValue)
155 | {
156 | Code = (Code << 8) | (byte)Stream.ReadByte();
157 | Range <<= 8;
158 | }
159 | }
160 |
161 | public void Normalize2()
162 | {
163 | if (Range < kTopValue)
164 | {
165 | Code = (Code << 8) | (byte)Stream.ReadByte();
166 | Range <<= 8;
167 | }
168 | }
169 |
170 | public uint GetThreshold(uint total)
171 | {
172 | return Code / (Range /= total);
173 | }
174 |
175 | public void Decode(uint start, uint size, uint total)
176 | {
177 | Code -= start * Range;
178 | Range *= size;
179 | Normalize();
180 | }
181 |
182 | public uint DecodeDirectBits(int numTotalBits)
183 | {
184 | uint range = Range;
185 | uint code = Code;
186 | uint result = 0;
187 | for (int i = numTotalBits; i > 0; i--)
188 | {
189 | range >>= 1;
190 | /*
191 | result <<= 1;
192 | if (code >= range)
193 | {
194 | code -= range;
195 | result |= 1;
196 | }
197 | */
198 | uint t = (code - range) >> 31;
199 | code -= range & (t - 1);
200 | result = (result << 1) | (1 - t);
201 |
202 | if (range < kTopValue)
203 | {
204 | code = (code << 8) | (byte)Stream.ReadByte();
205 | range <<= 8;
206 | }
207 | }
208 | Range = range;
209 | Code = code;
210 | return result;
211 | }
212 |
213 | public uint DecodeBit(uint size0, int numTotalBits)
214 | {
215 | uint newBound = (Range >> numTotalBits) * size0;
216 | uint symbol;
217 | if (Code < newBound)
218 | {
219 | symbol = 0;
220 | Range = newBound;
221 | }
222 | else
223 | {
224 | symbol = 1;
225 | Code -= newBound;
226 | Range -= newBound;
227 | }
228 | Normalize();
229 | return symbol;
230 | }
231 |
232 | // ulong GetProcessedSize() {return Stream.GetProcessedSize(); }
233 | }
234 | }
235 |
--------------------------------------------------------------------------------
/AssetStudio/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | //------------------------------------------------------------------------------
34 | //
35 | // This code was generated by a tool.
36 | // Runtime Version:4.0.30319.42000
37 | //
38 | // Changes to this file may cause incorrect behavior and will be lost if
39 | // the code is regenerated.
40 | //
41 | //------------------------------------------------------------------------------
42 |
43 | namespace AssetStudio.Properties {
44 | using System;
45 |
46 |
47 | ///
48 | /// A strongly-typed resource class, for looking up localized strings, etc.
49 | ///
50 | // This class was auto-generated by the StronglyTypedResourceBuilder
51 | // class via a tool like ResGen or Visual Studio.
52 | // To add or remove a member, edit your .ResX file then rerun ResGen
53 | // with the /str option, or rebuild your VS project.
54 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
55 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
56 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
57 | internal class Resources {
58 |
59 | private static global::System.Resources.ResourceManager resourceMan;
60 |
61 | private static global::System.Globalization.CultureInfo resourceCulture;
62 |
63 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
64 | internal Resources() {
65 | }
66 |
67 | ///
68 | /// Returns the cached ResourceManager instance used by this class.
69 | ///
70 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
71 | internal static global::System.Resources.ResourceManager ResourceManager {
72 | get {
73 | if (object.ReferenceEquals(resourceMan, null)) {
74 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AssetStudio.Properties.Resources", typeof(Resources).Assembly);
75 | resourceMan = temp;
76 | }
77 | return resourceMan;
78 | }
79 | }
80 |
81 | ///
82 | /// Overrides the current thread's CurrentUICulture property for all
83 | /// resource lookups using this strongly typed resource class.
84 | ///
85 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
86 | internal static global::System.Globalization.CultureInfo Culture {
87 | get {
88 | return resourceCulture;
89 | }
90 | set {
91 | resourceCulture = value;
92 | }
93 | }
94 |
95 | ///
96 | /// Looks up a localized resource of type System.Drawing.Bitmap.
97 | ///
98 | internal static System.Drawing.Bitmap preview {
99 | get {
100 | object obj = ResourceManager.GetObject("preview", resourceCulture);
101 | return ((System.Drawing.Bitmap)(obj));
102 | }
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/AssetStudio/AboutBox1.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.ComponentModel;
36 | using System.Drawing;
37 | using System.Linq;
38 | using System.Reflection;
39 | using System.Windows.Forms;
40 |
41 | namespace Unity_Studio
42 | {
43 | partial class AboutBox1 : Form
44 | {
45 | public AboutBox1()
46 | {
47 | InitializeComponent();
48 | this.Text = String.Format("About {0}", AssemblyTitle);
49 | this.labelProductName.Text = AssemblyProduct;
50 | this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
51 | this.labelCopyright.Text = AssemblyCopyright;
52 | this.labelCompanyName.Text = AssemblyCompany;
53 | this.textBoxDescription.Text = AssemblyDescription;
54 | }
55 |
56 | #region Assembly Attribute Accessors
57 |
58 | public string AssemblyTitle
59 | {
60 | get
61 | {
62 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
63 | if (attributes.Length > 0)
64 | {
65 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
66 | if (titleAttribute.Title != "")
67 | {
68 | return titleAttribute.Title;
69 | }
70 | }
71 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
72 | }
73 | }
74 |
75 | public string AssemblyVersion
76 | {
77 | get
78 | {
79 | return Assembly.GetExecutingAssembly().GetName().Version.ToString();
80 | }
81 | }
82 |
83 | public string AssemblyDescription
84 | {
85 | get
86 | {
87 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
88 | if (attributes.Length == 0)
89 | {
90 | return "";
91 | }
92 | return ((AssemblyDescriptionAttribute)attributes[0]).Description;
93 | }
94 | }
95 |
96 | public string AssemblyProduct
97 | {
98 | get
99 | {
100 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
101 | if (attributes.Length == 0)
102 | {
103 | return "";
104 | }
105 | return ((AssemblyProductAttribute)attributes[0]).Product;
106 | }
107 | }
108 |
109 | public string AssemblyCopyright
110 | {
111 | get
112 | {
113 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
114 | if (attributes.Length == 0)
115 | {
116 | return "";
117 | }
118 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
119 | }
120 | }
121 |
122 | public string AssemblyCompany
123 | {
124 | get
125 | {
126 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
127 | if (attributes.Length == 0)
128 | {
129 | return "";
130 | }
131 | return ((AssemblyCompanyAttribute)attributes[0]).Company;
132 | }
133 | }
134 | #endregion
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/AssetStudio/AboutBox.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.ComponentModel;
36 | using System.Drawing;
37 | using System.Linq;
38 | using System.Reflection;
39 | using System.Windows.Forms;
40 |
41 | namespace AssetStudio
42 | {
43 | partial class AboutBox : Form
44 | {
45 | public AboutBox()
46 | {
47 | InitializeComponent();
48 | this.Text = String.Format("About {0}", AssemblyTitle);
49 | this.labelProductName.Text = AssemblyProduct;
50 | this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
51 | this.labelCopyright.Text = AssemblyCopyright;
52 | this.labelCompanyName.Text = AssemblyCompany;
53 | this.textBoxDescription.Text = AssemblyDescription;
54 | }
55 |
56 | #region Assembly Attribute Accessors
57 |
58 | public string AssemblyTitle
59 | {
60 | get
61 | {
62 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
63 | if (attributes.Length > 0)
64 | {
65 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
66 | if (titleAttribute.Title != "")
67 | {
68 | return titleAttribute.Title;
69 | }
70 | }
71 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
72 | }
73 | }
74 |
75 | public string AssemblyVersion
76 | {
77 | get
78 | {
79 | return Assembly.GetExecutingAssembly().GetName().Version.ToString();
80 | }
81 | }
82 |
83 | public string AssemblyDescription
84 | {
85 | get
86 | {
87 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
88 | if (attributes.Length == 0)
89 | {
90 | return "";
91 | }
92 | return ((AssemblyDescriptionAttribute)attributes[0]).Description;
93 | }
94 | }
95 |
96 | public string AssemblyProduct
97 | {
98 | get
99 | {
100 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
101 | if (attributes.Length == 0)
102 | {
103 | return "";
104 | }
105 | return ((AssemblyProductAttribute)attributes[0]).Product;
106 | }
107 | }
108 |
109 | public string AssemblyCopyright
110 | {
111 | get
112 | {
113 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
114 | if (attributes.Length == 0)
115 | {
116 | return "";
117 | }
118 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
119 | }
120 | }
121 |
122 | public string AssemblyCompany
123 | {
124 | get
125 | {
126 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
127 | if (attributes.Length == 0)
128 | {
129 | return "";
130 | }
131 | return ((AssemblyCompanyAttribute)attributes[0]).Company;
132 | }
133 | }
134 | #endregion
135 |
136 | private void okButton_Click(object sender, EventArgs e)
137 | {
138 | this.Close();
139 | }
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/AssetStudio/helpers.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 | using System.Text.RegularExpressions;
38 |
39 | namespace AssetStudio
40 | {
41 | public class PPtr
42 | {
43 | //m_FileID 0 means current file
44 | public int m_FileID = -1;
45 | //m_PathID acts more like a hash in some games
46 | public long m_PathID = 0;
47 | }
48 |
49 | public static class PPtrHelpers
50 | {
51 | public static PPtr ReadPPtr(this AssetsFile sourceFile)
52 | {
53 | PPtr result = new PPtr();
54 | var a_Stream = sourceFile.a_Stream;
55 |
56 | int FileID = a_Stream.ReadInt32();
57 | if (FileID >= 0 && FileID < sourceFile.sharedAssetsList.Count)
58 | { result.m_FileID = sourceFile.sharedAssetsList[FileID].Index; }
59 |
60 | if (sourceFile.fileGen < 14) { result.m_PathID = a_Stream.ReadInt32(); }
61 | else { result.m_PathID = a_Stream.ReadInt64(); }
62 |
63 | return result;
64 | }
65 |
66 | public static bool TryGetPD(this List assetsfileList, PPtr m_elm, out AssetPreloadData result)
67 | {
68 | result = null;
69 |
70 | if (m_elm != null && m_elm.m_FileID >= 0 && m_elm.m_FileID < assetsfileList.Count)
71 | {
72 | AssetsFile sourceFile = assetsfileList[m_elm.m_FileID];
73 |
74 | //TryGetValue should be safe because m_PathID is 0 when initialized and PathID values range from 1
75 | if (sourceFile.preloadTable.TryGetValue(m_elm.m_PathID, out result)) { return true; }
76 | }
77 |
78 | return false;
79 | }
80 |
81 | public static bool TryGetTransform(this List assetsfileList, PPtr m_elm, out Transform m_Transform)
82 | {
83 | m_Transform = null;
84 |
85 | if (m_elm != null && m_elm.m_FileID >= 0 && m_elm.m_FileID < assetsfileList.Count)
86 | {
87 | AssetsFile sourceFile = assetsfileList[m_elm.m_FileID];
88 |
89 | if (sourceFile.TransformList.TryGetValue(m_elm.m_PathID, out m_Transform)) { return true; }
90 | }
91 |
92 | return false;
93 | }
94 |
95 | public static bool TryGetGameObject(this List assetsfileList, PPtr m_elm, out GameObject m_GameObject)
96 | {
97 | m_GameObject = null;
98 |
99 | if (m_elm != null && m_elm.m_FileID >= 0 && m_elm.m_FileID < assetsfileList.Count)
100 | {
101 | AssetsFile sourceFile = assetsfileList[m_elm.m_FileID];
102 |
103 | if (sourceFile.GameObjectList.TryGetValue(m_elm.m_PathID, out m_GameObject)) { return true; }
104 | }
105 |
106 | return false;
107 | }
108 | }
109 |
110 | class TexEnv
111 | {
112 | public string name;
113 | public PPtr m_Texture;
114 | public float[] m_Scale;
115 | public float[] m_Offset;
116 | }
117 |
118 | class strFloatPair
119 | {
120 | public string first;
121 | public float second;
122 | }
123 |
124 | class strColorPair
125 | {
126 | public string first;
127 | public float[] second;
128 | }
129 |
130 | public static class StringExtensions
131 | {
132 | ///
133 | /// Compares the string against a given pattern.
134 | ///
135 | /// The string.
136 | /// The pattern to match, where "*" means any sequence of characters, and "?" means any single character.
137 | /// true if the string matches the given pattern; otherwise false.
138 | public static bool Like(this string str, string pattern)
139 | {
140 | return new Regex(
141 | "^" + Regex.Escape(pattern).Replace(@"\*", ".*").Replace(@"\?", ".") + "$",
142 | RegexOptions.IgnoreCase | RegexOptions.Singleline
143 | ).IsMatch(str);
144 | }
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/Material.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | class Material
41 | {
42 |
43 | public string m_Name;
44 | public PPtr m_Shader;
45 | public string[] m_ShaderKeywords;
46 | public int m_CustomRenderQueue;
47 | public TexEnv[] m_TexEnvs;
48 | public strFloatPair[] m_Floats;
49 | public strColorPair[] m_Colors;
50 |
51 | public Material(AssetPreloadData preloadData)
52 | {
53 | var sourceFile = preloadData.sourceFile;
54 | var a_Stream = preloadData.sourceFile.a_Stream;
55 | a_Stream.Position = preloadData.Offset;
56 |
57 | if (sourceFile.platform == -2)
58 | {
59 | uint m_ObjectHideFlags = a_Stream.ReadUInt32();
60 | PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
61 | PPtr m_PrefabInternal = sourceFile.ReadPPtr();
62 | }
63 |
64 | m_Name = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
65 | m_Shader = sourceFile.ReadPPtr();
66 |
67 | if (sourceFile.version[0] == 4 && (sourceFile.version[1] >= 2 || (sourceFile.version[1] == 1 && sourceFile.buildType[0] != "a")))
68 | {
69 | m_ShaderKeywords = new string[a_Stream.ReadInt32()];
70 | for (int i = 0; i < m_ShaderKeywords.Length; i++)
71 | {
72 | m_ShaderKeywords[i] = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
73 | }
74 | }
75 | else if (sourceFile.version[0] == 5)
76 | {
77 | m_ShaderKeywords = new string[1] { a_Stream.ReadAlignedString(a_Stream.ReadInt32()) };
78 | uint m_LightmapFlags = a_Stream.ReadUInt32();
79 | }
80 |
81 | if (sourceFile.version[0] > 4 || (sourceFile.version[0] == 4 && sourceFile.version[1] >= 3)) { m_CustomRenderQueue = a_Stream.ReadInt32(); }
82 |
83 | if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 1)
84 | {
85 | string[][] stringTagMap = new string[a_Stream.ReadInt32()][];
86 | for (int i = 0; i < stringTagMap.Length; i++)
87 | {
88 | stringTagMap[i] = new string[2] { a_Stream.ReadAlignedString(a_Stream.ReadInt32()), a_Stream.ReadAlignedString(a_Stream.ReadInt32()) };
89 | }
90 | }
91 |
92 | //m_SavedProperties
93 | m_TexEnvs = new TexEnv[a_Stream.ReadInt32()];
94 | for (int i = 0; i < m_TexEnvs.Length; i++)
95 | {
96 | TexEnv m_TexEnv = new TexEnv()
97 | {
98 | name = a_Stream.ReadAlignedString(a_Stream.ReadInt32()),
99 | m_Texture = sourceFile.ReadPPtr(),
100 | m_Scale = new float[2] { a_Stream.ReadSingle(), a_Stream.ReadSingle() },
101 | m_Offset = new float[2] { a_Stream.ReadSingle(), a_Stream.ReadSingle() }
102 | };
103 | m_TexEnvs[i] = m_TexEnv;
104 | }
105 |
106 | m_Floats = new strFloatPair[a_Stream.ReadInt32()];
107 | for (int i = 0; i < m_Floats.Length; i++)
108 | {
109 | strFloatPair m_Float = new strFloatPair()
110 | {
111 | first = a_Stream.ReadAlignedString(a_Stream.ReadInt32()),
112 | second = a_Stream.ReadSingle()
113 | };
114 | m_Floats[i] = m_Float;
115 | }
116 |
117 | m_Colors = new strColorPair[a_Stream.ReadInt32()];
118 | for (int i = 0; i < m_Colors.Length; i++)
119 | {
120 | strColorPair m_Color = new strColorPair()
121 | {
122 | first = a_Stream.ReadAlignedString(a_Stream.ReadInt32()),
123 | second = new float[4] { a_Stream.ReadSingle(), a_Stream.ReadSingle(), a_Stream.ReadSingle(), a_Stream.ReadSingle() }
124 | };
125 | m_Colors[i] = m_Color;
126 | }
127 | }
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/AssetStudio/ExportOptions.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/AssetStudio/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\preview.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/SkinnedMeshRenderer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | public class SkinnedMeshRenderer
41 | {
42 | public PPtr m_GameObject;
43 | public bool m_Enabled;
44 | public byte m_CastShadows;
45 | public bool m_ReceiveShadows;
46 | public ushort m_LightmapIndex;
47 | public ushort m_LightmapIndexDynamic;
48 | public PPtr[] m_Materials;
49 | public PPtr m_Mesh;
50 | public PPtr[] m_Bones;
51 |
52 | public SkinnedMeshRenderer(AssetPreloadData preloadData)
53 | {
54 | var sourceFile = preloadData.sourceFile;
55 | var version = preloadData.sourceFile.version;
56 | var a_Stream = preloadData.sourceFile.a_Stream;
57 | a_Stream.Position = preloadData.Offset;
58 |
59 | if (sourceFile.platform == -2)
60 | {
61 | uint m_ObjectHideFlags = a_Stream.ReadUInt32();
62 | PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
63 | PPtr m_PrefabInternal = sourceFile.ReadPPtr();
64 | }
65 |
66 | m_GameObject = sourceFile.ReadPPtr();
67 | if (sourceFile.version[0] < 5)
68 | {
69 | m_Enabled = a_Stream.ReadBoolean();
70 | m_CastShadows = a_Stream.ReadByte();//bool
71 | m_ReceiveShadows = a_Stream.ReadBoolean();
72 | m_LightmapIndex = a_Stream.ReadByte();
73 | }
74 | else
75 | {
76 | m_Enabled = a_Stream.ReadBoolean();
77 | a_Stream.AlignStream(4);
78 | m_CastShadows = a_Stream.ReadByte();
79 | m_ReceiveShadows = a_Stream.ReadBoolean();
80 | a_Stream.AlignStream(4);
81 |
82 | m_LightmapIndex = a_Stream.ReadUInt16();
83 | m_LightmapIndexDynamic = a_Stream.ReadUInt16();
84 | }
85 |
86 | if (version[0] >= 3) { a_Stream.Position += 16; } //m_LightmapTilingOffset vector4d
87 | if (sourceFile.version[0] >= 5) { a_Stream.Position += 16; } //Vector4f m_LightmapTilingOffsetDynamic
88 |
89 | m_Materials = new PPtr[a_Stream.ReadInt32()];
90 | for (int m = 0; m < m_Materials.Length; m++)
91 | {
92 | m_Materials[m] = sourceFile.ReadPPtr();
93 | }
94 |
95 | if (version[0] < 3) { a_Stream.Position += 16; } //m_LightmapTilingOffset vector4d
96 | else
97 | {
98 | int m_SubsetIndices_size = a_Stream.ReadInt32();
99 | a_Stream.Position += m_SubsetIndices_size * 4;
100 | PPtr m_StaticBatchRoot = sourceFile.ReadPPtr();
101 |
102 | if (version[0] >= 4 || (version[0] == 3 && version[1] >= 5))
103 | {
104 | bool m_UseLightProbes = a_Stream.ReadBoolean();
105 | a_Stream.Position += 3; //alignment
106 | if (version[0] == 5) { int m_ReflectionProbeUsage = a_Stream.ReadInt32(); }
107 | //did I ever check if the anchor is conditioned by the bool?
108 | PPtr m_LightProbeAnchor = sourceFile.ReadPPtr();
109 | }
110 |
111 | if (version[0] >= 5 || (version[0] == 4 && version[1] >= 3))
112 | {
113 | if (version[0] == 4 && version[1] <= 3) { int m_SortingLayer = a_Stream.ReadInt16(); }
114 | else { int m_SortingLayer = a_Stream.ReadInt32(); }
115 |
116 | int m_SortingOrder = a_Stream.ReadInt16();
117 | a_Stream.AlignStream(4);
118 | }
119 | }
120 |
121 | int m_Quality = a_Stream.ReadInt32();
122 | bool m_UpdateWhenOffscreen = a_Stream.ReadBoolean();
123 | bool m_SkinNormals = a_Stream.ReadBoolean(); //3.1.0 and below
124 | a_Stream.Position += 2;
125 |
126 | if (version[0] == 2 && version[1] < 6)
127 | {
128 | //this would be the only error if mainVersion is not read in time for a version 2.x game
129 | PPtr m_DisableAnimationWhenOffscreen = sourceFile.ReadPPtr();
130 | }
131 |
132 | m_Mesh = sourceFile.ReadPPtr();
133 |
134 | m_Bones = new PPtr[a_Stream.ReadInt32()];
135 | for (int b = 0; b < m_Bones.Length; b++)
136 | {
137 | m_Bones[b] = sourceFile.ReadPPtr();
138 | }
139 |
140 | if (version[0] < 3)
141 | {
142 | int m_BindPose = a_Stream.ReadInt32();
143 | a_Stream.Position += m_BindPose * 16 * 4;//Matrix4x4f
144 | }
145 | else
146 | {
147 | if (version[0] >= 4 || (version[0] == 4 && version[1] >= 3))
148 | {
149 | int m_BlendShapeWeights = a_Stream.ReadInt32();
150 | a_Stream.Position += m_BlendShapeWeights * 4; //floats
151 | }
152 |
153 | if (version[0] >= 4 || (version[0] >= 3 && version[1] >= 5))
154 | {
155 | PPtr m_RootBone = sourceFile.ReadPPtr();
156 | }
157 |
158 | if (version[0] >= 4 || (version[0] == 3 && version[1] >= 4))
159 | {
160 | //AABB
161 | float[] m_Center = new float[] { a_Stream.ReadSingle(), a_Stream.ReadSingle(), a_Stream.ReadSingle() };
162 | float[] m_Extent = new float[] { a_Stream.ReadSingle(), a_Stream.ReadSingle(), a_Stream.ReadSingle() };
163 | bool m_DirtyAABB = a_Stream.ReadBoolean();
164 | }
165 | }
166 | }
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/Font.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 |
38 | namespace AssetStudio
39 | {
40 | class unityFont
41 | {
42 | public string m_Name;
43 | public byte[] m_FontData;
44 |
45 | public unityFont(AssetPreloadData preloadData, bool readSwitch)
46 | {
47 | var sourceFile = preloadData.sourceFile;
48 | var a_Stream = preloadData.sourceFile.a_Stream;
49 | a_Stream.Position = preloadData.Offset;
50 |
51 | if (sourceFile.platform == -2)
52 | {
53 | uint m_ObjectHideFlags = a_Stream.ReadUInt32();
54 | PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
55 | PPtr m_PrefabInternal = sourceFile.ReadPPtr();
56 | }
57 |
58 | m_Name = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
59 |
60 | if (readSwitch)
61 | {
62 | int m_AsciiStartOffset = a_Stream.ReadInt32();
63 |
64 | if (sourceFile.version[0] <= 3)
65 | {
66 | int m_FontCountX = a_Stream.ReadInt32();
67 | int m_FontCountY = a_Stream.ReadInt32();
68 | }
69 |
70 | float m_Kerning = a_Stream.ReadSingle();
71 | float m_LineSpacing = a_Stream.ReadSingle();
72 |
73 | if (sourceFile.version[0] <= 3)
74 | {
75 | int m_PerCharacterKerning_size = a_Stream.ReadInt32();
76 | for (int i = 0; i < m_PerCharacterKerning_size; i++)
77 | {
78 | int first = a_Stream.ReadInt32();
79 | float second = a_Stream.ReadSingle();
80 | }
81 | }
82 | else
83 | {
84 | int m_CharacterSpacing = a_Stream.ReadInt32();
85 | int m_CharacterPadding = a_Stream.ReadInt32();
86 | }
87 |
88 | int m_ConvertCase = a_Stream.ReadInt32();
89 | PPtr m_DefaultMaterial = sourceFile.ReadPPtr();
90 |
91 | int m_CharacterRects_size = a_Stream.ReadInt32();
92 | for (int i = 0; i < m_CharacterRects_size; i++)
93 | {
94 | int index = a_Stream.ReadInt32();
95 | //Rectf uv
96 | float uvx = a_Stream.ReadSingle();
97 | float uvy = a_Stream.ReadSingle();
98 | float uvwidth = a_Stream.ReadSingle();
99 | float uvheight = a_Stream.ReadSingle();
100 | //Rectf vert
101 | float vertx = a_Stream.ReadSingle();
102 | float verty = a_Stream.ReadSingle();
103 | float vertwidth = a_Stream.ReadSingle();
104 | float vertheight = a_Stream.ReadSingle();
105 | float width = a_Stream.ReadSingle();
106 |
107 | if (sourceFile.version[0] >= 4)
108 | {
109 | bool flipped = a_Stream.ReadBoolean();
110 | a_Stream.Position += 3;
111 | }
112 | }
113 |
114 | PPtr m_Texture = sourceFile.ReadPPtr();
115 |
116 | int m_KerningValues_size = a_Stream.ReadInt32();
117 | for (int i = 0; i < m_KerningValues_size; i++)
118 | {
119 | int pairfirst = a_Stream.ReadInt16();
120 | int pairsecond = a_Stream.ReadInt16();
121 | float second = a_Stream.ReadSingle();
122 | }
123 |
124 | if (sourceFile.version[0] <= 3)
125 | {
126 | bool m_GridFont = a_Stream.ReadBoolean();
127 | a_Stream.Position += 3; //4 byte alignment
128 | }
129 | else { float m_PixelScale = a_Stream.ReadSingle(); }
130 |
131 | int m_FontData_size = a_Stream.ReadInt32();
132 | if (m_FontData_size > 0)
133 | {
134 | m_FontData = new byte[m_FontData_size];
135 | a_Stream.Read(m_FontData, 0, m_FontData_size);
136 |
137 | if (m_FontData[0] == 79 && m_FontData[1] == 84 && m_FontData[2] == 84 && m_FontData[3] == 79)
138 | { preloadData.extension = ".otf"; }
139 | else { preloadData.extension = ".ttf"; }
140 |
141 | }
142 |
143 | float m_FontSize = a_Stream.ReadSingle();//problem here in minifootball
144 | float m_Ascent = a_Stream.ReadSingle();
145 | uint m_DefaultStyle = a_Stream.ReadUInt32();
146 |
147 | int m_FontNames = a_Stream.ReadInt32();
148 | for (int i = 0; i < m_FontNames; i++)
149 | {
150 | string m_FontName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
151 | }
152 |
153 | if (sourceFile.version[0] >= 4)
154 | {
155 | int m_FallbackFonts = a_Stream.ReadInt32();
156 | for (int i = 0; i < m_FallbackFonts; i++)
157 | {
158 | PPtr m_FallbackFont = sourceFile.ReadPPtr();
159 | }
160 |
161 | int m_FontRenderingMode = a_Stream.ReadInt32();
162 | }
163 | }
164 | else
165 | {
166 | if (m_Name != "") { preloadData.Text = m_Name; }
167 | else { preloadData.Text = preloadData.TypeString + " #" + preloadData.uniqueID; }
168 | preloadData.SubItems.AddRange(new string[] { preloadData.TypeString, preloadData.exportSize.ToString() });
169 | }
170 | }
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/AssetStudio/BundleFile.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 | using System.IO;
38 | using SevenZip;
39 | using Lz4;
40 |
41 | namespace AssetStudio
42 | {
43 | public class BundleFile
44 | {
45 | public int ver1;
46 | public string ver2;
47 | public string ver3;
48 | public List MemoryAssetsFileList = new List();
49 |
50 | public class MemoryAssetsFile
51 | {
52 | public string fileName;
53 | public MemoryStream memStream;
54 | }
55 |
56 | public BundleFile(string fileName)
57 | {
58 | if (Path.GetExtension(fileName) == ".lz4")
59 | {
60 | byte[] filebuffer;
61 |
62 | using (BinaryReader lz4Stream = new BinaryReader(File.OpenRead(fileName)))
63 | {
64 | int version = lz4Stream.ReadInt32();
65 | int uncompressedSize = lz4Stream.ReadInt32();
66 | int compressedSize = lz4Stream.ReadInt32();
67 | int something = lz4Stream.ReadInt32(); //1
68 |
69 | byte[] lz4buffer = new byte[compressedSize];
70 | lz4Stream.Read(lz4buffer, 0, compressedSize);
71 |
72 | using (var inputStream = new MemoryStream(lz4buffer))
73 | {
74 | var decoder = new Lz4DecoderStream(inputStream);
75 |
76 | filebuffer = new byte[uncompressedSize]; //is this ok?
77 | for (;;)
78 | {
79 | int nRead = decoder.Read(filebuffer, 0, uncompressedSize);
80 | if (nRead == 0)
81 | break;
82 | }
83 | }
84 | }
85 |
86 | using (var b_Stream = new EndianStream(new MemoryStream(filebuffer), EndianType.BigEndian))
87 | {
88 | readBundle(b_Stream);
89 | }
90 | }
91 | else
92 | {
93 | using (var b_Stream = new EndianStream(File.OpenRead(fileName), EndianType.BigEndian))
94 | {
95 | readBundle(b_Stream);
96 | }
97 | }
98 | }
99 |
100 | private void readBundle(EndianStream b_Stream)
101 | {
102 | var header = b_Stream.ReadStringToNull();
103 |
104 | if (header == "UnityWeb" || header == "UnityRaw" || header == "\xFA\xFA\xFA\xFA\xFA\xFA\xFA\xFA")
105 | {
106 | ver1 = b_Stream.ReadInt32();
107 | ver2 = b_Stream.ReadStringToNull();
108 | ver3 = b_Stream.ReadStringToNull();
109 | if (ver1 < 6) { int bundleSize = b_Stream.ReadInt32(); }
110 | else
111 | {
112 | long bundleSize = b_Stream.ReadInt64();
113 | return;
114 | }
115 | short dummy2 = b_Stream.ReadInt16();
116 | int offset = b_Stream.ReadInt16();
117 | int dummy3 = b_Stream.ReadInt32();
118 | int lzmaChunks = b_Stream.ReadInt32();
119 |
120 | int lzmaSize = 0;
121 | long streamSize = 0;
122 |
123 | for (int i = 0; i < lzmaChunks; i++)
124 | {
125 | lzmaSize = b_Stream.ReadInt32();
126 | streamSize = b_Stream.ReadInt32();
127 | }
128 |
129 | b_Stream.Position = offset;
130 | switch (header)
131 | {
132 | case "\xFA\xFA\xFA\xFA\xFA\xFA\xFA\xFA": //.bytes
133 | case "UnityWeb":
134 | {
135 | byte[] lzmaBuffer = new byte[lzmaSize];
136 | b_Stream.Read(lzmaBuffer, 0, lzmaSize);
137 |
138 | using (var lzmaStream = new EndianStream(SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(new MemoryStream(lzmaBuffer)), EndianType.BigEndian))
139 | {
140 | getFiles(lzmaStream, 0);
141 | }
142 | break;
143 | }
144 | case "UnityRaw":
145 | {
146 | getFiles(b_Stream, offset);
147 | break;
148 | }
149 | }
150 |
151 |
152 | }
153 | else if (header == "UnityFS")
154 | {
155 | ver1 = b_Stream.ReadInt32();
156 | ver2 = b_Stream.ReadStringToNull();
157 | ver3 = b_Stream.ReadStringToNull();
158 | long bundleSize = b_Stream.ReadInt64();
159 | }
160 | }
161 |
162 | private void getFiles(EndianStream f_Stream, int offset)
163 | {
164 | int fileCount = f_Stream.ReadInt32();
165 | for (int i = 0; i < fileCount; i++)
166 | {
167 | MemoryAssetsFile memFile = new MemoryAssetsFile();
168 | memFile.fileName = f_Stream.ReadStringToNull();
169 | int fileOffset = f_Stream.ReadInt32();
170 | fileOffset += offset;
171 | int fileSize = f_Stream.ReadInt32();
172 | long nextFile = f_Stream.Position;
173 | f_Stream.Position = fileOffset;
174 |
175 | byte[] buffer = new byte[fileSize];
176 | f_Stream.Read(buffer, 0, fileSize);
177 | memFile.memStream = new MemoryStream(buffer);
178 | MemoryAssetsFileList.Add(memFile);
179 | f_Stream.Position = nextFile;
180 | }
181 | }
182 | }
183 | }
184 |
--------------------------------------------------------------------------------
/AssetStudio/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AssetStudio.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
29 | public bool uniqueNames {
30 | get {
31 | return ((bool)(this["uniqueNames"]));
32 | }
33 | set {
34 | this["uniqueNames"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
41 | public bool enablePreview {
42 | get {
43 | return ((bool)(this["enablePreview"]));
44 | }
45 | set {
46 | this["enablePreview"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
53 | public bool displayInfo {
54 | get {
55 | return ((bool)(this["displayInfo"]));
56 | }
57 | set {
58 | this["displayInfo"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
65 | public bool openAfterExport {
66 | get {
67 | return ((bool)(this["openAfterExport"]));
68 | }
69 | set {
70 | this["openAfterExport"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
77 | public int assetGroupOption {
78 | get {
79 | return ((int)(this["assetGroupOption"]));
80 | }
81 | set {
82 | this["assetGroupOption"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
89 | public bool exportNormals {
90 | get {
91 | return ((bool)(this["exportNormals"]));
92 | }
93 | set {
94 | this["exportNormals"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
101 | public bool exportTangents {
102 | get {
103 | return ((bool)(this["exportTangents"]));
104 | }
105 | set {
106 | this["exportTangents"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
113 | public bool exportUVs {
114 | get {
115 | return ((bool)(this["exportUVs"]));
116 | }
117 | set {
118 | this["exportUVs"] = value;
119 | }
120 | }
121 |
122 | [global::System.Configuration.UserScopedSettingAttribute()]
123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
124 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
125 | public bool exportColors {
126 | get {
127 | return ((bool)(this["exportColors"]));
128 | }
129 | set {
130 | this["exportColors"] = value;
131 | }
132 | }
133 |
134 | [global::System.Configuration.UserScopedSettingAttribute()]
135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
136 | [global::System.Configuration.DefaultSettingValueAttribute("2.54")]
137 | public decimal scaleFactor {
138 | get {
139 | return ((decimal)(this["scaleFactor"]));
140 | }
141 | set {
142 | this["scaleFactor"] = value;
143 | }
144 | }
145 |
146 | [global::System.Configuration.UserScopedSettingAttribute()]
147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
148 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
149 | public int upAxis {
150 | get {
151 | return ((int)(this["upAxis"]));
152 | }
153 | set {
154 | this["upAxis"] = value;
155 | }
156 | }
157 |
158 | [global::System.Configuration.UserScopedSettingAttribute()]
159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
160 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
161 | public bool showExpOpt {
162 | get {
163 | return ((bool)(this["showExpOpt"]));
164 | }
165 | set {
166 | this["showExpOpt"] = value;
167 | }
168 | }
169 |
170 | [global::System.Configuration.UserScopedSettingAttribute()]
171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
172 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
173 | public bool exportDeformers {
174 | get {
175 | return ((bool)(this["exportDeformers"]));
176 | }
177 | set {
178 | this["exportDeformers"] = value;
179 | }
180 | }
181 |
182 | [global::System.Configuration.UserScopedSettingAttribute()]
183 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
184 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
185 | public bool convertDummies {
186 | get {
187 | return ((bool)(this["convertDummies"]));
188 | }
189 | set {
190 | this["convertDummies"] = value;
191 | }
192 | }
193 | }
194 | }
195 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Common/CommandLineParser.cs:
--------------------------------------------------------------------------------
1 | // CommandLineParser.cs
2 |
3 | using System;
4 | using System.Collections;
5 |
6 | namespace SevenZip.CommandLineParser
7 | {
8 | public enum SwitchType
9 | {
10 | Simple,
11 | PostMinus,
12 | LimitedPostString,
13 | UnLimitedPostString,
14 | PostChar
15 | }
16 |
17 | public class SwitchForm
18 | {
19 | public string IDString;
20 | public SwitchType Type;
21 | public bool Multi;
22 | public int MinLen;
23 | public int MaxLen;
24 | public string PostCharSet;
25 |
26 | public SwitchForm(string idString, SwitchType type, bool multi,
27 | int minLen, int maxLen, string postCharSet)
28 | {
29 | IDString = idString;
30 | Type = type;
31 | Multi = multi;
32 | MinLen = minLen;
33 | MaxLen = maxLen;
34 | PostCharSet = postCharSet;
35 | }
36 | public SwitchForm(string idString, SwitchType type, bool multi, int minLen):
37 | this(idString, type, multi, minLen, 0, "")
38 | {
39 | }
40 | public SwitchForm(string idString, SwitchType type, bool multi):
41 | this(idString, type, multi, 0)
42 | {
43 | }
44 | }
45 |
46 | public class SwitchResult
47 | {
48 | public bool ThereIs;
49 | public bool WithMinus;
50 | public ArrayList PostStrings = new ArrayList();
51 | public int PostCharIndex;
52 | public SwitchResult()
53 | {
54 | ThereIs = false;
55 | }
56 | }
57 |
58 | public class Parser
59 | {
60 | public ArrayList NonSwitchStrings = new ArrayList();
61 | SwitchResult[] _switches;
62 |
63 | public Parser(int numSwitches)
64 | {
65 | _switches = new SwitchResult[numSwitches];
66 | for (int i = 0; i < numSwitches; i++)
67 | _switches[i] = new SwitchResult();
68 | }
69 |
70 | bool ParseString(string srcString, SwitchForm[] switchForms)
71 | {
72 | int len = srcString.Length;
73 | if (len == 0)
74 | return false;
75 | int pos = 0;
76 | if (!IsItSwitchChar(srcString[pos]))
77 | return false;
78 | while (pos < len)
79 | {
80 | if (IsItSwitchChar(srcString[pos]))
81 | pos++;
82 | const int kNoLen = -1;
83 | int matchedSwitchIndex = 0;
84 | int maxLen = kNoLen;
85 | for (int switchIndex = 0; switchIndex < _switches.Length; switchIndex++)
86 | {
87 | int switchLen = switchForms[switchIndex].IDString.Length;
88 | if (switchLen <= maxLen || pos + switchLen > len)
89 | continue;
90 | if (String.Compare(switchForms[switchIndex].IDString, 0,
91 | srcString, pos, switchLen, true) == 0)
92 | {
93 | matchedSwitchIndex = switchIndex;
94 | maxLen = switchLen;
95 | }
96 | }
97 | if (maxLen == kNoLen)
98 | throw new Exception("maxLen == kNoLen");
99 | SwitchResult matchedSwitch = _switches[matchedSwitchIndex];
100 | SwitchForm switchForm = switchForms[matchedSwitchIndex];
101 | if ((!switchForm.Multi) && matchedSwitch.ThereIs)
102 | throw new Exception("switch must be single");
103 | matchedSwitch.ThereIs = true;
104 | pos += maxLen;
105 | int tailSize = len - pos;
106 | SwitchType type = switchForm.Type;
107 | switch (type)
108 | {
109 | case SwitchType.PostMinus:
110 | {
111 | if (tailSize == 0)
112 | matchedSwitch.WithMinus = false;
113 | else
114 | {
115 | matchedSwitch.WithMinus = (srcString[pos] == kSwitchMinus);
116 | if (matchedSwitch.WithMinus)
117 | pos++;
118 | }
119 | break;
120 | }
121 | case SwitchType.PostChar:
122 | {
123 | if (tailSize < switchForm.MinLen)
124 | throw new Exception("switch is not full");
125 | string charSet = switchForm.PostCharSet;
126 | const int kEmptyCharValue = -1;
127 | if (tailSize == 0)
128 | matchedSwitch.PostCharIndex = kEmptyCharValue;
129 | else
130 | {
131 | int index = charSet.IndexOf(srcString[pos]);
132 | if (index < 0)
133 | matchedSwitch.PostCharIndex = kEmptyCharValue;
134 | else
135 | {
136 | matchedSwitch.PostCharIndex = index;
137 | pos++;
138 | }
139 | }
140 | break;
141 | }
142 | case SwitchType.LimitedPostString:
143 | case SwitchType.UnLimitedPostString:
144 | {
145 | int minLen = switchForm.MinLen;
146 | if (tailSize < minLen)
147 | throw new Exception("switch is not full");
148 | if (type == SwitchType.UnLimitedPostString)
149 | {
150 | matchedSwitch.PostStrings.Add(srcString.Substring(pos));
151 | return true;
152 | }
153 | String stringSwitch = srcString.Substring(pos, minLen);
154 | pos += minLen;
155 | for (int i = minLen; i < switchForm.MaxLen && pos < len; i++, pos++)
156 | {
157 | char c = srcString[pos];
158 | if (IsItSwitchChar(c))
159 | break;
160 | stringSwitch += c;
161 | }
162 | matchedSwitch.PostStrings.Add(stringSwitch);
163 | break;
164 | }
165 | }
166 | }
167 | return true;
168 |
169 | }
170 |
171 | public void ParseStrings(SwitchForm[] switchForms, string[] commandStrings)
172 | {
173 | int numCommandStrings = commandStrings.Length;
174 | bool stopSwitch = false;
175 | for (int i = 0; i < numCommandStrings; i++)
176 | {
177 | string s = commandStrings[i];
178 | if (stopSwitch)
179 | NonSwitchStrings.Add(s);
180 | else
181 | if (s == kStopSwitchParsing)
182 | stopSwitch = true;
183 | else
184 | if (!ParseString(s, switchForms))
185 | NonSwitchStrings.Add(s);
186 | }
187 | }
188 |
189 | public SwitchResult this[int index] { get { return _switches[index]; } }
190 |
191 | public static int ParseCommand(CommandForm[] commandForms, string commandString,
192 | out string postString)
193 | {
194 | for (int i = 0; i < commandForms.Length; i++)
195 | {
196 | string id = commandForms[i].IDString;
197 | if (commandForms[i].PostStringMode)
198 | {
199 | if (commandString.IndexOf(id) == 0)
200 | {
201 | postString = commandString.Substring(id.Length);
202 | return i;
203 | }
204 | }
205 | else
206 | if (commandString == id)
207 | {
208 | postString = "";
209 | return i;
210 | }
211 | }
212 | postString = "";
213 | return -1;
214 | }
215 |
216 | static bool ParseSubCharsCommand(int numForms, CommandSubCharsSet[] forms,
217 | string commandString, ArrayList indices)
218 | {
219 | indices.Clear();
220 | int numUsedChars = 0;
221 | for (int i = 0; i < numForms; i++)
222 | {
223 | CommandSubCharsSet charsSet = forms[i];
224 | int currentIndex = -1;
225 | int len = charsSet.Chars.Length;
226 | for (int j = 0; j < len; j++)
227 | {
228 | char c = charsSet.Chars[j];
229 | int newIndex = commandString.IndexOf(c);
230 | if (newIndex >= 0)
231 | {
232 | if (currentIndex >= 0)
233 | return false;
234 | if (commandString.IndexOf(c, newIndex + 1) >= 0)
235 | return false;
236 | currentIndex = j;
237 | numUsedChars++;
238 | }
239 | }
240 | if (currentIndex == -1 && !charsSet.EmptyAllowed)
241 | return false;
242 | indices.Add(currentIndex);
243 | }
244 | return (numUsedChars == commandString.Length);
245 | }
246 | const char kSwitchID1 = '-';
247 | const char kSwitchID2 = '/';
248 |
249 | const char kSwitchMinus = '-';
250 | const string kStopSwitchParsing = "--";
251 |
252 | static bool IsItSwitchChar(char c)
253 | {
254 | return (c == kSwitchID1 || c == kSwitchID2);
255 | }
256 | }
257 |
258 | public class CommandForm
259 | {
260 | public string IDString = "";
261 | public bool PostStringMode = false;
262 | public CommandForm(string idString, bool postStringMode)
263 | {
264 | IDString = idString;
265 | PostStringMode = postStringMode;
266 | }
267 | }
268 |
269 | class CommandSubCharsSet
270 | {
271 | public string Chars = "";
272 | public bool EmptyAllowed = false;
273 | }
274 | }
275 |
--------------------------------------------------------------------------------
/AssetStudio/EndianStream.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.Linq;
36 | using System.Text;
37 | using System.IO;
38 |
39 | namespace AssetStudio
40 | {
41 | public enum EndianType
42 | {
43 | BigEndian,
44 | LittleEndian
45 | }
46 |
47 | public class EndianStream : BinaryReader
48 | {
49 | public EndianType endian;
50 | private byte[] a16 = new byte[2];
51 | private byte[] a32 = new byte[4];
52 | private byte[] a64 = new byte[8];
53 |
54 | public EndianStream(Stream stream, EndianType endian) : base(stream) { }
55 |
56 | ~EndianStream()
57 | {
58 | Dispose();
59 | }
60 |
61 | public long Position { get { return base.BaseStream.Position; } set { base.BaseStream.Position = value; } }
62 |
63 | public new void Dispose()
64 | {
65 | base.Dispose();
66 | }
67 |
68 | public override bool ReadBoolean()
69 | {
70 | return base.ReadBoolean();
71 | }
72 |
73 | public override byte ReadByte()
74 | {
75 | try
76 | {
77 | return base.ReadByte();
78 | }
79 | catch
80 | {
81 | return 0;
82 | }
83 | }
84 |
85 | public override char ReadChar()
86 | {
87 | return base.ReadChar();
88 | }
89 |
90 | public override Int16 ReadInt16()
91 | {
92 | if (endian == EndianType.BigEndian)
93 | {
94 | a16 = base.ReadBytes(2);
95 | Array.Reverse(a16);
96 | return BitConverter.ToInt16(a16, 0);
97 | }
98 | else return base.ReadInt16();
99 | }
100 |
101 | public override int ReadInt32()
102 | {
103 | if (endian == EndianType.BigEndian)
104 | {
105 | a32 = base.ReadBytes(4);
106 | Array.Reverse(a32);
107 | return BitConverter.ToInt32(a32, 0);
108 | }
109 | else return base.ReadInt32();
110 | }
111 |
112 | public override Int64 ReadInt64()
113 | {
114 | if (endian == EndianType.BigEndian)
115 | {
116 | a64 = base.ReadBytes(8);
117 | Array.Reverse(a64);
118 | return BitConverter.ToInt64(a64, 0);
119 | }
120 | else return base.ReadInt64();
121 | }
122 |
123 | public override UInt16 ReadUInt16()
124 | {
125 | if (endian == EndianType.BigEndian)
126 | {
127 | a16 = base.ReadBytes(2);
128 | Array.Reverse(a16);
129 | return BitConverter.ToUInt16(a16, 0);
130 | }
131 | else return base.ReadUInt16();
132 | }
133 |
134 | public override UInt32 ReadUInt32()
135 | {
136 | if (endian == EndianType.BigEndian)
137 | {
138 | a32 = base.ReadBytes(4);
139 | Array.Reverse(a32);
140 | return BitConverter.ToUInt32(a32, 0);
141 | }
142 | else return base.ReadUInt32();
143 | }
144 |
145 | public override UInt64 ReadUInt64()
146 | {
147 | if (endian == EndianType.BigEndian)
148 | {
149 | a64 = base.ReadBytes(8);
150 | Array.Reverse(a64);
151 | return BitConverter.ToUInt64(a64, 0);
152 | }
153 | else return base.ReadUInt64();
154 | }
155 |
156 | public override Single ReadSingle()
157 | {
158 | if (endian == EndianType.BigEndian)
159 | {
160 | a32 = base.ReadBytes(4);
161 | Array.Reverse(a32);
162 | return BitConverter.ToSingle(a32, 0);
163 | }
164 | else return base.ReadSingle();
165 | }
166 |
167 | public override Double ReadDouble()
168 | {
169 | if (endian == EndianType.BigEndian)
170 | {
171 | a64 = base.ReadBytes(8);
172 | Array.Reverse(a64);
173 | return BitConverter.ToUInt64(a64, 0);
174 | }
175 | else return base.ReadDouble();
176 | }
177 |
178 | public override string ReadString()
179 | {
180 | return base.ReadString();
181 | }
182 |
183 | public string ReadASCII(int length)
184 | {
185 | return ASCIIEncoding.ASCII.GetString(base.ReadBytes(length));
186 | }
187 |
188 | public void AlignStream(int alignment)
189 | {
190 | long pos = base.BaseStream.Position;
191 | //long padding = alignment - pos + (pos / alignment) * alignment;
192 | //if (padding != alignment) { base.BaseStream.Position += padding; }
193 | if ((pos % alignment) != 0) { base.BaseStream.Position += alignment - (pos % alignment); }
194 | }
195 |
196 | public string ReadAlignedString(int length)
197 | {
198 | if (length > 0 && length < (base.BaseStream.Length - base.BaseStream.Position))//crude failsafe
199 | {
200 | byte[] stringData = new byte[length];
201 | base.Read(stringData, 0, length);
202 | var result = System.Text.Encoding.UTF8.GetString(stringData); //must verify strange characters in PS3
203 |
204 | /*string result = "";
205 | char c;
206 | for (int i = 0; i < length; i++)
207 | {
208 | c = (char)base.ReadByte();
209 | result += c.ToString();
210 | }*/
211 |
212 | AlignStream(4);
213 | return result;
214 | }
215 | else { return ""; }
216 | }
217 |
218 | public string ReadStringToNull()
219 | {
220 | string result = "";
221 | char c;
222 | for (int i = 0; i < base.BaseStream.Length; i++)
223 | {
224 | if ((c = (char)base.ReadByte()) == 0)
225 | {
226 | break;
227 | }
228 | result += c.ToString();
229 | }
230 | return result;
231 | }
232 | }
233 | }
234 |
--------------------------------------------------------------------------------
/AssetStudio/Classes/AudioClip.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | using System;
34 | using System.Collections.Generic;
35 | using System.IO;
36 | using System.Linq;
37 | using System.Text;
38 |
39 | namespace AssetStudio
40 | {
41 | class AudioClip
42 | {
43 | public string m_Name;
44 | public int m_Format;
45 | public int m_Type = -1;
46 | public bool m_3D;
47 | public bool m_UseHardware;
48 |
49 | //version 5
50 | public int m_LoadType;
51 | public int m_Channels;
52 | public int m_Frequency;
53 | public int m_BitsPerSample;
54 | public float m_Length;
55 | public bool m_IsTrackerFormat;
56 | public int m_SubsoundIndex;
57 | public bool m_PreloadAudioData;
58 | public bool m_LoadInBackground;
59 | public bool m_Legacy3D;
60 | public int m_CompressionFormat = -1;
61 |
62 | public string m_Source;
63 | public long m_Offset;
64 | public long m_Size;
65 | public byte[] m_AudioData;
66 |
67 | public AudioClip(AssetPreloadData preloadData, bool readSwitch)
68 | {
69 | var sourceFile = preloadData.sourceFile;
70 | var a_Stream = preloadData.sourceFile.a_Stream;
71 | a_Stream.Position = preloadData.Offset;
72 |
73 | if (sourceFile.platform == -2)
74 | {
75 | uint m_ObjectHideFlags = a_Stream.ReadUInt32();
76 | PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
77 | PPtr m_PrefabInternal = sourceFile.ReadPPtr();
78 | }
79 |
80 | m_Name = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
81 |
82 | if (sourceFile.version[0] < 5)
83 | {
84 |
85 | m_Format = a_Stream.ReadInt32(); //channels?
86 | m_Type = a_Stream.ReadInt32();
87 | m_3D = a_Stream.ReadBoolean();
88 | m_UseHardware = a_Stream.ReadBoolean();
89 | a_Stream.Position += 2; //4 byte alignment
90 |
91 | if (sourceFile.version[0] >= 4 || (sourceFile.version[0] == 3 && sourceFile.version[1] >= 2)) //3.2.0 to 5
92 | {
93 | int m_Stream = a_Stream.ReadInt32();
94 | m_Size = a_Stream.ReadInt32();
95 |
96 | if (m_Stream > 1)
97 | {
98 | m_Offset = a_Stream.ReadInt32();
99 | m_Source = sourceFile.filePath + ".resS";
100 | }
101 | }
102 | else { m_Size = a_Stream.ReadInt32(); }
103 | }
104 | else
105 | {
106 | m_LoadType = a_Stream.ReadInt32();//Decompress on load, Compressed in memory, Streaming
107 | m_Channels = a_Stream.ReadInt32();
108 | m_Frequency = a_Stream.ReadInt32();
109 | m_BitsPerSample = a_Stream.ReadInt32();
110 | m_Length = a_Stream.ReadSingle();
111 | m_IsTrackerFormat = a_Stream.ReadBoolean();
112 | a_Stream.Position += 3;
113 | m_SubsoundIndex = a_Stream.ReadInt32();
114 | m_PreloadAudioData = a_Stream.ReadBoolean();
115 | m_LoadInBackground = a_Stream.ReadBoolean();
116 | m_Legacy3D = a_Stream.ReadBoolean();
117 | a_Stream.Position += 1;
118 | m_3D = m_Legacy3D;
119 |
120 | m_Source = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
121 | //m_Source = Path.GetFileName(m_Source);
122 | m_Source = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), m_Source.Replace("archive:/",""));
123 | m_Offset = a_Stream.ReadInt64();
124 | m_Size = a_Stream.ReadInt64();
125 | m_CompressionFormat = a_Stream.ReadInt32();
126 | }
127 |
128 | if (readSwitch)
129 | {
130 | m_AudioData = new byte[m_Size];
131 |
132 | if (m_Source == null)
133 | {
134 | a_Stream.Read(m_AudioData, 0, (int)m_Size);
135 | }
136 | else if (File.Exists(m_Source))
137 | {
138 | using (BinaryReader reader = new BinaryReader(File.OpenRead(m_Source)))
139 | {
140 | reader.BaseStream.Position = m_Offset;
141 | reader.Read(m_AudioData, 0, (int)m_Size);
142 | reader.Close();
143 | }
144 | }
145 | }
146 | else
147 | {
148 | preloadData.InfoText = "Compression format: ";
149 |
150 | switch (m_Type)
151 | {
152 | case 2:
153 | preloadData.extension = ".aif";
154 | preloadData.InfoText += "AIFF";
155 | break;
156 | case 13:
157 | preloadData.extension = ".mp3";
158 | preloadData.InfoText += "MP3";
159 | break;
160 | case 14:
161 | preloadData.extension = ".ogg";
162 | preloadData.InfoText += "Ogg Vorbis";
163 | break;
164 | case 20:
165 | preloadData.extension = ".wav";
166 | preloadData.InfoText += "WAV";
167 | break;
168 | case 22: //xbox encoding
169 | preloadData.extension = ".wav";
170 | preloadData.InfoText += "Xbox360 WAV";
171 | break;
172 | }
173 |
174 | switch (m_CompressionFormat)
175 | {
176 | case 0:
177 | preloadData.extension = ".fsb";
178 | preloadData.InfoText += "PCM";
179 | break;
180 | case 1:
181 | preloadData.extension = ".fsb";
182 | preloadData.InfoText += "Vorbis";
183 | break;
184 | case 2:
185 | preloadData.extension = ".fsb";
186 | preloadData.InfoText += "ADPCM";
187 | break;
188 | case 3:
189 | preloadData.extension = ".fsb";
190 | preloadData.InfoText += "MP3";//not sure
191 | break;
192 | }
193 |
194 | if (preloadData.extension == "")
195 | {
196 | preloadData.extension = ".AudioClip";
197 | preloadData.InfoText += "Unknown";
198 | }
199 | preloadData.InfoText += "\n3D: " + m_3D.ToString();
200 |
201 | if (m_Name != "") { preloadData.Text = m_Name; }
202 | else { preloadData.Text = preloadData.TypeString + " #" + preloadData.uniqueID; }
203 | preloadData.exportSize = (int)m_Size;
204 | preloadData.SubItems.AddRange(new string[] { preloadData.TypeString, m_Size.ToString() });
205 | }
206 | }
207 | }
208 | }
209 |
--------------------------------------------------------------------------------
/AssetStudio/AssetStudio.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}
9 | WinExe
10 | Properties
11 | AssetStudio
12 | AssetStudio
13 | v4.0
14 |
15 |
16 | 512
17 | publish\
18 | true
19 | Disk
20 | false
21 | Foreground
22 | 7
23 | Days
24 | false
25 | false
26 | true
27 | 0
28 | 1.0.0.%2a
29 | false
30 | false
31 | true
32 |
33 |
34 | x86
35 | true
36 | full
37 | false
38 | bin\Debug\
39 | DEBUG;TRACE
40 | prompt
41 | 4
42 |
43 |
44 | x86
45 | pdbonly
46 | true
47 | bin\Release\
48 | TRACE
49 | prompt
50 | 4
51 |
52 |
53 | Resources\reverse.ico
54 |
55 |
56 |
57 |
58 |
59 | ..\..\..\..\..\Tools\LIBRARIES\csharp-half-code-2\System.Half\bin\Release\System.Half.dll
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | False
72 | ..\..\..\..\..\Tools\SDK\taoframework-2.1.0\taoframework-2.1.0\bin\Tao.DevIl.dll
73 |
74 |
75 |
76 |
77 | Code
78 |
79 |
80 | Code
81 |
82 |
83 | Code
84 |
85 |
86 | Code
87 |
88 |
89 | Code
90 |
91 |
92 | Code
93 |
94 |
95 | Code
96 |
97 |
98 | Code
99 |
100 |
101 | Code
102 |
103 |
104 | Code
105 |
106 |
107 | Code
108 |
109 |
110 | Code
111 |
112 |
113 | Code
114 |
115 |
116 | Code
117 |
118 |
119 | Code
120 |
121 |
122 | Code
123 |
124 |
125 | Form
126 |
127 |
128 | AboutBox.cs
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 | Form
138 |
139 |
140 | ExportOptions.cs
141 |
142 |
143 |
144 |
145 |
146 |
147 | Component
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 | Form
167 |
168 |
169 | AssetStudioForm.cs
170 |
171 |
172 | AboutBox.cs
173 | Designer
174 |
175 |
176 | ExportOptions.cs
177 |
178 |
179 | ResXFileCodeGenerator
180 | Resources.Designer.cs
181 | Designer
182 |
183 |
184 | True
185 | Resources.resx
186 | True
187 |
188 |
189 | AssetStudioForm.cs
190 | Designer
191 |
192 |
193 |
194 | SettingsSingleFileGenerator
195 | Settings.Designer.cs
196 |
197 |
198 | True
199 | Settings.settings
200 | True
201 |
202 |
203 |
204 |
205 |
206 | False
207 | Microsoft .NET Framework 4 Client Profile %28x86 and x64%29
208 | true
209 |
210 |
211 | False
212 | .NET Framework 3.5 SP1
213 | false
214 |
215 |
216 | False
217 | Windows Installer 4.5
218 | true
219 |
220 |
221 |
222 |
223 | PreserveNewest
224 |
225 |
226 | PreserveNewest
227 |
228 |
229 |
230 |
231 |
232 |
239 |
--------------------------------------------------------------------------------
/AssetStudio/7zip/Compress/LZ/LzBinTree.cs:
--------------------------------------------------------------------------------
1 | // LzBinTree.cs
2 |
3 | using System;
4 |
5 | namespace SevenZip.Compression.LZ
6 | {
7 | public class BinTree : InWindow, IMatchFinder
8 | {
9 | UInt32 _cyclicBufferPos;
10 | UInt32 _cyclicBufferSize = 0;
11 | UInt32 _matchMaxLen;
12 |
13 | UInt32[] _son;
14 | UInt32[] _hash;
15 |
16 | UInt32 _cutValue = 0xFF;
17 | UInt32 _hashMask;
18 | UInt32 _hashSizeSum = 0;
19 |
20 | bool HASH_ARRAY = true;
21 |
22 | const UInt32 kHash2Size = 1 << 10;
23 | const UInt32 kHash3Size = 1 << 16;
24 | const UInt32 kBT2HashSize = 1 << 16;
25 | const UInt32 kStartMaxLen = 1;
26 | const UInt32 kHash3Offset = kHash2Size;
27 | const UInt32 kEmptyHashValue = 0;
28 | const UInt32 kMaxValForNormalize = ((UInt32)1 << 31) - 1;
29 |
30 | UInt32 kNumHashDirectBytes = 0;
31 | UInt32 kMinMatchCheck = 4;
32 | UInt32 kFixHashSize = kHash2Size + kHash3Size;
33 |
34 | public void SetType(int numHashBytes)
35 | {
36 | HASH_ARRAY = (numHashBytes > 2);
37 | if (HASH_ARRAY)
38 | {
39 | kNumHashDirectBytes = 0;
40 | kMinMatchCheck = 4;
41 | kFixHashSize = kHash2Size + kHash3Size;
42 | }
43 | else
44 | {
45 | kNumHashDirectBytes = 2;
46 | kMinMatchCheck = 2 + 1;
47 | kFixHashSize = 0;
48 | }
49 | }
50 |
51 | public new void SetStream(System.IO.Stream stream) { base.SetStream(stream); }
52 | public new void ReleaseStream() { base.ReleaseStream(); }
53 |
54 | public new void Init()
55 | {
56 | base.Init();
57 | for (UInt32 i = 0; i < _hashSizeSum; i++)
58 | _hash[i] = kEmptyHashValue;
59 | _cyclicBufferPos = 0;
60 | ReduceOffsets(-1);
61 | }
62 |
63 | public new void MovePos()
64 | {
65 | if (++_cyclicBufferPos >= _cyclicBufferSize)
66 | _cyclicBufferPos = 0;
67 | base.MovePos();
68 | if (_pos == kMaxValForNormalize)
69 | Normalize();
70 | }
71 |
72 | public new Byte GetIndexByte(Int32 index) { return base.GetIndexByte(index); }
73 |
74 | public new UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit)
75 | { return base.GetMatchLen(index, distance, limit); }
76 |
77 | public new UInt32 GetNumAvailableBytes() { return base.GetNumAvailableBytes(); }
78 |
79 | public void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
80 | UInt32 matchMaxLen, UInt32 keepAddBufferAfter)
81 | {
82 | if (historySize > kMaxValForNormalize - 256)
83 | throw new Exception();
84 | _cutValue = 16 + (matchMaxLen >> 1);
85 |
86 | UInt32 windowReservSize = (historySize + keepAddBufferBefore +
87 | matchMaxLen + keepAddBufferAfter) / 2 + 256;
88 |
89 | base.Create(historySize + keepAddBufferBefore, matchMaxLen + keepAddBufferAfter, windowReservSize);
90 |
91 | _matchMaxLen = matchMaxLen;
92 |
93 | UInt32 cyclicBufferSize = historySize + 1;
94 | if (_cyclicBufferSize != cyclicBufferSize)
95 | _son = new UInt32[(_cyclicBufferSize = cyclicBufferSize) * 2];
96 |
97 | UInt32 hs = kBT2HashSize;
98 |
99 | if (HASH_ARRAY)
100 | {
101 | hs = historySize - 1;
102 | hs |= (hs >> 1);
103 | hs |= (hs >> 2);
104 | hs |= (hs >> 4);
105 | hs |= (hs >> 8);
106 | hs >>= 1;
107 | hs |= 0xFFFF;
108 | if (hs > (1 << 24))
109 | hs >>= 1;
110 | _hashMask = hs;
111 | hs++;
112 | hs += kFixHashSize;
113 | }
114 | if (hs != _hashSizeSum)
115 | _hash = new UInt32[_hashSizeSum = hs];
116 | }
117 |
118 | public UInt32 GetMatches(UInt32[] distances)
119 | {
120 | UInt32 lenLimit;
121 | if (_pos + _matchMaxLen <= _streamPos)
122 | lenLimit = _matchMaxLen;
123 | else
124 | {
125 | lenLimit = _streamPos - _pos;
126 | if (lenLimit < kMinMatchCheck)
127 | {
128 | MovePos();
129 | return 0;
130 | }
131 | }
132 |
133 | UInt32 offset = 0;
134 | UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
135 | UInt32 cur = _bufferOffset + _pos;
136 | UInt32 maxLen = kStartMaxLen; // to avoid items for len < hashSize;
137 | UInt32 hashValue, hash2Value = 0, hash3Value = 0;
138 |
139 | if (HASH_ARRAY)
140 | {
141 | UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1];
142 | hash2Value = temp & (kHash2Size - 1);
143 | temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8);
144 | hash3Value = temp & (kHash3Size - 1);
145 | hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask;
146 | }
147 | else
148 | hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8);
149 |
150 | UInt32 curMatch = _hash[kFixHashSize + hashValue];
151 | if (HASH_ARRAY)
152 | {
153 | UInt32 curMatch2 = _hash[hash2Value];
154 | UInt32 curMatch3 = _hash[kHash3Offset + hash3Value];
155 | _hash[hash2Value] = _pos;
156 | _hash[kHash3Offset + hash3Value] = _pos;
157 | if (curMatch2 > matchMinPos)
158 | if (_bufferBase[_bufferOffset + curMatch2] == _bufferBase[cur])
159 | {
160 | distances[offset++] = maxLen = 2;
161 | distances[offset++] = _pos - curMatch2 - 1;
162 | }
163 | if (curMatch3 > matchMinPos)
164 | if (_bufferBase[_bufferOffset + curMatch3] == _bufferBase[cur])
165 | {
166 | if (curMatch3 == curMatch2)
167 | offset -= 2;
168 | distances[offset++] = maxLen = 3;
169 | distances[offset++] = _pos - curMatch3 - 1;
170 | curMatch2 = curMatch3;
171 | }
172 | if (offset != 0 && curMatch2 == curMatch)
173 | {
174 | offset -= 2;
175 | maxLen = kStartMaxLen;
176 | }
177 | }
178 |
179 | _hash[kFixHashSize + hashValue] = _pos;
180 |
181 | UInt32 ptr0 = (_cyclicBufferPos << 1) + 1;
182 | UInt32 ptr1 = (_cyclicBufferPos << 1);
183 |
184 | UInt32 len0, len1;
185 | len0 = len1 = kNumHashDirectBytes;
186 |
187 | if (kNumHashDirectBytes != 0)
188 | {
189 | if (curMatch > matchMinPos)
190 | {
191 | if (_bufferBase[_bufferOffset + curMatch + kNumHashDirectBytes] !=
192 | _bufferBase[cur + kNumHashDirectBytes])
193 | {
194 | distances[offset++] = maxLen = kNumHashDirectBytes;
195 | distances[offset++] = _pos - curMatch - 1;
196 | }
197 | }
198 | }
199 |
200 | UInt32 count = _cutValue;
201 |
202 | while(true)
203 | {
204 | if(curMatch <= matchMinPos || count-- == 0)
205 | {
206 | _son[ptr0] = _son[ptr1] = kEmptyHashValue;
207 | break;
208 | }
209 | UInt32 delta = _pos - curMatch;
210 | UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ?
211 | (_cyclicBufferPos - delta) :
212 | (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
213 |
214 | UInt32 pby1 = _bufferOffset + curMatch;
215 | UInt32 len = Math.Min(len0, len1);
216 | if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
217 | {
218 | while(++len != lenLimit)
219 | if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
220 | break;
221 | if (maxLen < len)
222 | {
223 | distances[offset++] = maxLen = len;
224 | distances[offset++] = delta - 1;
225 | if (len == lenLimit)
226 | {
227 | _son[ptr1] = _son[cyclicPos];
228 | _son[ptr0] = _son[cyclicPos + 1];
229 | break;
230 | }
231 | }
232 | }
233 | if (_bufferBase[pby1 + len] < _bufferBase[cur + len])
234 | {
235 | _son[ptr1] = curMatch;
236 | ptr1 = cyclicPos + 1;
237 | curMatch = _son[ptr1];
238 | len1 = len;
239 | }
240 | else
241 | {
242 | _son[ptr0] = curMatch;
243 | ptr0 = cyclicPos;
244 | curMatch = _son[ptr0];
245 | len0 = len;
246 | }
247 | }
248 | MovePos();
249 | return offset;
250 | }
251 |
252 | public void Skip(UInt32 num)
253 | {
254 | do
255 | {
256 | UInt32 lenLimit;
257 | if (_pos + _matchMaxLen <= _streamPos)
258 | lenLimit = _matchMaxLen;
259 | else
260 | {
261 | lenLimit = _streamPos - _pos;
262 | if (lenLimit < kMinMatchCheck)
263 | {
264 | MovePos();
265 | continue;
266 | }
267 | }
268 |
269 | UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
270 | UInt32 cur = _bufferOffset + _pos;
271 |
272 | UInt32 hashValue;
273 |
274 | if (HASH_ARRAY)
275 | {
276 | UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1];
277 | UInt32 hash2Value = temp & (kHash2Size - 1);
278 | _hash[hash2Value] = _pos;
279 | temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8);
280 | UInt32 hash3Value = temp & (kHash3Size - 1);
281 | _hash[kHash3Offset + hash3Value] = _pos;
282 | hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask;
283 | }
284 | else
285 | hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8);
286 |
287 | UInt32 curMatch = _hash[kFixHashSize + hashValue];
288 | _hash[kFixHashSize + hashValue] = _pos;
289 |
290 | UInt32 ptr0 = (_cyclicBufferPos << 1) + 1;
291 | UInt32 ptr1 = (_cyclicBufferPos << 1);
292 |
293 | UInt32 len0, len1;
294 | len0 = len1 = kNumHashDirectBytes;
295 |
296 | UInt32 count = _cutValue;
297 | while (true)
298 | {
299 | if (curMatch <= matchMinPos || count-- == 0)
300 | {
301 | _son[ptr0] = _son[ptr1] = kEmptyHashValue;
302 | break;
303 | }
304 |
305 | UInt32 delta = _pos - curMatch;
306 | UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ?
307 | (_cyclicBufferPos - delta) :
308 | (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
309 |
310 | UInt32 pby1 = _bufferOffset + curMatch;
311 | UInt32 len = Math.Min(len0, len1);
312 | if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
313 | {
314 | while (++len != lenLimit)
315 | if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
316 | break;
317 | if (len == lenLimit)
318 | {
319 | _son[ptr1] = _son[cyclicPos];
320 | _son[ptr0] = _son[cyclicPos + 1];
321 | break;
322 | }
323 | }
324 | if (_bufferBase[pby1 + len] < _bufferBase[cur + len])
325 | {
326 | _son[ptr1] = curMatch;
327 | ptr1 = cyclicPos + 1;
328 | curMatch = _son[ptr1];
329 | len1 = len;
330 | }
331 | else
332 | {
333 | _son[ptr0] = curMatch;
334 | ptr0 = cyclicPos;
335 | curMatch = _son[ptr0];
336 | len0 = len;
337 | }
338 | }
339 | MovePos();
340 | }
341 | while (--num != 0);
342 | }
343 |
344 | void NormalizeLinks(UInt32[] items, UInt32 numItems, UInt32 subValue)
345 | {
346 | for (UInt32 i = 0; i < numItems; i++)
347 | {
348 | UInt32 value = items[i];
349 | if (value <= subValue)
350 | value = kEmptyHashValue;
351 | else
352 | value -= subValue;
353 | items[i] = value;
354 | }
355 | }
356 |
357 | void Normalize()
358 | {
359 | UInt32 subValue = _pos - _cyclicBufferSize;
360 | NormalizeLinks(_son, _cyclicBufferSize * 2, subValue);
361 | NormalizeLinks(_hash, _hashSizeSum, subValue);
362 | ReduceOffsets((Int32)subValue);
363 | }
364 |
365 | public void SetCutValue(UInt32 cutValue) { _cutValue = cutValue; }
366 | }
367 | }
368 |
--------------------------------------------------------------------------------
/AssetStudio/AboutBox1.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2016 Radu
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 | */
22 |
23 | /*
24 | DISCLAIMER
25 | The reposiotory, code and tools provided herein are for educational purposes only.
26 | The information not meant to change or impact the original code, product or service.
27 | Use of this repository, code or tools does not exempt the user from any EULA, ToS or any other legal agreements that have been agreed with other parties.
28 | The user of this repository, code and tools is responsible for his own actions.
29 |
30 | Any forks, clones or copies of this repository are the responsability of their respective authors and users.
31 | */
32 |
33 | namespace Unity_Studio
34 | {
35 | partial class AboutBox1
36 | {
37 | ///
38 | /// Required designer variable.
39 | ///
40 | private System.ComponentModel.IContainer components = null;
41 |
42 | ///
43 | /// Clean up any resources being used.
44 | ///
45 | protected override void Dispose(bool disposing)
46 | {
47 | if (disposing && (components != null))
48 | {
49 | components.Dispose();
50 | }
51 | base.Dispose(disposing);
52 | }
53 |
54 | #region Windows Form Designer generated code
55 |
56 | ///
57 | /// Required method for Designer support - do not modify
58 | /// the contents of this method with the code editor.
59 | ///
60 | private void InitializeComponent()
61 | {
62 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBox1));
63 | this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
64 | this.logoPictureBox = new System.Windows.Forms.PictureBox();
65 | this.labelProductName = new System.Windows.Forms.Label();
66 | this.labelVersion = new System.Windows.Forms.Label();
67 | this.labelCopyright = new System.Windows.Forms.Label();
68 | this.labelCompanyName = new System.Windows.Forms.Label();
69 | this.textBoxDescription = new System.Windows.Forms.TextBox();
70 | this.okButton = new System.Windows.Forms.Button();
71 | this.tableLayoutPanel.SuspendLayout();
72 | ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit();
73 | this.SuspendLayout();
74 | //
75 | // tableLayoutPanel
76 | //
77 | this.tableLayoutPanel.ColumnCount = 2;
78 | this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F));
79 | this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67F));
80 | this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0);
81 | this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0);
82 | this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1);
83 | this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2);
84 | this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3);
85 | this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4);
86 | this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
87 | this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
88 | this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9);
89 | this.tableLayoutPanel.Name = "tableLayoutPanel";
90 | this.tableLayoutPanel.RowCount = 6;
91 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
92 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
93 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
94 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
95 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
96 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
97 | this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265);
98 | this.tableLayoutPanel.TabIndex = 0;
99 | //
100 | // logoPictureBox
101 | //
102 | this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
103 | this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image")));
104 | this.logoPictureBox.Location = new System.Drawing.Point(3, 3);
105 | this.logoPictureBox.Name = "logoPictureBox";
106 | this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6);
107 | this.logoPictureBox.Size = new System.Drawing.Size(131, 259);
108 | this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
109 | this.logoPictureBox.TabIndex = 12;
110 | this.logoPictureBox.TabStop = false;
111 | //
112 | // labelProductName
113 | //
114 | this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
115 | this.labelProductName.Location = new System.Drawing.Point(143, 0);
116 | this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
117 | this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17);
118 | this.labelProductName.Name = "labelProductName";
119 | this.labelProductName.Size = new System.Drawing.Size(271, 17);
120 | this.labelProductName.TabIndex = 19;
121 | this.labelProductName.Text = "Product Name";
122 | this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
123 | //
124 | // labelVersion
125 | //
126 | this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
127 | this.labelVersion.Location = new System.Drawing.Point(143, 26);
128 | this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
129 | this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17);
130 | this.labelVersion.Name = "labelVersion";
131 | this.labelVersion.Size = new System.Drawing.Size(271, 17);
132 | this.labelVersion.TabIndex = 0;
133 | this.labelVersion.Text = "Version";
134 | this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
135 | //
136 | // labelCopyright
137 | //
138 | this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
139 | this.labelCopyright.Location = new System.Drawing.Point(143, 52);
140 | this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
141 | this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17);
142 | this.labelCopyright.Name = "labelCopyright";
143 | this.labelCopyright.Size = new System.Drawing.Size(271, 17);
144 | this.labelCopyright.TabIndex = 21;
145 | this.labelCopyright.Text = "Copyright";
146 | this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
147 | //
148 | // labelCompanyName
149 | //
150 | this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
151 | this.labelCompanyName.Location = new System.Drawing.Point(143, 78);
152 | this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
153 | this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17);
154 | this.labelCompanyName.Name = "labelCompanyName";
155 | this.labelCompanyName.Size = new System.Drawing.Size(271, 17);
156 | this.labelCompanyName.TabIndex = 22;
157 | this.labelCompanyName.Text = "Company Name";
158 | this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
159 | //
160 | // textBoxDescription
161 | //
162 | this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
163 | this.textBoxDescription.Location = new System.Drawing.Point(143, 107);
164 | this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
165 | this.textBoxDescription.Multiline = true;
166 | this.textBoxDescription.Name = "textBoxDescription";
167 | this.textBoxDescription.ReadOnly = true;
168 | this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
169 | this.textBoxDescription.Size = new System.Drawing.Size(271, 126);
170 | this.textBoxDescription.TabIndex = 23;
171 | this.textBoxDescription.TabStop = false;
172 | this.textBoxDescription.Text = "Description";
173 | //
174 | // okButton
175 | //
176 | this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
177 | this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
178 | this.okButton.Location = new System.Drawing.Point(339, 239);
179 | this.okButton.Name = "okButton";
180 | this.okButton.Size = new System.Drawing.Size(75, 23);
181 | this.okButton.TabIndex = 24;
182 | this.okButton.Text = "&OK";
183 | //
184 | // AboutBox1
185 | //
186 | this.AcceptButton = this.okButton;
187 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
188 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
189 | this.ClientSize = new System.Drawing.Size(435, 283);
190 | this.Controls.Add(this.tableLayoutPanel);
191 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
192 | this.MaximizeBox = false;
193 | this.MinimizeBox = false;
194 | this.Name = "AboutBox1";
195 | this.Padding = new System.Windows.Forms.Padding(9);
196 | this.ShowIcon = false;
197 | this.ShowInTaskbar = false;
198 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
199 | this.Text = "AboutBox1";
200 | this.tableLayoutPanel.ResumeLayout(false);
201 | this.tableLayoutPanel.PerformLayout();
202 | ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit();
203 | this.ResumeLayout(false);
204 |
205 | }
206 |
207 | #endregion
208 |
209 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
210 | private System.Windows.Forms.PictureBox logoPictureBox;
211 | private System.Windows.Forms.Label labelProductName;
212 | private System.Windows.Forms.Label labelVersion;
213 | private System.Windows.Forms.Label labelCopyright;
214 | private System.Windows.Forms.Label labelCompanyName;
215 | private System.Windows.Forms.TextBox textBoxDescription;
216 | private System.Windows.Forms.Button okButton;
217 | }
218 | }
219 |
--------------------------------------------------------------------------------