summaryrefslogtreecommitdiff
path: root/ConsoleApp/ResFileCommands.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-03-26 05:14:59 +0100
committerTreeki <treeki@gmail.com>2011-03-26 05:14:59 +0100
commitcff0bbcdf339ec99b9a1311605fb16f6378b3fb4 (patch)
treee921928236eef23869ddf4d27faa01f14e457594 /ConsoleApp/ResFileCommands.cs
parente00b60edda34f50baaa0a21cf2bae4fcad1609a4 (diff)
downloadnw4rtools-cff0bbcdf339ec99b9a1311605fb16f6378b3fb4.tar.gz
nw4rtools-cff0bbcdf339ec99b9a1311605fb16f6378b3fb4.zip
the Wii killing bug is hopefully gone for good! also, a few other improvements
Diffstat (limited to 'ConsoleApp/ResFileCommands.cs')
-rw-r--r--ConsoleApp/ResFileCommands.cs28
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";
+ }
+ }
}