Given the auxiliary file test.xbb
%%Title: test.pdf
%%Creator: extractbb 20180506
%%BoundingBox: 0 0 300 343
%%HiResBoundingBox: 0.000000 0.000000 300.290000 342.810000
%%PDFVersion: 1.4
%%Pages: 17
%%CreationDate: Mon Jan 7 18:06:49 2019
produced from input file test.pdf using the extractbb utility
extractbb test.pdf
Is there an easy way to read the value of the %%Pages: key from test.xbb by means of some internal command defined in the graphics package? I know that graphics parses user provided xbb files in order to determine bounding-box coordinates for binary-type or compressed image files that TeX cannot read on its own. Can it do the same for %%Pages: out of the box?

pdftex,luatex,xetex, just by readingxbbwhile running(pdf|lua)latexin DVI mode. – AlexG Jan 07 '19 at 19:50graphicscode. – AlexG Jan 07 '19 at 19:58\readloop from graphics – David Carlisle Jan 07 '19 at 20:12\input{test.xbb}? It's all commented lines, does it read anything at all? – AlexG Jan 07 '19 at 20:17%doesn't have to be a comment.... – David Carlisle Jan 07 '19 at 20:19