THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
PE._get_memory_mapped_image skips a section whose raw data begins past the end of the file, and logs that it is doing so, while _register_sections registers that same section, so it still counts toward max_addr. The object ends up declaring a range nothing backs.
On the committed fixture tests/i386/windows/a94bbeed0ef51db3d3964bb0cc2cbed0adab0e47997d88f34daa92faa1a91e8a, ld.main_object.contains_addr(ld.main_object.max_addr) is True while ld.find_object_containing of that same address is None, describe_addr calls it "not part of a loaded object", and ld.memory.load(ld.main_object.sections_map[".rdata"].vaddr, 1) raises KeyError.
That fixture is the one test_loading_incomplete_pe_file pins, and #663 already decided a truncated file's missing bytes stay missing. Zero-filling the whole declared extent breaks that test and turns the padding into blocks; backing only the sections the file omits entirely does neither, but still invents bytes.
So either the object should stop claiming addresses it cannot back, or those sections should be zeroed. Neither changes the functions or blocks CFGFast recovers here. Happy to open a pull request for whichever you prefer.
Related: #790.
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
PE._get_memory_mapped_imageskips a section whose raw data begins past the end of the file, and logs that it is doing so, while_register_sectionsregisters that same section, so it still counts towardmax_addr. The object ends up declaring a range nothing backs.On the committed fixture
tests/i386/windows/a94bbeed0ef51db3d3964bb0cc2cbed0adab0e47997d88f34daa92faa1a91e8a,ld.main_object.contains_addr(ld.main_object.max_addr)is True whileld.find_object_containingof that same address is None,describe_addrcalls it "not part of a loaded object", andld.memory.load(ld.main_object.sections_map[".rdata"].vaddr, 1)raisesKeyError.That fixture is the one
test_loading_incomplete_pe_filepins, and #663 already decided a truncated file's missing bytes stay missing. Zero-filling the whole declared extent breaks that test and turns the padding into blocks; backing only the sections the file omits entirely does neither, but still invents bytes.So either the object should stop claiming addresses it cannot back, or those sections should be zeroed. Neither changes the functions or blocks CFGFast recovers here. Happy to open a pull request for whichever you prefer.
Related: #790.