Skip to content

Commit

Permalink
Improve exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
davidxuang committed Nov 24, 2023
1 parent d5956ad commit 5c08bd4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MusicDecrypto.Library/Vendor/Tencent/QmcDecrypto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public QmcDecrypto(
case 0x67615453: // "STag"
throw new NotSupportedException("Unsupported new format.");

case 0x786563: // "musicex "
_buffer.Seek(-8, SeekOrigin.End);
var prefix = _reader.ReadInt32();
if (prefix == 0x6973756d) throw new NotSupportedException("Unsupported new format.");
else goto default;

case > 0 and < 0x400:
length = _buffer.Length - 4 - indicator;
try
Expand All @@ -69,6 +75,7 @@ public QmcDecrypto(
else throw;
}
break;

default:
length = _buffer.Length - 4;
break;
Expand Down

0 comments on commit 5c08bd4

Please sign in to comment.