GP-3926: Tweaking how the MachoLoader handles binaries with obfuscated

segment and section names (#3876)
This commit is contained in:
Ryan Kurtz
2023-10-17 14:18:57 -04:00
parent 097a71c2e2
commit 83313a7b5a

View File

@@ -403,7 +403,9 @@ public class MachHeader implements StructConverter {
List<Section> sections = segment.getSections();
for (int j = 0; j < sections.size(); j++) {
Section section = sections.get(j);
section.setSegmentName(segment.getSegmentName());
if (invalid.apply(section.getSegmentName())) {
section.setSegmentName("__INVALID.%d".formatted(i));
}
if (invalid.apply(section.getSectionName())) {
section.setSectionName("__invalid.%d".formatted(j));
}