Fix45#50
Open
shrddr wants to merge 2 commits into
Open
Conversation
Register member_type as a writable column and parse the type text, including suffix array forms such as char[256]. Apply retypes through IDA's direct set_udm_type API so a successful update changes only the member and preserves the UDT's existing layout attributes. Reject size-changing retypes because they require a layout policy change. Use the same parser for INSERT to prevent invalid member_type values from silently becoming int members, and return clear errors for invalid or unsized types. Validated with a release build: same-size scalar and array retypes succeed with offsets unchanged; size-changing retypes fail explicitly.
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.
Fixes #45 by making
types_members.member_typewritable.UPDATE types_members SET member_type = ...now parses and applies scalar, pointer, typedef, and suffix-array forms such aschar[256]. The same parser is used by INSERT, so invalid explicit member types now return an error instead of silently becomingint.To avoid unexpected UDT layout changes, UPDATE only permits replacements with the existing member’s size. Size-changing requests fail before modifying the type; offsets, UDT attributes, and all other member metadata remain untouched. After a successful update, the virtual-table row is refreshed with the stored type, size, and classification.
Validation
Built with the release preset using IDA 9.3 SP1 SDK.
Tested against a random
.i64database: same-size scalar and array retypes persist without moving later members;larger array retypes fail with a descriptive error and leave the UDT unchanged.