mirror of
https://github.com/thunderbrewhq/binana.git
synced 2026-04-26 18:53:52 +00:00
feat(go): prevent auto-analysis symbols from loading into either IDA or Ghidra symbol table
This commit is contained in:
parent
07cb5c543a
commit
9a4ffe31a5
2 changed files with 18 additions and 1 deletions
|
|
@ -3,6 +3,8 @@ package profile
|
|||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/thunderbrewhq/binana/go/symbols"
|
||||
)
|
||||
|
||||
func compile_ghidra_artifacts(profile *Profile, params *CompileArtifactsParams) (err error) {
|
||||
|
|
@ -15,8 +17,18 @@ func compile_ghidra_artifacts(profile *Profile, params *CompileArtifactsParams)
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
// strip out autoanalysis symbols
|
||||
var symbol_table symbols.Table
|
||||
symbol_table.Init()
|
||||
for entry := range profile.Symbols.Entries() {
|
||||
if !entry.Symbol.Auto {
|
||||
if err = symbol_table.Insert(entry); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_, err = profile.Symbols.WriteTo(symbol_file)
|
||||
_, err = symbol_table.WriteTo(symbol_file)
|
||||
symbol_file.Close()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,6 +107,11 @@ func compile_idapro_artifacts(profile *Profile, params *CompileArtifactsParams)
|
|||
name_instances := make(map[string]int)
|
||||
|
||||
for symbol := range profile.Symbols.Entries() {
|
||||
if symbol.Symbol.Auto {
|
||||
// Ignore auto-analysis symbols
|
||||
continue
|
||||
}
|
||||
|
||||
name := symbol.Symbol.Name
|
||||
instances := name_instances[name]
|
||||
name_instances[name] = instances + 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue