Merge upstream main into task/382-crt-startup

Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
This commit is contained in:
zachdoxsee committed 2026-11-25 02:10:46 +01:00
commit 3d796f51cf
35 files changed
+2672 -417

No files matched your search

+34
View File
@@ -69,6 +69,28 @@ storage, invokes its callbacks and runs the entry point. The fixture entry point
uses a Win64-aligned stack and terminates with HLT. The result includes the loaded
guest memory and the entry execution outcome.
Loading an image maps its headers as well as its sections. The first
`SizeOfHeaders` bytes of the file are mapped read-only at the image base, in
whole 4 KiB pages. Everything in those pages past `SizeOfHeaders` is zero, even
where the file holds more bytes there. A guest can read its own DOS header,
section table and data directories; it cannot write or execute them.
When startup loads an image away from its preferred base, it writes the load
base into the mapped optional header's `ImageBase` field after the relocations
have been applied, so an entry aimed at that field cannot leave any other value
there. This is Xenora's policy: the PE specification defines `ImageBase` as the
preferred base, and the behaviour has not been compared with Windows.
The load is refused with `PeError::InvalidHeaderSize` when `SizeOfHeaders` is
zero, ends before the section table does, runs past the end of the file, or its
pages would reach into a section, and when the bytes given to the loader are not
the PE32+ headers that were parsed. The page rule is stricter than the loader
was before: an image whose section alignment is below 4 KiB, with a section
that starts inside the header page, used to load and is now refused. The header
pages count toward the 256 MiB mapping budget of one image, which is checked
before anything is mapped. `ParsedPe::parse` does not make these checks, so
static inspection of a file is unchanged.
`xenora probe --mode static` inventories ordinary and delay-loaded PE imports
without guest execution. Without `--report` it writes to `diagnostics/probe`,
where `xenora imports sync` also looks. `missing_imports.csv` lists unresolved ordinary keys
@@ -102,6 +124,18 @@ attribute bit, is truncated, or uses the earlier virtual-address descriptor form
is reported in `delay_import_error` and in the Markdown report, together with
the entries read before it.
`xenora_import_gen::demangle` decodes Microsoft Visual C++ decorated names
for diagnostics, in the style of Microsoft's `undname`. It covers functions,
data, member access and storage, `this` qualifiers, calling conventions,
constructors, destructors, common operators, `vftable` names, classes,
structs, unions, enums, pointers, references, primitive types, templates
with type and integer arguments, and name and type back-references. Function
pointer types, RTTI descriptors, nested function scopes and other constructs
return `None`, so callers show the decorated name instead of a guess. The
generator manifest's list of imports that need manual engineering shows the
undecorated form beside each decorated C++ import. Tests check names mangled
by clang for `x86_64-pc-windows-msvc` against their source declarations.
The synthetic process registry supports the current-process pseudo handle and
its process ID. The priority boost setter and getter record and query a guest
policy. They are partial until a guest scheduler applies the policy. The process