mirror of
https://github.com/Wack0/IFPSTools.NET.git
synced 2025-06-18 10:45:36 -04:00
ifpsdasm: Add some usage and confirmation text. Use only a single argument, not all arguments.
This commit is contained in:
parent
9b71ef23ca
commit
bebf897e31
@ -13,13 +13,20 @@ namespace ifpsdasm
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
foreach (var arg in args)
|
||||
if (args.Length == 0)
|
||||
{
|
||||
var ext = Path.GetExtension(arg);
|
||||
var dis = arg.Substring(0, arg.Length - ext.Length) + ".txt";
|
||||
using (var stream = File.OpenRead(arg))
|
||||
File.WriteAllText(dis, Script.Load(stream).Disassemble());
|
||||
Console.WriteLine("Usage: {0} <CompiledCode.bin>", Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().Location));
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("RemObjects PascalScript disassembler.");
|
||||
Console.WriteLine("Writes the output to the *.txt file in the same directory as the passed in script bytecode.");
|
||||
return;
|
||||
}
|
||||
var arg = args[0];
|
||||
var ext = Path.GetExtension(arg);
|
||||
var dis = arg.Substring(0, arg.Length - ext.Length) + ".txt";
|
||||
using (var stream = File.OpenRead(arg))
|
||||
File.WriteAllText(dis, Script.Load(stream).Disassemble());
|
||||
Console.WriteLine("Disassembled script to {0}", dis);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user