mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(MCG): copy array instead of clone.
This commit is contained in:
@@ -213,12 +213,13 @@ namespace GameRes.Formats.FC01
|
|||||||
#if DEBUG
|
#if DEBUG
|
||||||
else // bruteforce key *in debug build only*
|
else // bruteforce key *in debug build only*
|
||||||
{
|
{
|
||||||
|
var copy = new byte[m_input.Length];
|
||||||
for (int key = 1; key < 256; ++key)
|
for (int key = 1; key < 256; ++key)
|
||||||
{
|
{
|
||||||
var copy = m_input.Clone() as byte[];
|
Buffer.BlockCopy (m_input, 0, copy, 0, m_input.Length);
|
||||||
MrgOpener.Decrypt (copy, 0, copy.Length-1, (byte)key);
|
MrgOpener.Decrypt (copy, 0, copy.Length-1, (byte)key);
|
||||||
using (var input = new BinMemoryStream (copy))
|
using (var input = new BinMemoryStream (copy))
|
||||||
using (var lzss = new MrgLzssReader (input, m_input.Length, Stride * m_height))
|
using (var lzss = new MrgLzssReader (input, copy.Length, Stride * m_height))
|
||||||
{
|
{
|
||||||
lzss.Unpack();
|
lzss.Unpack();
|
||||||
if (input.Length - input.Position <= 1)
|
if (input.Length - input.Position <= 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user