Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address edits by offset value #269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaredballou
Copy link

Added small feature to allow changing selected addresses by specified offset value. Using either the Edit popup menu option or the Shift+Return shortcut, a hex value can be entered (positive or negative) and will then modify the addresses of all selected records by that value.

dialog = InputDialogForm(self, item_list=[("Offset addresses by:",'')])
if dialog.exec():
offset_value = dialog.get_values()
offset_int = int(offset_value, 16)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the user does not input a valid hex number?

PINCE.py Show resolved Hide resolved
print(offset_int)
for row in self.treeWidget_AddressTable.selectedItems():
desc, address_expr, value_type = self.read_address_table_entries(row)
address = row.text(ADDR_COL).strip("P->")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're stripping P-> but that's grabbing the resolved address from the pointer chain.
Unless you modify the chain and add the value to the last offset directly, it will just break again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants