diff --git a/Bit Slicer/Base.lproj/Debugger Window.xib b/Bit Slicer/Base.lproj/Debugger Window.xib index cf1ed09c..7f7a7623 100644 --- a/Bit Slicer/Base.lproj/Debugger Window.xib +++ b/Bit Slicer/Base.lproj/Debugger Window.xib @@ -1,8 +1,8 @@ - + - + @@ -38,6 +38,12 @@ + + + + + + @@ -85,7 +91,7 @@ - + @@ -100,7 +106,7 @@ - + @@ -132,7 +138,7 @@ - + @@ -144,7 +150,7 @@ - + @@ -216,7 +222,7 @@ - + @@ -254,10 +260,6 @@ - - - - @@ -269,6 +271,10 @@ + + + + @@ -314,7 +320,7 @@ - + @@ -353,8 +359,8 @@ - - + + diff --git a/Bit Slicer/Base.lproj/MainMenu.xib b/Bit Slicer/Base.lproj/MainMenu.xib index f2947e1f..9f496498 100644 --- a/Bit Slicer/Base.lproj/MainMenu.xib +++ b/Bit Slicer/Base.lproj/MainMenu.xib @@ -168,6 +168,12 @@ + + + + + + diff --git a/Bit Slicer/Base.lproj/Search Document Window.xib b/Bit Slicer/Base.lproj/Search Document Window.xib index 33cb3022..474ffa09 100644 --- a/Bit Slicer/Base.lproj/Search Document Window.xib +++ b/Bit Slicer/Base.lproj/Search Document Window.xib @@ -48,6 +48,12 @@ + + + + + + @@ -229,7 +235,7 @@ - + diff --git a/Bit Slicer/ZGDebuggerController.m b/Bit Slicer/ZGDebuggerController.m index 04c856f2..e102c5f3 100644 --- a/Bit Slicer/ZGDebuggerController.m +++ b/Bit Slicer/ZGDebuggerController.m @@ -1454,7 +1454,7 @@ - (BOOL)validateUserInterfaceItem:(id )userInterfa return NO; } } - else if (userInterfaceItem.action == @selector(copyAddress:)) + else if (userInterfaceItem.action == @selector(copyAddress:) || userInterfaceItem.action == @selector(copyRawAddress:)) { if ([self selectedInstructions].count != 1) { @@ -1685,6 +1685,12 @@ - (IBAction)copyAddress:(id)__unused sender }]; } +- (IBAction)copyRawAddress:(id)__unused sender +{ + ZGInstruction *selectedInstruction = [[self selectedInstructions] objectAtIndex:0]; + [ZGVariableController copyVariableRawAddress:selectedInstruction.variable]; +} + - (void)scrollAndSelectRow:(NSUInteger)selectionRow { // Scroll such that the selected row is centered diff --git a/Bit Slicer/ZGDocumentWindowController.m b/Bit Slicer/ZGDocumentWindowController.m index c5e52de8..dcd09ce4 100644 --- a/Bit Slicer/ZGDocumentWindowController.m +++ b/Bit Slicer/ZGDocumentWindowController.m @@ -1323,7 +1323,7 @@ - (BOOL)validateUserInterfaceItem:(id )userInterfa } } - else if (menuItem.action == @selector(copyAddress:)) + else if (menuItem.action == @selector(copyAddress:) || menuItem.action == @selector(copyRawAddress:)) { if ([self selectedVariables].count != 1) { @@ -1791,6 +1791,11 @@ - (IBAction)copyAddress:(id)__unused sender [_variableController copyAddress]; } +- (IBAction)copyRawAddress:(id)sender +{ + [_variableController copyRawAddress]; +} + - (IBAction)paste:(id)__unused sender { [_variableController pasteVariables]; diff --git a/Bit Slicer/ZGMemoryViewerController.m b/Bit Slicer/ZGMemoryViewerController.m index 00b3acdc..945af284 100644 --- a/Bit Slicer/ZGMemoryViewerController.m +++ b/Bit Slicer/ZGMemoryViewerController.m @@ -250,7 +250,7 @@ - (BOOL)validateUserInterfaceItem:(id )userInterfa { [menuItem setState:_showsDataInspector]; } - else if (userInterfaceItem.action == @selector(copyAddress:) || userInterfaceItem.action == @selector(showDebugger:)) + else if (userInterfaceItem.action == @selector(copyAddress:) || userInterfaceItem.action == @selector(copyRawAddress:) || userInterfaceItem.action == @selector(showDebugger:)) { if (!self.currentProcess.valid) { @@ -703,17 +703,31 @@ - (void)jumpToMemoryAddress:(ZGMemoryAddress)memoryAddress withSelectionLength:( #pragma mark Copying -- (IBAction)copyAddress:(id)__unused sender +- (ZGVariable *)_variableFromSelectedAddressRange { HFRange selectedAddressRange = [self selectedAddressRange]; ZGVariable *variable = [[ZGVariable alloc] initWithValue:NULL size:selectedAddressRange.length address:selectedAddressRange.location type:ZGByteArray qualifier:ZGUnsigned pointerSize:self.currentProcess.pointerSize]; + return variable; +} + +- (IBAction)copyAddress:(id)__unused sender +{ + ZGVariable *variable = [self _variableFromSelectedAddressRange]; + [ZGVariableController annotateVariables:@[variable] process:self.currentProcess symbols:NO async:NO completionHandler:^{ [[NSPasteboard generalPasteboard] declareTypes:@[NSPasteboardTypeString] owner:self]; [[NSPasteboard generalPasteboard] setString:variable.addressFormula forType:NSPasteboardTypeString]; }]; } +- (IBAction)copyRawAddress:(id)__unused sender +{ + ZGVariable *variable = [self _variableFromSelectedAddressRange]; + + [ZGVariableController copyVariableRawAddress:variable]; +} + #pragma mark Showing Debugger - (IBAction)showDebugger:(id)__unused sender diff --git a/Bit Slicer/ZGVariableController.h b/Bit Slicer/ZGVariableController.h index 596edde0..09488263 100644 --- a/Bit Slicer/ZGVariableController.h +++ b/Bit Slicer/ZGVariableController.h @@ -58,9 +58,11 @@ typedef struct + (void)copyVariablesToPasteboard:(NSArray *)variables; + (void)copyVariableAddress:(ZGVariable *)variable; ++ (void)copyVariableRawAddress:(ZGVariable *)variable; - (void)copyVariables; - (void)copyAddress; +- (void)copyRawAddress; - (void)pasteVariables; - (void)clear; diff --git a/Bit Slicer/ZGVariableController.m b/Bit Slicer/ZGVariableController.m index fbcab3f4..b97851c1 100644 --- a/Bit Slicer/ZGVariableController.m +++ b/Bit Slicer/ZGVariableController.m @@ -174,6 +174,25 @@ - (void)copyAddress [[self class] copyVariableAddress:windowController.selectedVariables[0]]; } ++ (void)copyVariableRawAddress:(ZGVariable *)variable +{ + [NSPasteboard.generalPasteboard + declareTypes:@[NSPasteboardTypeString] + owner:self]; + + [NSPasteboard.generalPasteboard + setString:variable.addressStringValue + forType:NSPasteboardTypeString]; +} + +- (void)copyRawAddress +{ + ZGDocumentWindowController *windowController = _windowController; + ZGVariable *variable = windowController.selectedVariables[0]; + + [[self class] copyVariableRawAddress:variable]; +} + + (void)copyVariablesToPasteboard:(NSArray *)variables { [NSPasteboard.generalPasteboard diff --git a/Bit Slicer/en.lproj/Debugger Window.strings b/Bit Slicer/en.lproj/Debugger Window.strings index fc6caf7f..dc6eda7a 100644 --- a/Bit Slicer/en.lproj/Debugger Window.strings +++ b/Bit Slicer/en.lproj/Debugger Window.strings @@ -17,6 +17,9 @@ /* Class = "NSMenuItem"; title = "Copy Address"; ObjectID = "286"; */ "286.title" = "Copy Address"; +/* Class = "NSMenuItem"; title = "Copy Raw Address"; ObjectID = "Iwu-Sv-lDF"; */ +"Iwu-Sv-lDF.title" = "Copy Raw Address"; + /* Class = "NSMenuItem"; title = "Go to Call Address"; ObjectID = "292"; */ "292.title" = "Go to Call Address"; diff --git a/Bit Slicer/en.lproj/MainMenu.strings b/Bit Slicer/en.lproj/MainMenu.strings index 64f549d2..ff6d64a5 100644 --- a/Bit Slicer/en.lproj/MainMenu.strings +++ b/Bit Slicer/en.lproj/MainMenu.strings @@ -311,6 +311,9 @@ /* Class = "NSMenuItem"; title = "Copy Address"; ObjectID = "1087"; */ "1087.title" = "Copy Address"; +/* Class = "NSMenuItem"; title = "Copy Raw Address"; ObjectID = "Y5k-Nh-cGe"; */ +"Y5k-Nh-cGe.title" = "Copy Raw Address"; + /* Class = "NSMenuItem"; title = "Check for Updates…"; ObjectID = "1093"; */ "1093.title" = "Check for Updates…"; diff --git a/Bit Slicer/en.lproj/Search Document Window.strings b/Bit Slicer/en.lproj/Search Document Window.strings index 5ec3aad4..224d4844 100644 --- a/Bit Slicer/en.lproj/Search Document Window.strings +++ b/Bit Slicer/en.lproj/Search Document Window.strings @@ -62,6 +62,9 @@ /* Class = "NSMenuItem"; title = "Copy Address"; ObjectID = "100889"; */ "100889.title" = "Copy Address"; +/* Class = "NSMenuItem"; title = "Copy Raw Address"; ObjectID = "peg-wi-Uav"; */ +"peg-wi-Uav.title" = "Copy Raw Address"; + /* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "0RQ-cA-Uk7"; */ "0RQ-cA-Uk7.title" = "Text Cell"; diff --git a/Bit Slicer/es.lproj/Debugger Window.strings b/Bit Slicer/es.lproj/Debugger Window.strings index 76deddc0..ad70700d 100644 --- a/Bit Slicer/es.lproj/Debugger Window.strings +++ b/Bit Slicer/es.lproj/Debugger Window.strings @@ -17,6 +17,9 @@ /* Class = "NSMenuItem"; title = "Copy Address"; ObjectID = "286"; */ "286.title" = "Copiar dirección"; +/* Class = "NSMenuItem"; title = "Copy Raw Address"; ObjectID = "Iwu-Sv-lDF"; */ +"Iwu-Sv-lDF.title" = "Copy Raw Address"; + /* Class = "NSMenuItem"; title = "Go to Call Address"; ObjectID = "292"; */ "292.title" = "Ir a la dirección de llamada"; diff --git a/Bit Slicer/es.lproj/MainMenu.strings b/Bit Slicer/es.lproj/MainMenu.strings index 2820d24d..a06e8394 100644 --- a/Bit Slicer/es.lproj/MainMenu.strings +++ b/Bit Slicer/es.lproj/MainMenu.strings @@ -311,6 +311,9 @@ /* Class = "NSMenuItem"; title = "Copy Address"; ObjectID = "1087"; */ "1087.title" = "Copiar dirección"; +/* Class = "NSMenuItem"; title = "Copy Raw Address"; ObjectID = "Y5k-Nh-cGe"; */ +"Y5k-Nh-cGe.title" = "Copy Raw Address"; + /* Class = "NSMenuItem"; title = "Check for Updates…"; ObjectID = "1093"; */ "1093.title" = "Buscar actualizaciones…"; diff --git a/Bit Slicer/es.lproj/Search Document Window.strings b/Bit Slicer/es.lproj/Search Document Window.strings index e2079b65..b45b0922 100644 --- a/Bit Slicer/es.lproj/Search Document Window.strings +++ b/Bit Slicer/es.lproj/Search Document Window.strings @@ -62,6 +62,9 @@ /* Class = "NSMenuItem"; title = "Copy Address"; ObjectID = "100889"; */ "100889.title" = "Copiar dirección"; +/* Class = "NSMenuItem"; title = "Copy Raw Address"; ObjectID = "peg-wi-Uav"; */ +"peg-wi-Uav.title" = "Copy Raw Address"; + /* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "0RQ-cA-Uk7"; */ "0RQ-cA-Uk7.title" = "Text Cell"; diff --git a/Bit Slicer/ru.lproj/Debugger Window.strings b/Bit Slicer/ru.lproj/Debugger Window.strings index 46349056..b556e25f 100644 --- a/Bit Slicer/ru.lproj/Debugger Window.strings +++ b/Bit Slicer/ru.lproj/Debugger Window.strings @@ -17,6 +17,9 @@ /* Class = "NSMenuItem"; title = "Copy Address"; ObjectID = "286"; */ "286.title" = "Скопировать адрес"; +/* Class = "NSMenuItem"; title = "Copy Raw Address"; ObjectID = "Iwu-Sv-lDF"; */ +"Iwu-Sv-lDF.title" = "Copy Raw Address"; + /* Class = "NSMenuItem"; title = "Go to Call Address"; ObjectID = "292"; */ "292.title" = "Перейти к адресу вызова"; diff --git a/Bit Slicer/ru.lproj/MainMenu.strings b/Bit Slicer/ru.lproj/MainMenu.strings index 0c7a90d2..e9767e75 100644 --- a/Bit Slicer/ru.lproj/MainMenu.strings +++ b/Bit Slicer/ru.lproj/MainMenu.strings @@ -311,6 +311,9 @@ /* Class = "NSMenuItem"; title = "Copy Address"; ObjectID = "1087"; */ "1087.title" = "Скопировать адрес"; +/* Class = "NSMenuItem"; title = "Copy Raw Address"; ObjectID = "Y5k-Nh-cGe"; */ +"Y5k-Nh-cGe.title" = "Copy Raw Address"; + /* Class = "NSMenuItem"; title = "Check for Updates…"; ObjectID = "1093"; */ "1093.title" = "Проверить обновления…"; diff --git a/Bit Slicer/ru.lproj/Search Document Window.strings b/Bit Slicer/ru.lproj/Search Document Window.strings index 36e53731..34996f1d 100644 --- a/Bit Slicer/ru.lproj/Search Document Window.strings +++ b/Bit Slicer/ru.lproj/Search Document Window.strings @@ -62,6 +62,9 @@ /* Class = "NSMenuItem"; title = "Copy Address"; ObjectID = "100889"; */ "100889.title" = "Скопировать Адрес"; +/* Class = "NSMenuItem"; title = "Copy Raw Address"; ObjectID = "peg-wi-Uav"; */ +"peg-wi-Uav.title" = "Copy Raw Address"; + /* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "0RQ-cA-Uk7"; */ "0RQ-cA-Uk7.title" = "Текстовая ячейка";