diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2021-12-26 23:57:11 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-26 23:57:11 -0500 |
| commit | fd5a7f434171a33b1b3eb2a3e112fdcee6d9262d (patch) | |
| tree | bdbb584b92643315bb181aa09e2d6b43d98bed24 | |
| parent | 155a463a54a3bc9b9c86000ae6d819455875ec15 (diff) | |
Add flag to force unaccounted to be static (#216)
* add forced static
* add flag for forcing unaccounted to be static
* Update README.md
Co-authored-by: Louis <louist103@pop-os.localdomain>
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | ZAPD/Globals.h | 1 | ||||
| -rw-r--r-- | ZAPD/Main.cpp | 4 | ||||
| -rw-r--r-- | ZAPD/ZFile.cpp | 3 |
4 files changed, 9 insertions, 0 deletions
@@ -119,6 +119,7 @@ ZAPD also accepts the following list of extra parameters: - `-tm MODE`: Test Mode (enables certain experimental features). To enable it, set `MODE` to `1`. - `-se` / `--set-exporter` : Sets which exporter to use. - `--gcc-compat` : Enables GCC compatibly mode. Slower. +- `-us` / `--unaccounted-static` : Mark unaccounted data as `static` - `-s` / `--static` : Mark every asset as `static`. - This behaviour can be overridden per asset using `Static=` in the respective XML node. - `-W...`: warning flags, see below diff --git a/ZAPD/Globals.h b/ZAPD/Globals.h index 0cffa4c..1ae753e 100644 --- a/ZAPD/Globals.h +++ b/ZAPD/Globals.h @@ -58,6 +58,7 @@ public: bool verboseUnaccounted = false; bool gccCompat = false; bool forceStatic = false; + bool forceUnaccountedStatic = false; std::vector<ZFile*> files; std::vector<ZFile*> externalFiles; diff --git a/ZAPD/Main.cpp b/ZAPD/Main.cpp index 8f723a7..048338f 100644 --- a/ZAPD/Main.cpp +++ b/ZAPD/Main.cpp @@ -216,6 +216,10 @@ int main(int argc, char* argv[]) { Globals::Instance->forceStatic = true; } + else if (arg == "-us" || arg == "--unaccounted-static") + { + Globals::Instance->forceUnaccountedStatic = true; + } } // Parse File Mode diff --git a/ZAPD/ZFile.cpp b/ZAPD/ZFile.cpp index f7f3f69..22a6a45 100644 --- a/ZAPD/ZFile.cpp +++ b/ZAPD/ZFile.cpp @@ -1305,7 +1305,10 @@ bool ZFile::HandleUnaccountedAddress(offset_t currentAddress, offset_t lastAddr, StringHelper::Sprintf("%s_%s_%06X", name.c_str(), unaccountedPrefix.c_str(), unaccountedAddress), diff, src); + decl->isUnaccounted = true; + if (Globals::Instance->forceUnaccountedStatic) + decl->staticConf = StaticConfig::On; if (nonZeroUnaccounted) { |
