Updated arookas library
Now it uses the public repository, making syncing updates much easier.
This commit is contained in:
parent
7af004c617
commit
a4e0af193e
4 changed files with 10 additions and 11 deletions
|
@ -8,7 +8,7 @@ namespace arookas
|
||||||
static class SSC {
|
static class SSC {
|
||||||
static void Main(string[] args) {
|
static void Main(string[] args) {
|
||||||
Message("ssc v0.1 arookas\n");
|
Message("ssc v0.1 arookas\n");
|
||||||
var cmd = new CommandLine(args);
|
var cmd = new aCommandLine(args);
|
||||||
if (cmd.Count == 0) {
|
if (cmd.Count == 0) {
|
||||||
Message("Usage: ssc -input <input.sun> [-output <output.sb>]\n");
|
Message("Usage: ssc -input <input.sun> [-output <output.sb>]\n");
|
||||||
Pause();
|
Pause();
|
||||||
|
@ -58,7 +58,7 @@ namespace arookas
|
||||||
}
|
}
|
||||||
|
|
||||||
// command-line
|
// command-line
|
||||||
static void ReadCmdLine(CommandLine cmd, out string inputFile, out string outputFile) {
|
static void ReadCmdLine(aCommandLine cmd, out string inputFile, out string outputFile) {
|
||||||
inputFile = null;
|
inputFile = null;
|
||||||
outputFile = null;
|
outputFile = null;
|
||||||
foreach (var prm in cmd) {
|
foreach (var prm in cmd) {
|
||||||
|
@ -76,7 +76,7 @@ namespace arookas
|
||||||
outputFile = Path.ChangeExtension(inputFile, ".sb");
|
outputFile = Path.ChangeExtension(inputFile, ".sb");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void GetInput(CommandLineParameter prm, ref string inputFile) {
|
static void GetInput(aCommandLineParameter prm, ref string inputFile) {
|
||||||
if (inputFile != null) {
|
if (inputFile != null) {
|
||||||
Error("Only one -input option is allowed.\n");
|
Error("Only one -input option is allowed.\n");
|
||||||
Pause();
|
Pause();
|
||||||
|
@ -89,7 +89,7 @@ namespace arookas
|
||||||
}
|
}
|
||||||
inputFile = prm[0];
|
inputFile = prm[0];
|
||||||
}
|
}
|
||||||
static void GetOutput(CommandLineParameter prm, ref string outputFile) {
|
static void GetOutput(aCommandLineParameter prm, ref string outputFile) {
|
||||||
if (outputFile != null) {
|
if (outputFile != null) {
|
||||||
Error("Only one -output option is allowed.\n");
|
Error("Only one -output option is allowed.\n");
|
||||||
Pause();
|
Pause();
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace arookas {
|
||||||
|
|
||||||
static void ReadCommandLine(string[] args) {
|
static void ReadCommandLine(string[] args) {
|
||||||
Console.WriteLine("Reading command line...");
|
Console.WriteLine("Reading command line...");
|
||||||
sSettings = new CommandLineSettings(new CommandLine(args));
|
sSettings = new CommandLineSettings(new aCommandLine(args));
|
||||||
}
|
}
|
||||||
static void CreateReader(Stream stream) {
|
static void CreateReader(Stream stream) {
|
||||||
Console.WriteLine("Creating binary reader...");
|
Console.WriteLine("Creating binary reader...");
|
||||||
|
@ -240,7 +240,7 @@ namespace arookas {
|
||||||
static string FetchDataValue(uint ofs) {
|
static string FetchDataValue(uint ofs) {
|
||||||
sReader.Keep();
|
sReader.Keep();
|
||||||
sReader.Goto(sDataOffset + (4 * sDataCount) + ofs);
|
sReader.Goto(sDataOffset + (4 * sDataCount) + ofs);
|
||||||
var data = sReader.ReadString(aBinaryStringFormat.NullTerminated);
|
var data = sReader.ReadString<aZSTR>();
|
||||||
sReader.Back();
|
sReader.Back();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,7 @@ namespace arookas {
|
||||||
static string FetchSymbolName(Symbol symbol) {
|
static string FetchSymbolName(Symbol symbol) {
|
||||||
sReader.Keep();
|
sReader.Keep();
|
||||||
sReader.Goto(sDynsymOffset + (20 * sDynsymCount) + symbol.StringOffset);
|
sReader.Goto(sDynsymOffset + (20 * sDynsymCount) + symbol.StringOffset);
|
||||||
var name = sReader.ReadString(aBinaryStringFormat.NullTerminated);
|
var name = sReader.ReadString<aZSTR>();
|
||||||
sReader.Back();
|
sReader.Back();
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace arookas {
|
||||||
public bool OutputDynsym { get { return mOutputDynsym; } }
|
public bool OutputDynsym { get { return mOutputDynsym; } }
|
||||||
public bool OutputBss { get { return mOutputBss; } }
|
public bool OutputBss { get { return mOutputBss; } }
|
||||||
|
|
||||||
public CommandLineSettings(CommandLine cmd) {
|
public CommandLineSettings(aCommandLine cmd) {
|
||||||
if (cmd == null) {
|
if (cmd == null) {
|
||||||
throw new ArgumentNullException("cmd");
|
throw new ArgumentNullException("cmd");
|
||||||
}
|
}
|
||||||
|
|
|
@ -466,7 +466,7 @@ namespace arookas {
|
||||||
throw new ArgumentNullException("data");
|
throw new ArgumentNullException("data");
|
||||||
}
|
}
|
||||||
mData.Writer.Write32(mDataString.Size);
|
mData.Writer.Write32(mDataString.Size);
|
||||||
mDataString.Writer.WriteString(data, aBinaryStringFormat.NullTerminated);
|
mDataString.Writer.WriteString<aZSTR>(data);
|
||||||
++mDataCount;
|
++mDataCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +477,7 @@ namespace arookas {
|
||||||
mSymbol.Writer.Write32(data);
|
mSymbol.Writer.Write32(data);
|
||||||
mSymbol.Writer.Write32(0u); // runtime field (hash)
|
mSymbol.Writer.Write32(0u); // runtime field (hash)
|
||||||
mSymbol.Writer.Write32(0u); // runtime field (funcptr)
|
mSymbol.Writer.Write32(0u); // runtime field (funcptr)
|
||||||
mSymbolString.Writer.WriteString(name, aBinaryStringFormat.NullTerminated);
|
mSymbolString.Writer.WriteString<aZSTR>(name);
|
||||||
++mSymbolCount;
|
++mSymbolCount;
|
||||||
if (type == sunSymbolType.Variable) {
|
if (type == sunSymbolType.Variable) {
|
||||||
++mVarCount;
|
++mVarCount;
|
||||||
|
@ -508,7 +508,6 @@ namespace arookas {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
mWriter.Dispose();
|
|
||||||
mStream.Dispose();
|
mStream.Dispose();
|
||||||
}
|
}
|
||||||
public void Copy(aBinaryWriter writer) {
|
public void Copy(aBinaryWriter writer) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue