Skip to content

Commit

Permalink
Workaround for empty names processing appeared in ida9
Browse files Browse the repository at this point in the history
  • Loading branch information
srgblv committed Nov 28, 2024
1 parent cdecd34 commit 0c253b3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/hrtng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3953,8 +3953,9 @@ static ssize_t idaapi idp_callback(void *user_data, int ncode, va_list va)
//const char *new_name = va_arg(va, const char *);
//int flags = va_arg(va, int);
if(is_func(get_flags(ea))) {
funcRenameEa = ea;
get_ea_name(&funcRename, ea);
if(!funcRename.empty())
funcRenameEa = ea;
}
}
}
Expand Down Expand Up @@ -4097,7 +4098,8 @@ static ssize_t idaapi idb_callback(void *user_data, int ncode, va_list va)
//msg("[hrt] renaming_struc_member %s\n", newname);

//rename VT method impl together with VT member
if(strncmp(newname, "sub_", 4) &&
if(qstrlen(newname) &&
strncmp(newname, "sub_", 4) &&
strncmp(newname, "field_", 6)) {
qstring struCmt;
get_struc_cmt(&struCmt, sptr->id, true);
Expand Down Expand Up @@ -4154,7 +4156,7 @@ static ssize_t idaapi idb_callback(void *user_data, int ncode, va_list va)
break;

const char* newname = udm->name.c_str();
if (!strncmp(newname, "sub_", 4) || !strncmp(newname, "field_", 6))
if (udm->name.empty() || !strncmp(newname, "sub_", 4) || !strncmp(newname, "field_", 6))
break;

tinfo_t struc;
Expand Down Expand Up @@ -4262,7 +4264,7 @@ static ssize_t idaapi idb_callback(void *user_data, int ncode, va_list va)
}
}
}
if(funcRenameEa == ea) {
if(funcRenameEa == ea && !funcRename.empty()) {
//rename VT members too
int cnt = 0;
enumStrucMembers(funcRename.c_str(), countStrucMembersCB, &cnt);
Expand Down Expand Up @@ -4386,7 +4388,7 @@ plugmod_t*
addon.producer = "Sergey Belov and Milan Bohacek, Rolf Rolles, Takahiro Haruyama," \
" Karthik Selvaraj, Ali Rahbar, Ali Pezeshk, Elias Bachaalany, Markus Gaasedelen";
addon.url = "https://github.com/KasperskyLab/hrtng";
addon.version = "1.1.6";
addon.version = "1.1.7";
register_addon(&addon);

return PLUGIN_KEEP;
Expand Down

0 comments on commit 0c253b3

Please sign in to comment.