-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stop fetching memory blocks when an elf is found (#1996)
When scanning multiple memory blocks, we should stop as soon as a valid elf is found. This was broken as the "break" applies to the switch, and not the outer loop. Fix this by reworking the code to remove the switch. This bug had two repercutions: - instead of parsing the first memory block that contains an elf, it returned the last one, or actually even worse, a mix of all elfs depending on which values are set again or not. This however should not manifest in normal situations, notably during process scanning, as I suppose only one memory region would contain an elf executable. - the module caused the fetch of all memory blocks instead of stopping as soon as one was found, which is worse performance wise.
- Loading branch information
Showing
1 changed file
with
60 additions
and
72 deletions.
There are no files selected for viewing
This file contains 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