Skip to main content
ConductScienceScienceDex
zenodoopen

Dynamic Slicing of WebAssembly Binaries

<p>This is the replication package that accompanies the paper titled: &quot;Dynamic Slicing of WebAssembly Binaries&quot;.</p> <p># Slices dataset<br> ## Generating the dataset<br> The dynamic slices have been generated with [P-ORBS](https://syed-islam.github.io/research/program-analysis/#observation-based-program-slicing-orbs).<br> The steps and scripts to generate the dynamic slices are included in the `slicing-steps/` directory.<br> These steps also describe how to generate the `stats.csv` file that is included in this dataset.</p> <p>The static slices have been generated with [wassail](https://github.com/acieroid/wassail).<br> The scripts to generate the static slices are included in the current directory (`generate-static-slices.sh` which relies on `run_wassail.sh`).<br> These steps generate the file `static-stats.csv` that is included in this dataset.</p> <p>The `original-size.csv` file, included in this dataset, can be generated as follows:<br> ```sh<br> find subjects-wasm-extract-slice -name \*.c.wat -exec c_count {} \; | grep subjects &gt; counts.txt<br> echo &#39;slice,original fn slice&#39; &gt; evaluation/original-sizes.csv<br> sed -E &#39;s|^(.*) subjects-wasm-extract-slice/[^/]*/([^/]*)/.*$|\2,\1|&#39; counts.txt &gt;&gt; evaluation/original-sizes.csv<br> ```</p> <p>The numbers in Table 1 of the paper (the list of programs in the dataset along with their sizes) can be generated as follows.<br> For the WebAssembly files, we can count the function size:</p> <p>```<br> find subjects-wasm-extract-slice -name \*.c.wat -exec c_count {} \; | grep subjects &gt; counts.txt<br> sed -E &#39;s|^(.*) subjects-wasm-extract-slice/([^/]*)/.*$|\1 \2|&#39; counts.txt | python evaluation/table1-wasm-mean.py<br> ```</p> <p>or the full program size:</p> <p>```<br> find subjects-wasm-extract-slice -name t.wat -exec c_count {} \; | grep subjects &gt; counts.txt<br> sed -E &#39;s|^(.*) subjects-wasm-extract-slice/([^/]*)/.*$|\1 \2|&#39; counts.txt | python evaluation/table1-wasm-mean.py<br> ```</p> <p>## Structure of the dataset</p> <p>The dataset is structured as follows:</p> <p>&nbsp; - `subjects/` contains the instrumented `.c` source code, along with scripts to generate the dynamic slices.<br> The original source code can be obtained by removing the line `printf(&quot;\nORBS:%x\n....`.<br> &nbsp; - `subjects-wasm-extract-slice/` contains the original WebAssembly programs to slice. Each program has two files: `t.wat` is the full binary file, and `name.c.wat` is the binary code of the function containing the slicing criterion.<br> &nbsp; - `all_slices/` contains the slices. For example, program `adpcm_ah1_254_expr` has the following files<br> &nbsp; &nbsp; - `adpcm/adpcm_ah1_254_expr/EWS_adpcm.wat`: the EWS slice<br> &nbsp; &nbsp; - `adpcm/adpcm_ah1_254_expr/SEW_adpcm.wat`: the SEW slice<br> &nbsp; &nbsp; - `adpcm/adpcm_ah1_254_expr/ESW_adpcm.wat`: the ESW slice<br> &nbsp; &nbsp; - `adpcm/adpcm_ah1_254_expr/static_adpcm.wat.slice`: the SWS slice<br> &nbsp; &nbsp; The other files are produced by intermediary steps and can be ignored. They are:<br> &nbsp; &nbsp; - `adpcm/adpcm_ah1_254_expr/ESW_adpcm.wat.orig`: original (unsliced) binary *file* from which SW and ESW slices are computed<br> &nbsp; &nbsp; - `adpcm/adpcm_ah1_254_expr/SEW_adpcm.wat.orig`: original (unsliced) binary *function* from which SEW slice &nbsp;is computed<br> &nbsp; &nbsp; - `adpcm/adpcm_ah1_254_expr/SW_adpcm.wat`: slice of entire binary file from which ESW slice is extracted<br> &nbsp; &nbsp; - `adpcm/adpcm_ah1_254_expr/WS_adpcm.wat`: compiled (binary) version of dynamic C slice from which EWS slice is extracted<br> &nbsp; &nbsp;&nbsp;<br> # Research questions<br> ## RQ1</p> <p>The script `./RQ1.py` found in the `evaluation/` directory generates:</p> <p>&nbsp; - Figure 3 (time.pdf)<br> &nbsp; - The mean, min, max, and stddev of the times<br> &nbsp; - How many slices are computed below 10, 100, 1000, and 10000 seconds</p> <p>## RQ2</p> <p>The script `./RQ2.py` found in the `evaluation/` directory generates:</p> <p>&nbsp; - Figure 4 (loc.pdf)<br> &nbsp; - The mean, median, min, max, and stddev of the sizes<br> &nbsp; - The largest differences between the approaches<br> &nbsp; - The number of slices larger than the original program<br> &nbsp;&nbsp;<br> ## RQ3 and RQ4</p> <p>The process for these research questions is manual and requires comparing slices.<br> It cannot be automated. &nbsp;<br> We did make heavy use of `diff --side-by-side` in this analysis.<br> &nbsp;</p>

ShareScore

36/100

Overall dataset sharing score

Score breakdown

These five areas show where the dataset supports — or may limit — practical reuse.

Stewardship
8
Harmonization
4
Access
16
Reuse readiness
8
Engagement
0

Topics

Dataset details

Repository
zenodo
Published
June 11, 2023
License
cc-by-4.0
DOI
10.5281/zenodo.8025835

Scored with release 0.9.0

ScienceDex for faculty

Your academic CV and NIH biosketch

Make your CV in your school's format and your NIH biosketch from it, then download both as Word files.