Guest User

genshin_assetstudio

a guest
Nov 7th, 2020
2,100
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/AssetStudio/BundleFile.cs b/AssetStudio/BundleFile.cs
  2. index 95d7cd9..90d3581 100644
  3. --- a/AssetStudio/BundleFile.cs
  4. +++ b/AssetStudio/BundleFile.cs
  5. @@ -45,6 +45,10 @@ namespace AssetStudio
  6.          {
  7.              m_Header = new Header();
  8.              m_Header.signature = reader.ReadStringToNull();
  9. +            if (m_Header.signature == null)
  10. +            {
  11. +                m_Header.signature = "";
  12. +            }
  13.              switch (m_Header.signature)
  14.              {
  15.                  case "UnityArchive":
  16. diff --git a/AssetStudio/Classes/Mesh.cs b/AssetStudio/Classes/Mesh.cs
  17. index ce145d5..08835ab 100644
  18. --- a/AssetStudio/Classes/Mesh.cs
  19. +++ b/AssetStudio/Classes/Mesh.cs
  20. @@ -547,6 +547,7 @@ namespace AssetStudio
  21.                  //Unity fixed it in 2017.3.1p1 and later versions
  22.                  if ((version[0] > 2017 || (version[0] == 2017 && version[1] >= 4)) || //2017.4
  23.                      ((version[0] == 2017 && version[1] == 3 && version[2] == 1) && buildType.IsPatch) || //fixed after 2017.3.1px
  24. +                    (version[0] == 2017 && version[1] == 1 && version[2] == 0) || // For Gshin
  25.                      ((version[0] == 2017 && version[1] == 3) && m_MeshCompression == 0))//2017.3.xfx with no compression
  26.                  {
  27.                      var m_IndexFormat = reader.ReadInt32();
  28. diff --git a/AssetStudio/Classes/Shader.cs b/AssetStudio/Classes/Shader.cs
  29. index 57f91a7..f2cd8b6 100644
  30. --- a/AssetStudio/Classes/Shader.cs
  31. +++ b/AssetStudio/Classes/Shader.cs
  32. @@ -792,6 +792,10 @@ namespace AssetStudio
  33.                      offsets = reader.ReadUInt32Array();
  34.                      compressedLengths = reader.ReadUInt32Array();
  35.                      decompressedLengths = reader.ReadUInt32Array();
  36. +                    if (version[0] == 2017 && version[1] == 1 && version[2] == 0) // For Gshin
  37. +                    {
  38. +                        reader.ReadBytes(reader.ReadInt32());
  39. +                    }
  40.                  }
  41.                  compressedBlob = reader.ReadBytes(reader.ReadInt32());
  42.              }
  43. diff --git a/AssetStudio/ImportHelper.cs b/AssetStudio/ImportHelper.cs
  44. index fea5d53..31e1cc6 100644
  45. --- a/AssetStudio/ImportHelper.cs
  46. +++ b/AssetStudio/ImportHelper.cs
  47. @@ -72,6 +72,10 @@ namespace AssetStudio
  48.          private static FileType CheckFileType(EndianBinaryReader reader)
  49.          {
  50.              var signature = reader.ReadStringToNull(20);
  51. +            if (signature == null)
  52. +            {
  53. +                signature = "";
  54. +            }
  55.              reader.Position = 0;
  56.              switch (signature)
  57.              {
  58. diff --git a/AssetStudio/TypeTreeHelper.cs b/AssetStudio/TypeTreeHelper.cs
  59. index 52bb2ea..9c66530 100644
  60. --- a/AssetStudio/TypeTreeHelper.cs
  61. +++ b/AssetStudio/TypeTreeHelper.cs
  62. @@ -30,6 +30,10 @@ namespace AssetStudio
  63.              object value = null;
  64.              var append = true;
  65.              var align = (member.m_MetaFlag & 0x4000) != 0;
  66. +            if (varTypeStr == null)
  67. +            {
  68. +                varTypeStr = "";
  69. +            }
  70.              switch (varTypeStr)
  71.              {
  72.                  case "SInt8":
  73. @@ -178,6 +182,10 @@ namespace AssetStudio
  74.          {
  75.              var member = members[i];
  76.              var varTypeStr = member.m_Type;
  77. +            if (varTypeStr == null)
  78. +            {
  79. +                varTypeStr = "";
  80. +            }
  81.              object value;
  82.              var align = (member.m_MetaFlag & 0x4000) != 0;
  83.              switch (varTypeStr)
  84.  
RAW Paste Data