felberj / gotools

Plugin for Ghidra to assist reversing Golang binaries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors creating symbol names on import of binary

deliciouslytyped opened this issue · comments

Error creating symbol: type.struct {} - Symbol name contains invalid characters: type.struct {}
Error creating symbol: go.(*struct { sync.Mutex; reflect.m sync.Map }).Unlock - Symbol name contains invalid characters: go.(*struct { sync.Mutex; reflect.m sync.Map }).Unlock
commented

Do you know the version of go that was used to compile this binary?
Do you happen to have the source of this binary?

Yes and yes, I'm not very familiar with go though and I don't think I'm in a position to share the source. I'll see what I can do.

Ok, I think it may have been go 1.11.6 and you specified 1.12

commented

Thanks! If your binary is not striped, you can just disable the "Go Function Name Analyzer". It looks like there are anonymous structs and I did not yet play around with those.

Unless I messed up my build script, I get the same errors with 1.12.

commented

Can you try to provide a minimal code snipped with this go.(*struct { sync.Mutex; reflect.m sync.Map }).Unlock symbol? You might need to compile it like in https://github.com/felberj/gotools/blob/master/testdata/Makefile to avoid optimisations.

I am not sure what the best solution for this is. We might want to filter out these symbols, or as a quick and dirty hack just ignore them like here: https://github.com/felberj/gotools/blob/master/src/main/java/gotools/GoFunctionNameAnalyzer.java#L76