mirror of
https://github.com/rvtr/ctr_test_tools.git
synced 2025-10-31 13:41:24 -04:00
TWLBackupBlock:BkpType の追加と、Blocks に private save 追加。
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_test_tools@33 6b0af911-cb57-b745-895f-eec5701120e1
This commit is contained in:
parent
217a112a59
commit
4cade41cb1
@ -3,20 +3,28 @@ using System.Diagnostics;
|
|||||||
|
|
||||||
namespace TwlBackupBlock
|
namespace TwlBackupBlock
|
||||||
{
|
{
|
||||||
|
public enum BkpType
|
||||||
|
{
|
||||||
|
NORMAL,
|
||||||
|
WITH_PRIVATE_SAVE,
|
||||||
|
LEGACY
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ブロックの集合です。
|
/// ブロックの集合です。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Blocks : ICloneable
|
public class Blocks : ICloneable
|
||||||
{
|
{
|
||||||
private const int NUM_BLOCKS = 14;
|
private const int NUM_BLOCKS = 15;
|
||||||
|
|
||||||
public Block banner;
|
public Block banner;
|
||||||
public Block header;
|
public Block header;
|
||||||
public Block signature;
|
public Block signature;
|
||||||
public Block tmd;
|
public Block tmd;
|
||||||
public Block[] content;
|
public Block[] content;
|
||||||
public Block saveData;
|
public Block publicSave;
|
||||||
public Block subBanner;
|
public Block subBanner;
|
||||||
|
public Block privateSave;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Blocksクラスの新しいインスタンスを初期化します。
|
/// Blocksクラスの新しいインスタンスを初期化します。
|
||||||
@ -32,8 +40,9 @@ namespace TwlBackupBlock
|
|||||||
{
|
{
|
||||||
content[i] = new Block();
|
content[i] = new Block();
|
||||||
}
|
}
|
||||||
saveData = new Block();
|
publicSave = new Block();
|
||||||
subBanner = new Block();
|
subBanner = new Block();
|
||||||
|
privateSave = new Block();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -57,8 +66,9 @@ namespace TwlBackupBlock
|
|||||||
case 1: return header;
|
case 1: return header;
|
||||||
case 2: return signature;
|
case 2: return signature;
|
||||||
case 3: return tmd;
|
case 3: return tmd;
|
||||||
case 12: return saveData;
|
case 12: return publicSave;
|
||||||
case 13: return subBanner;
|
case 13: return subBanner;
|
||||||
|
case 14: return privateSave;
|
||||||
default:
|
default:
|
||||||
Debug.Assert(false);
|
Debug.Assert(false);
|
||||||
return null; // never reach
|
return null; // never reach
|
||||||
@ -96,8 +106,12 @@ namespace TwlBackupBlock
|
|||||||
newBlocks.content[i] = (Block)content[i].Clone();
|
newBlocks.content[i] = (Block)content[i].Clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newBlocks.saveData = (Block)saveData.Clone();
|
newBlocks.publicSave = (Block)publicSave.Clone();
|
||||||
newBlocks.subBanner = (Block)subBanner.Clone();
|
newBlocks.subBanner = (Block)subBanner.Clone();
|
||||||
|
if (privateSave.body != null)
|
||||||
|
{
|
||||||
|
newBlocks.privateSave = (Block)privateSave.Clone();
|
||||||
|
}
|
||||||
return newBlocks;
|
return newBlocks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user