Earlier quoted context omitted.
>Just curious, is a Go string a C string inside (rune array + nil) or a proper class array? I can't imagine how you would even implement a string as anything other than a rune array. Even a Pascal string is just the string length followed by characters.
In Haskell strings are lists of characters ( https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-S... ). I hear not everyone is thrilled with the performance implications. :) Also not a Haskell programmer, and really not meaning to criticize. Haskell seems awesome and I should learn it some day.
Reversing Go Binaries Like a Pro
21–28 of 28 posts
Re: Reversing Go Binaries Like a Pro
#22Earlier quoted context omitted.
>Just curious, is a Go string a C string inside (rune array + nil) or a proper class array? I can't imagine how you would even implement a string as anything other than a rune array. Even a Pascal string is just the string length followed by characters.
as C does: with a \00 end marker.
The answer is you can't. Because prefix-length strings (Pascal) are far better than null-terminated (C) strings.
Re: Reversing Go Binaries Like a Pro
#23> You can quiet easily differentiate between custom code written for the binary, for example in the Linux malware “Rex” everything because with that name space! Really? It looks like only `runtime_` gets the prefix, so third-party libraries and code in go/src (e.g. `fmt`) would get mixed in here too, right?
Re: Reversing Go Binaries Like a Pro
#24> You can quiet easily differentiate between custom code written for the binary, for example in the Linux malware “Rex” everything because with that name space! Really? It looks like only `runtime_` gets the prefix, so third-party libraries and code in go/src (e.g. `fmt`) would get mixed in here too, right?
Everything get prefixed by the package namespace, so things pulled from github.com/group_name/package ends up looking like `github_com_group_name_package_class_funcname. This why why "rebuilding" the function names was a good way to quickly filter out the "known" code from the malicious functionality.
Re: Reversing Go Binaries Like a Pro
#25> You can quiet easily differentiate between custom code written for the binary, for example in the Linux malware “Rex” everything because with that name space! Really? It looks like only `runtime_` gets the prefix, so third-party libraries and code in go/src (e.g. `fmt`) would get mixed in here too, right?
Everything get prefixed by the package namespace, so things pulled from github.com/group_name/package ends up looking like `github_com_group_name_package_class_funcname. This why why "rebuilding" the function names was a good way to quickly filter out the "known" code from the malicious functionality.
Re: Reversing Go Binaries Like a Pro
#26Earlier quoted context omitted.
Everything get prefixed by the package namespace, so things pulled from github.com/group_name/package ends up looking like `github_com_group_name_package_class_funcname. This why why "rebuilding" the function names was a good way to quickly filter out the "known" code from the malicious functionality.
So you can achieve smaller (/obfuscated) binaries by automatically renaming everything in $GOPATH to short unique strings? That would be a neat project.
Re: Reversing Go Binaries Like a Pro
#27Earlier quoted context omitted.
Everything get prefixed by the package namespace, so things pulled from github.com/group_name/package ends up looking like `github_com_group_name_package_class_funcname. This why why "rebuilding" the function names was a good way to quickly filter out the "known" code from the malicious functionality.
Is this really how the names are represented internally? if so, how can it tell apart e.g. "github.com/group_name/package" and "github.com/group/name_package"?
Re: Reversing Go Binaries Like a Pro
#28Earlier quoted context omitted.
In Haskell strings are lists of characters ( https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-S... ). I hear not everyone is thrilled with the performance implications. :) Also not a Haskell programmer, and really not meaning to criticize. Haskell seems awesome and I should learn it some day.
Just so people know, there are arrays used for text manipulation in Haskell in the Data.Text library, and bytestrings in the ByteString library. The language as specified does indeed have strings in a linked list of numbers, but if you even remotely care about performance you don't use those, and most libraries don't either nowadays.