Add header padding strings

This commit is contained in:
Matt Nadareski
2022-12-10 17:31:41 -08:00
parent 3c3fd1be50
commit d1a6c9be00
3 changed files with 74 additions and 41 deletions

View File

@@ -352,6 +352,33 @@ namespace BurnOutSharp.Wrappers
}
}
/// <summary>
/// Header padding strings, if they exist
/// </summary>
public List<string> HeaderPaddingStrings
{
get
{
lock (_sourceDataLock)
{
// If we already have cached data, just use that immediately
if (_headerPaddingStrings != null)
return _headerPaddingStrings;
// TODO: Don't scan the known header data as well
// Populate the raw header padding data based on the source
uint headerStartAddress = Stub_NewExeHeaderAddr;
uint firstSectionAddress = SectionTable.Select(s => s.PointerToRawData).Where(s => s != 0).OrderBy(s => s).First();
int headerLength = (int)(firstSectionAddress - headerStartAddress);
_headerPaddingStrings = ReadStringsFromDataSource((int)headerStartAddress, headerLength, charLimit: 3);
// Cache and return the header padding data, even if null
return _headerPaddingStrings;
}
}
}
/// <summary>
/// Overlay data, if it exists
/// </summary>
@@ -663,6 +690,11 @@ namespace BurnOutSharp.Wrappers
/// </summary>
private byte[] _headerPaddingData = null;
/// <summary>
/// Header padding data, if it exists
/// </summary>
private List<string> _headerPaddingStrings = null;
/// <summary>
/// Overlay data, if it exists
/// </summary>