diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2021-06-11 12:50:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-11 12:50:29 -0400 |
| commit | c6b352aac040527d2962f3e764e460eb9e813fe5 (patch) | |
| tree | bd47345f243f3a24f747d9ffc00cb550597964ab /ZAPD/ZFile.cpp | |
| parent | d9d3162abbe7bf1dfe8bdb0d6e3cad81f58db8a1 (diff) | |
strip extra padding at the end of each file (#150)
Diffstat (limited to 'ZAPD/ZFile.cpp')
| -rw-r--r-- | ZAPD/ZFile.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ZAPD/ZFile.cpp b/ZAPD/ZFile.cpp index 9e5bb94..3e1559e 100644 --- a/ZAPD/ZFile.cpp +++ b/ZAPD/ZFile.cpp @@ -919,8 +919,14 @@ std::string ZFile::ProcessDeclarations() std::string unaccountedPrefix = "unaccounted"; if (diff < 16 && !nonZeroUnaccounted) + { unaccountedPrefix = "possiblePadding"; + // Strip unnecessary padding at the end of the file. + if (unaccountedAddress + diff >= rawData.size()) + break; + } + Declaration* decl = AddDeclarationArray( unaccountedAddress, DeclarationAlignment::None, diff, "static u8", StringHelper::Sprintf("%s_%06X", unaccountedPrefix.c_str(), |
