Parse bare BT_UNK and harden function dirtree dump#56
Open
ChrisKader wants to merge 2 commits into
Open
Conversation
A type byte of 0x00 (BT_UNK with BTMT_SIZE0) is IDA's unknown type of unspecified size, which appears in real databases as function argument and return types. It was being rejected with "forbidden use of BT_UNK", which aborted type parsing for any function that used it. Treat it like BT_UNKNOWN (unknown, unspecified size) instead. Also harden dump-dirtree-funcs so a single function whose label or type fails to parse no longer panics the whole dump: per-function parse errors are tolerated and, if printing a function still fails, the entry is emitted with an inline error note rather than unwrapping.
Some databases carry extra bytes after the IDBParam structure. Erroring on that aborted root-info parsing (and therefore the whole import) for those files. Gate the "Data left after the IDBParam" check behind the `restrictive` feature, matching how other strictness checks are handled, so normal parsing tolerates the trailing data.
Member
|
This is great thank for the PR @ChrisKader ! |
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.
A type byte of 0x00 (BT_UNK with BTMT_SIZE0) is IDA's unknown type of
unspecified size and appears in real databases as function argument/return
types, but it was rejected with "forbidden use of BT_UNK", aborting type
parsing for any function that used it. Parse it like BT_UNKNOWN (unknown,
unspecified size) instead.
Also harden
dump-dirtree-funcs: a single function whose label or type failsto parse no longer panics the whole dump (it previously
.unwrap()edprint_function). Per-function parse errors are tolerated, and an entry thatstill fails to print is emitted with an inline error note.
This let a full function-dirtree dump of a large arm64 database complete with
all ~150k functions instead of aborting after the first unparsable type.