From 6898a7d97dd136447871ee4e89bcf7cc465e1a68 Mon Sep 17 00:00:00 2001 From: Sajid Date: Sat, 28 Sep 2024 22:44:27 +0600 Subject: [PATCH] Named recompiled entry point --- PowerRecomp/main.cpp | 6 ++++++ PowerUtils/symbol.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PowerRecomp/main.cpp b/PowerRecomp/main.cpp index ad964b7..db0e4b5 100644 --- a/PowerRecomp/main.cpp +++ b/PowerRecomp/main.cpp @@ -29,6 +29,12 @@ int main(int argc, char* argv[]) std::println("Analysing functions..."); recompiler.Analyse(); + auto entry = recompiler.image.symbols.find(recompiler.image.entry_point); + if (entry != recompiler.image.symbols.end()) + { + entry->name = "_xstart"; + } + recompiler.Recompile(argv[3]); } else diff --git a/PowerUtils/symbol.h b/PowerUtils/symbol.h index 378fc0e..161fd46 100644 --- a/PowerUtils/symbol.h +++ b/PowerUtils/symbol.h @@ -12,10 +12,10 @@ enum SymbolType struct Symbol { - std::string name{}; + mutable std::string name{}; uint32_t address{}; uint32_t size{}; - SymbolType type{}; + mutable SymbolType type{}; }; struct SymbolComparer