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

[devel/scan-vtables] pick up unique vtable addresses only in g_src #965

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

myk002
Copy link
Member

@myk002 myk002 commented Feb 3, 2024

since there are some symbols that are not in dwarfort:

  • <vtable-address name='enablerst' value='0x7ffff6ce6008'/>
  • <vtable-address name='renderer_2d_base' value='0x7ffff6ce6020'/>
  • <vtable-address name='renderer_2d' value='0x7ffff6ce6108'/>
  • <vtable-address name='enabler_inputst' value='0x7ffff6ce6200'/>
  • <vtable-address name='MacroScreenLoad' value='0x7ffff6ce64e0'/>
  • <vtable-address name='MacroScreenSave' value='0x7ffff6ce6548'/>
  • <vtable-address name='renderer_offscreen' value='0x7ffff6ce65c8'/>
  • <vtable-address name='widgets::folder' value='0x7ffff6ce6bc0'/>
  • <vtable-address name='widgets::filter' value='0x7ffff6ce6c20'/>
  • <vtable-address name='widgets::multifilter::indiv_filter' value='0x7ffff6ce6c88'/>
  • <vtable-address name='widgets::multifilter' value='0x7ffff6ce6cf0'/>
  • <vtable-address name='widgets::radio_rows' value='0x7ffff6ce6f80'/>
  • <vtable-address name='widgets::table' value='0x7ffff6ce6fe0'/>
  • <vtable-address name='widgets::better_button' value='0x7ffff6ce70c0'/>
  • <vtable-address name='widgets::character' value='0x7ffff6ce72a0'/>
  • <vtable-address name='widgets::dropdown' value='0x7ffff6ce75d0'/>

@myk002 myk002 requested a review from lethosor February 3, 2024 03:54
Copy link
Member

@lethosor lethosor left a comment

Choose a reason for hiding this comment

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

As discussed on discord, I don't believe this is safe, because we can't guarantee that this particular shared library will always load at the same absolute address for everyone.

if (not range.read) or range.write or range.execute then
goto next_range
end
if not not range.name:match('g_src') ~= g_src then
Copy link
Member

Choose a reason for hiding this comment

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

I think we could just add g_src to the allowed patterns, instead of refactoring the whole loop into a function and calling it twice. Unless I'm missing something, it doesn't look like the g_src parameter is used for anything except determining the allowed ranges.

Copy link
Member Author

Choose a reason for hiding this comment

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

the two passes is to ensure that if there is a dup, the version in dwarfort is preferred. Note the new names set that detects duplicates.

@myk002 myk002 merged commit ff4b3fa into DFHack:master Feb 7, 2024
10 checks passed
@myk002 myk002 deleted the myk_g_src_vtables branch February 7, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants