Skip to content

Conversation

@rraggerr
Copy link

add support for virtual function index comments
cache xref targets per tid to avoid repeated calls

…ct handling

- Introduced `add_vfunc_index_comments` function to append virtual function index comments.
- Updated `pci_config` to include `rnvi` option for enabling virtual index comments.
- Modified `pci_config_form` to reflect the new `rnvi` option in the UI.
- Enhanced RTTI struct application logic to cache xref targets and avoid redundant calls.

for index, vfea in enumerate(vfunc_eas):
entry_ea = vftable_ea + (index * u.PTR_SIZE)
comment = format(index + 1)
Copy link

Choose a reason for hiding this comment

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

Why the +1? I think it makes more sense to have 0-indexing, as it would be more helpful for comparing to instructions/C pseudocode that dereference vtables

Copy link
Author

Choose a reason for hiding this comment

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

Why the +1? I think it makes more sense to have 0-indexing, as it would be more helpful for comparing to instructions/C pseudocode that dereference vtables

yes, that's a typo

@herosi
Copy link
Owner

herosi commented Oct 16, 2025

I'm not sure it is useful and I don't like to add comments for the functions in vftables. I think you should use structures for managing vftables. Or you can keep your version by yourself.

@herosi
Copy link
Owner

herosi commented Oct 16, 2025

But thank you for the contribution. I appreciate it.

@ficool2
Copy link

ficool2 commented Oct 17, 2025

I'm not sure it is useful and I don't like to add comments for the functions in vftables. I think you should use structures for managing vftables. Or you can keep your version by yourself.

This is very useful for me when comparing differences between versions of binaries or games that share engines. since it's an option it wouldn't hurt to add

@qudix
Copy link

qudix commented Oct 18, 2025

Looks useful to me for the same reason. If it doesn't get accepted, I wouldn't mind using a fork with it just for that alone.

@p0358
Copy link

p0358 commented Jan 11, 2026

Honestly +1, if this adds them at the vtable level and not inside of actual function, which seems to be the case. The only problems I'd have is:

  • it doesn't seem to check if the bytes already have a comment (to avoid overriding it if so!)
  • it'd be nice to format it like "index N" rather than just the number, imo

I think you should use structures for managing vftables.

For very complex class inheritance and optimizations, structures might often be too complicated for doing something simple with the class...

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.

5 participants