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)_
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.