Is there an easy way to extract all of the strings from Go binaries that will work cross architecture?
The problem with Go is that strings are stored without a null terminator, so you can't use the "strings" command plainly.
I found two solutions so far -
gostringsr2 - Extracts strings using references to the string section (by using radare2). But this method doesn't work 100% and screws up some strings because there are indirect references, etc...,
golang_loader_assist - Extracts strings by searching for
lea
/mov
instruction to the string section. But this method only works for x86 architectures.
Is there a more generic and correct way to extract the strings from Go compiled binaries?
golang_loader_assist
and it only supporting x86. If you'd like to submit a PR for updatingis_string_load()
for non-x86 patterns used by golang I'll gladly accept and apply them. AFAIK, there is no "easy" way to do this, which is why I resorted to this method. The calls for strings are preempted by the length, which is important since there is no null byte afterwards.