diff --git a/IDAPython/goresym_rename.py b/IDAPython/goresym_rename.py index 71f6c02..9c7f53a 100644 --- a/IDAPython/goresym_rename.py +++ b/IDAPython/goresym_rename.py @@ -41,11 +41,11 @@ def iterable(obj): if iterable(hints['Types']): ## import all the types first (reverse order, so that child types imported first) - #for typ in hints['Types'][::-1]: - # if typ.get('CReconstructed'): - # errors = ida_typeinf.idc_parse_types(typ['CReconstructed'] + ";", ida_typeinf.HTI_PAKDEF) - # if errors > 0: - # print(typ['CReconstructed'], "failed to import") + for typ in hints['Types'][::-1]: + if typ.get('CReconstructed'): + errors = ida_typeinf.idc_parse_types(typ['CReconstructed'] + ";", ida_typeinf.HTI_PAKDEF) + if errors > 0: + print(typ['CReconstructed'], "failed to import") for typ in hints['Types']: print("Renaming %s to %s" % (hex(typ['VA']), typ['Str'])) diff --git a/objfile/objfile.go b/objfile/objfile.go index 004ddcc..d6371b8 100644 --- a/objfile/objfile.go +++ b/objfile/objfile.go @@ -12,6 +12,7 @@ import ( "encoding/binary" "fmt" "io" + "math/rand" "os" "sort" "strconv" @@ -1033,6 +1034,8 @@ func replace_cpp_keywords(fieldname string) string { fallthrough case "class": return "_" + fieldname + case "_": + return "_anon" + fmt.Sprint(rand.Intn(1000)) } return fieldname }