hillu/go-yara

WASM support

orangecms opened this issue · 1 comments

This is probably "just" a matter of documentation, though here's the idea:

For an analysis tool running in a web browser based on Go and WASM, libyara would need to support that compile target.

There is already libyara-wasm and wasmer-go. Now the question is what exactly needs to be done such that I can write a Go function to be called from JavaScript through WASM.

So far, I have been using webpack-golang-wasm-async-loader in Fiedka (branch to replace main somewhat soon).

My overall goal is to get https://github.com/Mimoja/MFT-AnalyserV2 in as a package, so I'm dealing with multiple modules and transitive dependencies, for which I do have forks and branches, especially https://github.com/orangecms/MFT-AnalyserV2/tree/fiedka. Anyhow, every little hint would be highly appreciated. 🙇

hillu commented

As long as there is no CGO support for Go's WASM backend, I don't see an easy solution.

I think that libyara-wasm may be a good start, but you'd have to port every relevant bit of go-yara that uses CGO to some shim that involves using the libyara-wasm interfaces from through runtime/js.