feat(relinker): exclude single sce_module files, tolerate a zero code tail

- --exclude-sce-module <file> (repeatable) drops one title module from
  guest conversion, e.g. a title libc.prx, while the rest of sce_module
  is still relinked as guest modules
- the instruction scanner stops at zero padding that ends a code segment
  with an odd byte instead of failing on a truncated `add [rax], al`

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
STL1te
2026-09-29 07:53:49 +03:00
parent 75a8668b5e
commit f4f8d5bbce
7 changed files with 31 additions and 4 deletions
+2 -1
View File
@@ -71,6 +71,7 @@ int main(const int argc, char* argv[]) {
std::cout << "System: " << (args.toWindows ? "Windows" : "Linux") << "; unused-filter=" << args.unusedFilterLevel << "\n";
std::cout << "sce_module/sce_modules processing: " << (args.skipSceModule ? "disabled (--skip-sce-module)" : "enabled") << '\n';
for (const auto& name : args.excludedSceModules) std::cout << "sce_module excluded: " << name << '\n';
auto result = pipeline->Relink(sourceBytes);
for (const auto& patch : result.Patches) {
if (patch.Offset > sourceBytes.size() || patch.Bytes.size() > sourceBytes.size() - patch.Offset)
@@ -80,7 +81,7 @@ int main(const int argc, char* argv[]) {
std::vector<Relinker::GuestArtifact> guestArtifacts;
if (!args.skipSceModule) {
guestArtifacts = Relinker::GuestModuleBuilder().Build(args.inputPath, absPath, result.DynamicSection, args.toWindows, args.toIntel, *syscallScanner, args.lazyBinding, args.runPath);
guestArtifacts = Relinker::GuestModuleBuilder().Build(args.inputPath, absPath, result.DynamicSection, args.toWindows, args.toIntel, *syscallScanner, args.lazyBinding, args.runPath, args.excludedSceModules);
}
if (args.writeRegistry) {