{"id":13693259,"url":"https://github.com/loopholelabs/wasm-toolkit","last_synced_at":"2026-03-15T18:08:56.630Z","repository":{"id":154195963,"uuid":"618562045","full_name":"loopholelabs/wasm-toolkit","owner":"loopholelabs","description":"Toolkit for dealing with wasm (webassembly), including an strace like tool.","archived":false,"fork":false,"pushed_at":"2024-07-04T19:16:12.000Z","size":6608,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-12T19:41:07.956Z","etag":null,"topics":["wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://loopholelabs.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loopholelabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-24T18:35:41.000Z","updated_at":"2024-09-23T15:32:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"e34a3339-f7bf-452b-b149-529014d83be1","html_url":"https://github.com/loopholelabs/wasm-toolkit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopholelabs%2Fwasm-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopholelabs%2Fwasm-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopholelabs%2Fwasm-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopholelabs%2Fwasm-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loopholelabs","download_url":"https://codeload.github.com/loopholelabs/wasm-toolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252108860,"owners_count":21696150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wasm","webassembly"],"created_at":"2024-08-02T17:01:07.680Z","updated_at":"2026-03-15T18:08:56.571Z","avatar_url":"https://github.com/loopholelabs.png","language":"Go","funding_links":[],"categories":["工具(库)"],"sub_categories":["其他"],"readme":"# WASM Toolkit\n\nA Toolkit for working with WebAssembly\n\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Discord](https://dcbadge.vercel.app/api/server/JYmFhtdPeu?style=flat)](https://loopholelabs.io/discord)\n![Go Version](https://img.shields.io/badge/go%20version-%3E=1.18-61CFDD.svg)\n[![Go Reference](https://pkg.go.dev/badge/github.com/loopholelabs/wasm-toolkit.svg)](https://pkg.go.dev/github.com/loopholelabs/wasm-toolkit)\n\n## Features\n\n* Encoding and decoding from `.wasm` binary (99% done)\n* Encoding and decoding from `.wat` text (99% done)\n\n* Adding strace like output to a wasm file, which gets output to `STDERR` as it runs.\n  * All function calls, with arguments and return\n  * All calls to imported functions, with args and return\n  * Dwarf source file and line number ranges\n  * Dwarf paramater names\n  * Wasi preview1 call and return values\n  * Function call count and timings summary\n  * Watch globals by name (i32 only so far)\n\n* wasm2wat but including dwarf debug information - line numbers, variable names, etc\n\n* POC Embedding a file into a wasm which is then available to the module.\n\n## Quickstart\n\n* wasm2wat - `./wasm-toolkit wasm2wat -i something.wasm -o something.wat`\n* wat2wasm - `./wasm-toolkit wat2wasm -i something.wat -o something.wasm`\n* strace - `./wasm-toolkit strace -i something.wasm -o something-with-strace-stderr.wasm`\n* embedfile - `./wasm-toolkit embedfile -i something.wasm -o something_embed.wasm --filename embedtest --content \"This is some file data :)\"`\n\n## Strace\n\n### Simple example\n\n`./wasm-toolkit strace -i ../module1.wasm -o module1_strace.wasm --all --color --func '^\\$IMPORT.*|\\_start'`\n\n![alt text](https://raw.githubusercontent.com/loopholelabs/wasm-toolkit/master/screenshots/strace1.png)\n\n### Filter functions\n\n`./wasm-toolkit strace -i ../module1.wasm -o module1_strace.wasm --all --color --func '^\\$main'`\n\n![alt text](https://raw.githubusercontent.com/loopholelabs/wasm-toolkit/master/screenshots/strace2.png)\n\n### Profiling\n\n`./wasm-toolkit strace -i ../module1.wasm -o module1_strace.wasm --all --color --func '.*' --timing true`\n\n![alt text](https://raw.githubusercontent.com/loopholelabs/wasm-toolkit/master/screenshots/strace3.png)\n\n### Watch global variables\n\n`./wasm-toolkit strace -i ../module1.wasm -o module1_strace.wasm --all --color --func '^\\$main' --watch main.some_global,main.another_global`\n\n![alt text](https://raw.githubusercontent.com/loopholelabs/wasm-toolkit/master/screenshots/strace4.png)\n\n![alt text](https://raw.githubusercontent.com/loopholelabs/wasm-toolkit/master/screenshots/strace5.png)\n\n\nYou can also compile wasm-toolkit to wasm and add tracing to it :)\n\n## Embed file (POC)\n\n![alt text](https://raw.githubusercontent.com/loopholelabs/wasm-toolkit/master/embed.png)\n\n## Example output\n\nOn the left is an strace like output. On the right is a wat output with debugging info.\n\n![alt text](https://raw.githubusercontent.com/loopholelabs/wasm-toolkit/master/output.png)\n\n## TODO\n\n* Dwarf watched globals - automatically determine type/length from dwarf data, support many types.\n* Hook unreachable calls and add far more context to aid debugging. eg show all watched variables.\n* Output to open telemetry standard.\n* More dwarf data - check up on the rust generated data.\n* Implement remainder of wasm instructions, fix bugs in wat parsing (comments etc).\n* More work on linking / composability.\n* Finish wasi file embed.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at [https://github.com/loopholelabs/wasm-toolkit][gitrepo]. For more contribution information check out [the contribution guide](https://github.com/loopholelabs/wasm-toolkit/blob/master/CONTRIBUTING.md).\n\n## License\n\nThe WASM Toolkit project is available as open source under the terms of the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\n## Code of Conduct\n\nEveryone interacting in the WASM Toolkit project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).\n\n## Project Managed By:\n\n[![https://loopholelabs.io][loopholelabs]](https://loopholelabs.io)\n\n[gitrepo]: https://github.com/loopholelabs/wasm-toolkit\n[loopholelabs]: https://cdn.loopholelabs.io/loopholelabs/LoopholeLabsLogo.svg\n[loophomepage]: https://loopholelabs.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopholelabs%2Fwasm-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floopholelabs%2Fwasm-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopholelabs%2Fwasm-toolkit/lists"}