Repository navigation
pe_inspect: require --out so a run never writes into the checkout (EGEN-PEINSPECT-OUT-REQUIRED) - #6212
Open
evilclanker9000 wants to merge 2 commits into
Open
pe_inspect: require --out so a run never writes into the checkout (EGEN-PEINSPECT-OUT-REQUIRED)#6212evilclanker9000 wants to merge 2 commits into
evilclanker9000 wants to merge 2 commits into
Conversation
The default resolved reports/pe through __file__, so a run from any working directory wrote a report of the game's executable into the checkout (under an ignored folder, but still inside the repo tree). Every documented call and scripts/first_look.ps1 already pass --out, so the flag becomes required: a run without it is one ERROR line and exit 2.
Fails on main: main() returned 0 and wrote <tools>/../reports/pe/sample.dll.json and .md. Asserts the exit code, the ERROR line, and that no default report directory appears.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tools/pe_inspect.pyresolved its--outdefault asos.path.join(os.path.dirname(__file__), "..", "reports", "pe"), so any run that omitted--outwrote<checkout>/reports/pe/<file>.jsonand.mdinto the repository tree from any working directory, with no option chosen. The report quotes the game's executable, and the tree keeps such reports out of the repository.This makes
--outrequired. Every documented invocation andscripts/first_look.ps1:24already pass it. A run without--outis oneERROR:line and exit 2, raised after the existing missing-input check so the BUILD-1046 contract for a missing input (oneERROR: <path>: does not existline) is unchanged.Test —
python -I tests/test_pe_inspect.py, new casePeInspectTest.test_cli_requires_an_output_directory:FAILED (failures=1)—main()returns 0 and writesreports/pe/sample.dll.jsonandsample.dll.mdinto the checkout.Ran 61 tests in 4.8s ... OK, and noreports/peappears.python -I tests/test_missing_input_exit_codes.py:Ran 2 tests in 1.7s ... OK.python -m compileall -q tools/pe_inspect.py tests/test_pe_inspect.py: clean.No GPU needed. No game files needed; the test builds its PE image by hand.
Notes
ERROR:line and exit 2 overargparse(required=True): the input check runs first today, andargparsewould print a usage block instead of the single line BUILD-1046 asserts.world_index, world_interior_names: no reports/ report unless --out is given (EGEN-WORLDINTERIOR-OUT-DEFAULT) #6177world_interior_names, world_archetypes: write a report only when --out is given, not into a default reports/ folder (EGEN-WORLDARCH-OUT-CWD, DeepSeek2) #6115world_archetypes) take the same approach; this is the third tool in that class.--game-dirand the report naming are unchanged; only the default output directory is gone.AI-assisted.