Repository navigation
Closed
Description
idasql -s test_vftables3.exe.i64 -i -w
Opening: test_vftables3.exe.i64...
Database opened successfully.
IDASQL Interactive Mode
Type .help for commands, .quit to exit
idasql> SELECT member_index, member_name, member_type FROM types_members WHERE type_name = 'My' ORDER BY member_index;
+--------------+-------------+-------------+
| member_index | member_name | member_type |
+--------------+-------------+-------------+
| 0 | x | int |
| 1 | y | int |
+--------------+-------------+-------------+
2 row(s)
idasql> UPDATE types_members SET member_name = 'y_modified' WHERE type_name = 'My' AND member_index = 1;
Error: types_members: failed to save (type= member=1)
idasql> SELECT member_index, member_name, member_type FROM types_members WHERE type_name = 'My' ORDER BY member_index;
+--------------+-------------+-------------+
| member_index | member_name | member_type |
+--------------+-------------+-------------+
| 0 | x | int |
| 1 | y_modified | int |
+--------------+-------------+-------------+
2 row(s)
idasql> .quit
Database saved.
Saved i64 does contain the modified field despite the error. The UPDATE should not show the error though, this complicates debugging actual update errors.
here's what an agent thinks
In src/lib/src/types_members.cpp:194:
bool TypeMemberRef::save() {
if (!valid) return false;
tinfo_t new_tif;
new_tif.create_udt(udt, tif.is_union() ? BTF_UNION : BTF_STRUCT);
return new_tif.set_numbered_type(get_idati(), ordinal, NTF_REPLACE, nullptr);
}
set_numbered_type() returns an IDA type error code, where TERR_OK == 0. The code converts that directly to bool.
Therefore:
- success (TERR_OK, 0) becomes false;
- the caller reports failed to save;
- the rename has nevertheless already been applied.
The correct form is:
return new_tif.set_numbered_type(
get_idati(), ordinal, NTF_REPLACE, nullptr
) == TERR_OK;
The existing types implementation already uses the correct comparison in src/lib/src/types_base.cpp:243.
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix allthingsida#44
0xeb commentedon Jul 17, 2026
Fixed for v0.0.18 (coming shortly). The
UPDATEwas actually succeeding — a generic error wrapper was masking the real result and surfacing a spurious "failed to save". That wrapper is removed, so successful edits report cleanly and only genuine failures carry a (specific) message. Thanks for the report, @shrddr!idasql v0.0.18
idasql v0.0.18