Skip to content

Fix45#50

Open
shrddr wants to merge 2 commits into
allthingsida:mainfrom
shrddr:fix45
Open

Fix45#50
shrddr wants to merge 2 commits into
allthingsida:mainfrom
shrddr:fix45

Conversation

@shrddr

@shrddr shrddr commented Jul 13, 2026

Copy link
Copy Markdown

Fixes #45 by making types_members.member_type writable.
UPDATE types_members SET member_type = ... now parses and applies scalar, pointer, typedef, and suffix-array forms such as char[256]. The same parser is used by INSERT, so invalid explicit member types now return an error instead of silently becoming int.
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 .i64 database: same-size scalar and array retypes persist without moving later members;
larger array retypes fail with a descriptive error and leave the UDT unchanged.

shrddr added 2 commits July 12, 2026 01:28
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

types_members: member_type is not writable

1 participant