Skip to content

Feat: Find function addresses by reflection: live class tables, command ids and known callers - #227

Merged
b-re-w merged 5 commits into
developfrom
feat/functions-by-reflection
Nov 14, 2026
Merged

b-re-w merged 5 commits into
developfrom
feat/functions-by-reflection

Conversation

@b-re-w

@b-re-w b-re-w commented Nov 14, 2026

Copy link
Copy Markdown
Member

NFR-6 and D16: find function addresses by reflection, from public Chromium source, for builds made without a PDB (Edge 157.0.4341.60). Every place still needs two methods to agree, or a structural check. A value that is not cross checked keeps its feature off.

Paths

  1. Virtual functions from class table slots.
    • Generator (row_resolve): a new method, its slot shift. Every views class table keeps views::View's slots (ui/views/view.h). So when a second views class table, known in both builds, lines the same slot up by the same shift, the slot number is found a second time, apart from the first table.
    • Runtime (chromium/live_tables.rs): reads the class tables of the live BrowserView, its frame view (a child of the browser view's parent named *FrameView*, per NonClientView), the WindowsCaptionButton views and the CustomFloatingCorner views. The first word of a live view is its class table. A table counts only when all views of the class share it and it lies in read-only data with code in its first slot. It must agree with the row's table, and a row without a table takes the live one.
    • Settles: layout.frame_vtable, frame.frame_view_vtable (same table), caption_vtable, corner_vtable and browser_view_view_vtable at runtime. Also the virtual functions in their slots (top_inset, caption_paint, caption_size, corner_paint, client_view_bounds, layout) once the tables are known in both builds.
  2. chrome::NewTab from IDC_NEW_TAB (34014) (row_command.rs). Reads the jump table switches of the build (HandleCommandWithDisposition's switch (id) in browser_command_controller.cc). Takes the first call of the case for the public id. The prior build must send the id to the prior row's NewTab through switches with the same lowest case, and every such switch in the new build must name one function. Cross checked with the fingerprint's places, including places off the exception table's function starts. Settles tabs.new_tab.
  3. Drawing helpers by a known caller (row_resolve, a known caller). A function known in both builds calls the target in the prior build. Of the fingerprint's places, its new body calls exactly one. Each slot settled in path 1 is a known caller in the next round. Settles draw_color (from the frame's OnPaint), and set_radius, stack_at_top and set_layer where a settled caller calls them and their fingerprint matched somewhere.

No reflection path yet

  • hwnd_for_view, browser_view_for_window, toolbar.widget_for_window: free or static functions. No virtual slot and no command reaches them.
  • tabs.tab_at, get_group, get_tab_model, active_web_contents, navigation.open_url: no public command id runs them first. active_web_contents and open_url are not virtual on a views class.
  • set_layer and top_inset: their fingerprint matched no place. The known caller method needs fingerprint places, so they rely on the table slot path or stay with the existing methods.

Tests

nfr6_a_virtual_function_is_read_from_its_views_class_table_by_slot, nfr6_a_virtual_function_needs_a_second_views_table_to_agree_on_its_slot, nfr6_a_views_class_table_is_read_from_its_live_views, nfr6_live_views_of_one_class_must_share_their_table, nfr6_a_row_without_a_class_table_takes_the_live_one, nfr6_a_switch_case_is_read_from_its_jump_table, nfr6_new_tab_is_found_from_the_new_tab_command, nfr6_new_tab_is_taken_where_its_command_and_fingerprint_agree, nfr6_a_drawing_helper_is_found_by_the_call_from_its_caller, nfr6_a_caller_that_calls_every_fingerprint_place_names_no_helper.

Not built or tested in the worktree (per AGENTS.md). The build, tests and a row run on Edge 157 are still to be done on develop after merge.

🤖 Generated with Claude Code

@b-re-w
b-re-w merged commit 25eb578 into develop Nov 14, 2026
0 of 3 checks passed
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.

1 participant