From bcee32e66cc4399a544f9326629709d449c6c002 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 11 May 2024 10:13:54 -0700 Subject: [PATCH] Allow relativization of variables if they can be annotated again --- Bit Slicer/ZGDocumentWindowController.m | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Bit Slicer/ZGDocumentWindowController.m b/Bit Slicer/ZGDocumentWindowController.m index aeb8d43f..703c4731 100644 --- a/Bit Slicer/ZGDocumentWindowController.m +++ b/Bit Slicer/ZGDocumentWindowController.m @@ -1444,8 +1444,6 @@ - (BOOL)validateUserInterfaceItem:(id )userInterfa return NO; } - NSArray *machBinaries = [ZGMachBinary machBinariesInProcess:self.currentProcess]; - ZGMachBinary *mainMachBinary = [ZGMachBinary mainMachBinaryFromMachBinaries:machBinaries]; for (ZGVariable *variable in selectedVariables) { if (variable.type == ZGScript) @@ -1454,19 +1452,9 @@ - (BOOL)validateUserInterfaceItem:(id )userInterfa } // Allow "relativizing" variables if they can still be annotated further - if (variable.usesDynamicAddress && (variable.userAnnotated || variable.fullAttributedDescription.length != 0)) - { - return NO; - } - - ZGMachBinary *machBinary = [ZGMachBinary machBinaryNearestToAddress:variable.address fromMachBinaries:machBinaries]; - if (machBinary == nil) - { - return NO; - } - - ZGMachBinaryInfo *machBinaryInfo = [machBinary machBinaryInfoInProcess:self.currentProcess]; - if (machBinaryInfo.slide == 0 && machBinary.headerAddress == mainMachBinary.headerAddress) + // This is including if they were annotated before, in case the annotation + // can be updated. + if (variable.usesDynamicAddress && variable.userAnnotated) { return NO; }