where do we begin: the pe entry point, and a field name with no struct and no width

huntress ctf 2026, day 10 · metadata forensics · all three modes

tools used: archive and metadata toolkit and timed-attempt pipeline.

the prompt: "architecture tells you whether a binary can run; its entry point tells you where execution begins. map the start addresses and catch the report that is lying." each bundle held one windows executable, and the one question per executable asked for its entry point.

the key insight: the value is one field of the pe optional header, at the same offset in 32- and 64-bit images, and our day-9 resolver could already read it. it failed because the question's property name left out two parts the resolver required, the struct and the width. the fix was in reading the name, not the bytes.

challenge shape

one field per executable: d09-pe-NNN-pe-address-of-entry-point-rva-hex, asked as "determine pe.address_of_entry_point_rva_hex for telemetry-agent-nnn.exe.", with the syntax "lowercase hexadecimal with a 0x prefix and no explanatory text". the single and the time trial each delivered a zip with one executable; the mastery delivered a zip of two zips, one executable in each, two fields under one clock.

the four executables covered three instruction sets and both optional-header formats: 32-bit x86 (pe32) in the single and in one mastery set, 64-bit x86 (pe32+) in the time trial, and 64-bit arm (pe32+) in the other mastery set. nothing in any bundle was a report: the prompt's "report that is lying" had no bytes behind it.

artifact anatomy

the entry point lives in the optional header, which follows the 20-byte coff header (the chain from MZ through e_lfanew is in the day 9 post):

offset (from the optional header)   size  field
0                                    2     Magic: 0x10b pe32, 0x20b pe32+
2                                    1     MajorLinkerVersion
3                                    1     MinorLinkerVersion
4                                    4     SizeOfCode
8                                    4     SizeOfInitializedData
12                                   4     SizeOfUninitializedData
16                                   4     AddressOfEntryPoint
20                                   4     BaseOfCode
24                                   4     BaseOfData (pe32 only)

AddressOfEntryPoint is a relative virtual address: an offset from the image base where the loader puts the module, not a file offset and not an absolute address. pe32 and pe32+ differ from offset 24 on (pe32+ drops BaseOfData and widens ImageBase to eight bytes), so the entry point sits at optional header

this field does more work than it needs to.

extraction method

on day 9 we replaced a hand-written pe reader with a resolver that parses property names against tables of header structs. a name had to read <family>-<struct>-<field>-<width>-<format>, for example pe-coff-machine-u16-hex, and each part had to be a name the tables know. the entry point was in the tables, in the layout pe32 and pe32+ share (each adds its own fields from offset 24):

_PE_OPTIONAL_COMMON = (
    "magic 0 2, major_linker_version 2 1, minor_linker_version 3 1, "
    "size_of_code 4 4, size_of_initialized_data 8 4, "
    "size_of_uninitialized_data 12 4, address_of_entry_point 16 4, "
    "base_of_code 20 4, ..."
)

day 10's name was pe-address-of-entry-point-rva-hex: family pe, the field's words, a word that says what kind of value the field holds (rva), and the format. no struct, no width. the resolver found no struct named address, no width before hex, and raised; the fallback, which asks exiftool for a tag whose words cover the property, found none either. so the solver stopped with a crash on the only field of the bundle.

the day-10 resolver reads three shorter forms of the same name:

``python FIELD_KINDS: dict[str, frozenset[str] | None] = { "rva": frozenset({"address_of_entry_point", "base_of_code", "base_of_data"}), "va": frozenset({"image_base", "e_entry"}), "value": None, "raw": None, } ``

pe-image-base-rva-hex therefore still raises: an image base is not an rva, and a name that says it is describes a field we do not have.

a name that two structs share (the words name a field in more than one struct of the family) still raises, and a name that matches nothing now lists the closest fields the tables have, so a near miss is visible in the error.

validation and answer formatting

the read is the same chain as day 9's, with both signatures checked, and the optional header's magic picks its layout or stops the read:

layout = {0x10B: PE32_OPTIONAL, 0x20B: PE32PLUS_OPTIONAL}.get(magic)
if layout is None:
    raise ValueError(f"pe optional header magic 0x{magic:04x} is not pe32/pe32+")

a file that only wears the .exe extension fails before it produces a number.

the syntax fixes the prefix and the case but says nothing about the number of digits, and the name gives no width. the grader wanted the value padded to the field's width, eight hex digits for a u32, as on day 9's u16 machine field:

if ref.fmt == "hex":
    return f"0x{value:0{2 * size}x}"

where size is the width the name gives, or the field's own when it gives none. hex(value) drops the leading zeros, and that form was rejected.

failed approaches and pivots

with the solver stopped on the name, we read the entry point by hand along the chain above and submitted it as python prints it, 0x and the significant digits. the grader rejected it. the second submission, the same value at eight digits, was accepted: the day-9 width rule had held, the name had just stopped carrying the width.

automation across modes

once the resolver read the shorter name, the same field came out of the same reader for the time trial's pe32+ and for both mastery executables; the arm64 image needed nothing, because the entry point's offset does not depend on the machine.

lessons

solve times

public scoreboard · day 10 finish: top 3

  • 1:08.3single#3 of 207 solvers
  • 1:39.7time trial#4 of 197 solvers
  • 1:40.9mastery#4 of 196 solvers
  • #2team day finishof 173 teams that cleared it, in 1:40.9
  • #5single orderof the day's 5, by our flag time

from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.

from when we started working on the mode to its flag.

mode work to flag attempts wrong submits
single 1m06s 1 1
time trial 30.8s 1 0
mastery 2.4s 1 0

the clock

server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.

mode time available time used time left
time trial 8.0s 0.5s 7.5s
mastery 11.0s 0.5s 10.5s

where we got stuck

flags: single, time trial, and mastery [redacted].

{generated by a clanker}