Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM support #93

Open
orangecms opened this issue Sep 19, 2021 · 1 comment
Open

WASM support #93

orangecms opened this issue Sep 19, 2021 · 1 comment

Comments

@orangecms
Copy link

orangecms commented Sep 19, 2021

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
Copy link
Owner

hillu commented Sep 20, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants