diff options
Diffstat (limited to 'ConsoleApp/ResFileCommands.cs')
-rw-r--r-- | ConsoleApp/ResFileCommands.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ConsoleApp/ResFileCommands.cs b/ConsoleApp/ResFileCommands.cs index ac734e4..83c28b2 100644 --- a/ConsoleApp/ResFileCommands.cs +++ b/ConsoleApp/ResFileCommands.cs @@ -85,5 +85,33 @@ namespace ConsoleApp { return "syntax: list <filename> -- lists the contents of a .brres file"; } } + + + public class ListOffsetsCommand : Command { + // this class also doesn't inherit from ResFileCommand, because I want to + // keep the OffsetMap + + public ListOffsetsCommand() : base("list offsets of data within a .brres file") { + } + + + public override void Execute(string[] args) { + if (args.Length == 0) { + Console.WriteLine("No path entered"); + return; + } + + SortedDictionary<int, string> offsetMap; + var rf = BrresReader.LoadFile(System.IO.File.ReadAllBytes(args[0]), false, out offsetMap); + + foreach (var e in offsetMap) { + Console.WriteLine("0x{0:X} : {1}", e.Key, e.Value); + } + } + + public override string GetHelp(string[] args) { + return "syntax: init <filename> -- creates an empty .brres file"; + } + } } |