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

misc/hooks: fixed an invalid variable being used in the address.old_changed hook when logging debug logs. #60

Merged
merged 1 commit into from
Jul 23, 2020

Conversation

arizvisa
Copy link
Owner

@arizvisa arizvisa commented Jul 23, 2020

When logging debug logs via the address.old_changed hook, IDA passes us a boolean on whether the comment is repeatable or not as "repeatable_cmt". When logging debug logs for this, the "repeatable" variable was mistakenly being used which would result in an exception being raiseed due to a non-existent variable. This PR fixes this issue by correcting the spelling of the name so that it references the parameter that we receive from IDA.

This closes issue #59.

@gool123456
Copy link

@arizvisa Thanks, I just saw your message. Let me test it . : )

@gool123456
Copy link

I using new hook.py , showing error message :

Python>db.comment(0x006DA9CF, "123")
CRITICAL:root:internal.interface.priorityhook.callback(7186895, False) : Callback for "IDB_Hooks.cmt_changed" with priority (+0) raised an exception while executing <bound method type.old_changed of <class 'hooks.address'>>
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : Traceback ("IDB_Hooks.cmt_changed" was hooked at)
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : File "C:\Users\Hskyre\AppData\Roaming\Hex-Rays\IDA Pro\misc\hooks.py", line 1059, in ida_is_busy_sucking_cocks
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : make_ida_not_suck_cocks(idaapi.NW_INITIDA)
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : File "C:\Users\Hskyre\AppData\Roaming\Hex-Rays\IDA Pro\misc\hooks.py", line 993, in make_ida_not_suck_cocks
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : ui.hook.idb.add('cmt_changed', address.old_changed, 0)
WARNING:root:internal.interface.priorityhook.callback(7186895, False) :
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : Traceback (most recent call last):
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : File "C:\Users\Hskyre\AppData\Roaming\Hex-Rays\IDA Pro\base_interface.py", line 373, in closure
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : result = callable(*parameters)
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : File "C:\Users\Hskyre\AppData\Roaming\Hex-Rays\IDA Pro\misc\hooks.py", line 219, in old_changed
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : internal.comment.contents.set_address(ea, 0)
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : File "C:\Users\Hskyre\AppData\Roaming\Hex-Rays\IDA Pro\base_comment.py", line 971, in set_address
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : raise internal.exceptions.ReadOrWriteError(u"{:s}.set_address({:#x}, {:d}{:s}) : Unable to write name to address {:#x}.".format('.'.join(('internal', name, cls.name)), address, count, ', {:s}'.format(internal.utils.string.kwargs(target)) if target else '', address))
WARNING:root:internal.interface.priorityhook.callback(7186895, False) : ReadOrWriteError: internal.comment.contents.set_address(0x6da9cf, 0) : Unable to write name to address 0x6da9cf.
WARNING:root:internal.interface.priorityhook.callback(7186895, False) :

@arizvisa
Copy link
Owner Author

Um. Wow. Did this ever work before, or is this the first time that you're using this part of it?

It's complaining about not being able to write to its database, which is using IDA's netnodes... which is a very low-level interface. Give me a moment to come up with some things for you to run.

@arizvisa
Copy link
Owner Author

Btw, this PR is fixed. I'm merging it and closing the issue.

I'll re-create a ticket for the new bug and link you to it.

@arizvisa
Copy link
Owner Author

@gool123456, I created issue #61 for the issue you just reported. Give me a moment to merge this and we'll work on that one. In the meantime, can you verify that db.tag raises the same exception too/?

@arizvisa arizvisa merged commit 530158c into master Jul 23, 2020
@gool123456
Copy link

I have your previous ida-minsc of ida 6.8, which is normal, the version released around April.

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

Successfully merging this pull request may close these issues.

None yet

2 participants