mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Move more helper methods around
This commit is contained in:
@@ -93,7 +93,7 @@ The following systems have headers that this program can work with:
|
||||
using var fs = File.OpenRead(file);
|
||||
byte[] hbin = new byte[int.Parse(rule.StartOffset)];
|
||||
fs.Read(hbin, 0, int.Parse(rule.StartOffset));
|
||||
hstr = Utilities.ByteArrayToString(hbin);
|
||||
hstr = TextHelper.ByteArrayToString(hbin);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -112,7 +112,7 @@ The following systems have headers that this program can work with:
|
||||
if (!nostore)
|
||||
{
|
||||
BaseFile baseFile = BaseFile.GetInfo(newfile, hashes: Hash.SHA1, asFiles: TreatAsFile.NonArchive);
|
||||
AddHeaderToDatabase(hstr, Utilities.ByteArrayToString(baseFile.SHA1), rule.SourceFile);
|
||||
AddHeaderToDatabase(hstr, TextHelper.ByteArrayToString(baseFile.SHA1), rule.SourceFile);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -71,7 +71,7 @@ The following systems have headers that this program can work with:
|
||||
BaseFile baseFile = BaseFile.GetInfo(file, hashes: Hash.SHA1, asFiles: TreatAsFile.NonArchive);
|
||||
|
||||
// Retrieve a list of all related headers from the database
|
||||
List<string> headers = RetrieveHeadersFromDatabase(Utilities.ByteArrayToString(baseFile.SHA1));
|
||||
List<string> headers = RetrieveHeadersFromDatabase(TextHelper.ByteArrayToString(baseFile.SHA1));
|
||||
|
||||
// If we have nothing retrieved, we return false
|
||||
if (headers.Count == 0)
|
||||
@@ -82,7 +82,7 @@ The following systems have headers that this program can work with:
|
||||
{
|
||||
string outputFile = (string.IsNullOrWhiteSpace(outDir) ? $"{Path.GetFullPath(file)}.new" : Path.Combine(outDir, Path.GetFileName(file))) + i;
|
||||
logger.User($"Creating reheadered file: {outputFile}");
|
||||
AppendBytes(file, outputFile, Utilities.StringToByteArray(headers[i]), null);
|
||||
AppendBytes(file, outputFile, TextHelper.StringToByteArray(headers[i]), null);
|
||||
logger.User("Reheadered file created!");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user