Wirm
Wirm 🐉 is an open-source project Rust library for rewriting WebAssembly bytecode. It was originally created to replace Walrus as it was unmaintained and difficult to work with when attempting to use it in the Whamm! project.
This new library, I believe, is easier to reason about injected code since it uses its own IR to basically “hang” newly injected bytecode at specified locations in the original code through the use of “decorators” at the location of injection.
These decorators are associated with some “rule” that says where the code should be injected.
For example, new code to be injected before some opcode would be done so by adding a Before decorator to that opcode location in the bytecode IR.
Then, during encoding, when this decorator is seen, it will inject the new instructions before the original opcode.
This library also allows users to perform bytecode rewriting on Wasm components.
Right now, this capability is limited to parsing a component and instrumenting its internal core modules.
However, in this PR, component-level instrumentation will be supported.
The added capability also enables a user to leverage the Visitor pattern to traverse a component with built-in support
for reference resolution.
Contributions are welcome/encouraged/extremely helpful/all the good things.