CLI: inspect names each section's flags #2858

Open
github-bot wants to merge 1 commit from github-bot/gh-2858 into main AGit
Owner

@⁠wilu222 on GitHub · 2026-11-25 22:31 UTC · original
wilu222:inspect-section-flags → main · +77 −2 · 2 files · 1 commits · open

victory inspect printed each section's characteristics only in hex, so telling which sections are executable or writable meant decoding the number by hand. The title executable of Series 1.0.2.1, for example, has .text at 0x60000020, .data at 0xc0000040 and .reloc at 0x42000040.

This follows the number with the section's access as rwx and its other named flags, the same way the dll flags line names its bits (#1988). Bits without a name (the alignment field object files use, linker-only flags) are shown in hex rather than dropped.

What is in it

  • crates/victory-pe/src/layout.rs: section_flags constants, next to dll_flags.
  • apps/victory/src/inspect.rs: section_flags names them for the sections table; two unit tests (no game data).

Tested

  • NVIDIA GeForce RTX 5070 (driver 32.0.16.1742), AMD Ryzen 7 5700X, 32 GB, Windows 10 Home 22H2 (19045), Rust 1.98.1 (pinned), on main f3578e3.
  • cargo test --locked -p victory --bins: 16 passed, including the two new tests.
  • cargo clippy --workspace --all-targets --locked -- -D warnings and the --all-features variant: clean.
  • cargo xtask policy --staged: 2 files ok.
  • cargo test --workspace --locked --no-fail-fast: 779 passed, 92 failed, 10 ignored. main on the same machine: 777 passed, 92 failed, 10 ignored, the same 92 tests. They are the GPU tests that need shader model 6.6, which Windows 10's inbox D3D12 does not expose (neither hardware nor WARP SM 6.6 device available / no SM 6.6 device; #84).
  • victory inspect on the title executable:
    .text    rva 0x00001000 vsize 0x05f3f966 raw 0x05f3fa00 flags 0x60000020  (r-x, code)
    .data    rva 0x067e2000 vsize 0x043ec398 raw 0x00622e00 flags 0xc0000040  (rw-, initialized-data)
    .retplne rva 0x0af3c000 vsize 0x000000e4 raw 0x00000200 flags 0x00000000  (---)
    .reloc   rva 0x0af41000 vsize 0x0012a350 raw 0x0012a400 flags 0x42000040  (r--, initialized-data, discardable)
    
    and on kernel32.dll of the same Windows: all seven sections named, nothing left in hex.

Not tested

  • The GPU tests that need shader model 6.6 (Windows 10 here); the change does not touch them.
  • Windows 11, AMD GPUs.
**@⁠wilu222** on GitHub · 2026-11-25 22:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/2858) `wilu222:inspect-section-flags` → `main` · +77 −2 · 2 files · 1 commits · open `victory inspect` printed each section's characteristics only in hex, so telling which sections are executable or writable meant decoding the number by hand. The title executable of Series 1.0.2.1, for example, has `.text` at `0x60000020`, `.data` at `0xc0000040` and `.reloc` at `0x42000040`. This follows the number with the section's access as `rwx` and its other named flags, the same way the `dll flags` line names its bits (#1988). Bits without a name (the alignment field object files use, linker-only flags) are shown in hex rather than dropped. **What is in it** - `crates/victory-pe/src/layout.rs`: `section_flags` constants, next to `dll_flags`. - `apps/victory/src/inspect.rs`: `section_flags` names them for the sections table; two unit tests (no game data). **Tested** - NVIDIA GeForce RTX 5070 (driver 32.0.16.1742), AMD Ryzen 7 5700X, 32 GB, Windows 10 Home 22H2 (19045), Rust 1.98.1 (pinned), on `main` `f3578e3`. - `cargo test --locked -p victory --bins`: 16 passed, including the two new tests. - `cargo clippy --workspace --all-targets --locked -- -D warnings` and the `--all-features` variant: clean. - `cargo xtask policy --staged`: 2 files ok. - `cargo test --workspace --locked --no-fail-fast`: 779 passed, 92 failed, 10 ignored. `main` on the same machine: 777 passed, 92 failed, 10 ignored, the same 92 tests. They are the GPU tests that need shader model 6.6, which Windows 10's inbox D3D12 does not expose (`neither hardware nor WARP SM 6.6 device available` / `no SM 6.6 device`; #84). - `victory inspect` on the title executable: ``` .text rva 0x00001000 vsize 0x05f3f966 raw 0x05f3fa00 flags 0x60000020 (r-x, code) .data rva 0x067e2000 vsize 0x043ec398 raw 0x00622e00 flags 0xc0000040 (rw-, initialized-data) .retplne rva 0x0af3c000 vsize 0x000000e4 raw 0x00000200 flags 0x00000000 (---) .reloc rva 0x0af41000 vsize 0x0012a350 raw 0x0012a400 flags 0x42000040 (r--, initialized-data, discardable) ``` and on `kernel32.dll` of the same Windows: all seven sections named, nothing left in hex. **Not tested** - The GPU tests that need shader model 6.6 (Windows 10 here); the change does not touch them. - Windows 11, AMD GPUs.
`victory inspect` printed section characteristics only in hex. It now
follows them with the section's access as rwx and its other named
flags (code, initialized-data, uninitialized-data, discardable,
not-cached, not-paged, shared); bits without a name, such as the
alignment field object files use, are shown in hex rather than dropped.

The constants go in victory-pe's layout::section_flags, next to the
DLL characteristics.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:16:05 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-25 23:00 UTC · original

Local verification on Windows / rustc 1.100.0 / MSVC, no game data, no GPU, no clippy/rustup.

  • cargo test --locked -p victory --bins --quiet -> 16 passed, 0 failed, including the new section_flags_names_the_title_sections and section_flags_shows_bits_without_a_name.
  • Diff vs merge-base f3578e3: 2 files, +77/-2; git diff --check clean.
  • Negative control: both new test names are absent on the base commit.

AI-assisted (Hy4 flash).

**@⁠cloph-dsp** on GitHub · 2026-11-25 23:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/2858#issuecomment-7177043501) Local verification on Windows / rustc 1.100.0 / MSVC, no game data, no GPU, no clippy/rustup. - `cargo test --locked -p victory --bins --quiet` -> 16 passed, 0 failed, including the new `section_flags_names_the_title_sections` and `section_flags_shows_bits_without_a_name`. - Diff vs merge-base f3578e3: 2 files, +77/-2; `git diff --check` clean. - Negative control: both new test names are absent on the base commit. AI-assisted (Hy4 flash).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 04:23 UTC · original

Automated triage for the maintainers.

Merge candidate. Adds section_flags constants to victory-pe/src/layout.rs, and inspect::section_flags decodes each section's characteristics as rwx plus named flags, like dll_flags. The constants match the PE format documentation, and the tests cover unnamed bits in hex and 0xf0000080 decoding to rwx, uninitialized-data, shared.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 04:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/2858#issuecomment-7182557610) <!-- victory-triage v1 head=29fcf27cf613d60d412db7770b55c37d8cabc7ef verdict=merge-candidate at=2026-11-26T04:23:42Z --> Automated triage for the maintainers. **Merge candidate.** Adds `section_flags` constants to `victory-pe/src/layout.rs`, and `inspect::section_flags` decodes each section's characteristics as `rwx` plus named flags, like `dll_flags`. The constants match the PE format documentation, and the tests cover unnamed bits in hex and `0xf0000080` decoding to `rwx, uninitialized-data, shared`. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 22:50 UTC · original · reviewed

Clean diagnostics addition — rwx shorthand plus named flags plus a hex remainder for unnamed bits covers the full characteristic space without pretending to decode alignment/linker bits. LGTM.

**@⁠kotekompotek** on GitHub · 2026-11-25 22:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/2858#pullrequestreview-6066068590) · **reviewed** Clean diagnostics addition — rwx shorthand plus named flags plus a hex remainder for unnamed bits covers the full characteristic space without pretending to decode alignment/linker bits. LGTM.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 00:24 UTC · original · reviewed

Verified head 29fcf27c cleanly merged onto origin/main (63bcca43) on Windows 11 x64.

Code Review

  • All 10 IMAGE_SCN_* constants in crates/victory-pe/src/layout.rs:65-76 match the PE/COFF specification, and apps/victory/src/inspect.rs cleanly formats the rwx permission triad, named section characteristics, and hex remainder for any unnamed bits.

Local Verification

  • cargo test --locked -p victory-pe -p victory: victory-pe 36/36, victory 16/16 unit + 4/4 integration (census 2, census_unreadable 1, translate 1) passed.
  • cargo clippy --locked -p victory-pe -p victory --all-targets -- -D warnings (default and --all-features) & cargo xtask policy (191 files ok): clean.

Looks clean and ready to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 00:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/2858#pullrequestreview-6066883292) · **reviewed** Verified head `29fcf27c` cleanly merged onto `origin/main` (`63bcca43`) on Windows 11 x64. ### Code Review - All 10 `IMAGE_SCN_*` constants in `crates/victory-pe/src/layout.rs:65-76` match the PE/COFF specification, and `apps/victory/src/inspect.rs` cleanly formats the `rwx` permission triad, named section characteristics, and hex remainder for any unnamed bits. ### Local Verification - `cargo test --locked -p victory-pe -p victory`: `victory-pe` **36/36**, `victory` **16/16** unit + **4/4** integration (`census` 2, `census_unreadable` 1, `translate` 1) passed. - `cargo clippy --locked -p victory-pe -p victory --all-targets -- -D warnings` (default and `--all-features`) & `cargo xtask policy` (`191 files ok`): clean. Looks clean and ready to merge.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 17:46 UTC · original

NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head 29fcf27 (on its base f3578e3).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 865 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: section_flags_names_the_title_sections, section_flags_shows_bits_without_a_name.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-26 17:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/2858#issuecomment-7199636369) NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head `29fcf27` (on its base `f3578e3`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **865 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `section_flags_names_the_title_sections`, `section_flags_shows_bits_without_a_name`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2858/head:github-bot/gh-2858'
git switch 'github-bot/gh-2858'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2858'
git switch 'github-bot/gh-2858'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2858'
git switch 'github-bot/gh-2858'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2858'
git switch 'main'
git merge --squash 'github-bot/gh-2858'
git switch 'main'
git merge --ff-only 'github-bot/gh-2858'
git switch 'main'
git merge 'github-bot/gh-2858'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2858
No description provided.