Skip to content

Example of injecting a data section into an existing wasm module

Notifications You must be signed in to change notification settings

adambratschikaye/wasm-inject-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wasm-inject-data

Example of injecting a data section into an existing wasm module.

This repo shows how a wasm module can be created which uses static data that is expected to be added at a later time. There are two artifacts:

static-wasm

This is a wasm module which reads a passive data section into a vector. The passive data section is not actually present when the wasm module is built. Instead, it is expected that the additional data section be injected later.

inject

This is a native binary that can mutate static-wasm to inject new data as an additional passive data segment.

Usage

The script test.sh shows how to build static-wasm, then use inject to add a data segment, and then run the resulting wasm with wasmtime.

About

Example of injecting a data section into an existing wasm module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published