Skip to content

Conversation

@NishTheFish-dev
Copy link

@NishTheFish-dev NishTheFish-dev commented Jan 30, 2026

Closes #176

Adds a new hook for IDA that detects when the decompilation has changed. Also includes a test case to verify this works correctly (now implemented!)

@NishTheFish-dev NishTheFish-dev self-assigned this Jan 30, 2026
@NishTheFish-dev
Copy link
Author

@NishTheFish-dev NishTheFish-dev marked this pull request as ready for review February 4, 2026 01:14
deci.artifact_change_callbacks[Decompilation].append(on_decompilation_change)

# mock objects to simulate IDA's HexRays structures
class MockCfunc:
Copy link
Member

Choose a reason for hiding this comment

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

hehe I can tell this part was Claude written.

return

dec = Decompilation(
# only IDA support for now
Copy link
Member

Choose a reason for hiding this comment

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

A pointless comment. This code is already in IDA.


deci.shutdown()

def test_ida_hook_decompilation_event(self):
Copy link
Member

Choose a reason for hiding this comment

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

High-level comments:
This is a bad way to test if a feature works. I understand the logic (or the AI's logic?) here, but it's too contrived. Why directly grab the HexraysHook, cause a fake trigger, and then observe if the new hook works?

Why not just get an IDA deci, do some action that forces a refresh (like renaming a variable or calling the refresh API), then seeing if your new hook gets hit. An example of a place I tested a callback implicitly:

retrieved_segment = ida_deci.segments[test_segment_name]

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.

Create a callback for decompilation_changed in decompilers

2 participants