Move more helper methods around

This commit is contained in:
Matt Nadareski
2023-08-14 13:36:37 -04:00
parent b37aed389e
commit 2e662c0b4e
15 changed files with 145 additions and 144 deletions

View File

@@ -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;

View File

@@ -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!");
}