Skip to content

Commit

Permalink
Add type importing to IDA
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemk14ebr committed Oct 12, 2023
1 parent ce1e752 commit 5764f92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions IDAPython/goresym_rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']))
Expand Down
3 changes: 3 additions & 0 deletions objfile/objfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"encoding/binary"
"fmt"
"io"
"math/rand"
"os"
"sort"
"strconv"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 5764f92

Please sign in to comment.