Webassembly instrumenter to add a numerical sniffer that detect arithmetic anomalies
npm install cowac_webCOWAC (Climbing Over WebAssembly Arithmetic Capabilities) is a _JavaScript_ library, powered by Wail
and inspired by Cojac, that instrument WebAssembly modules in
order to add a numerical sniffer. This sniffer is able to track and signal arithmetic anomalies.
Currently, COWAC is able to detect the following anomalies:
- Overflow of integers addition and subtraction
- Overflow of floating point numbers addition and subtraction
Cowac is available as a npm package, and can be install with the
following command:
``bash`
npm i cowac_web
The tools is also available from the JSDeliver CDN:
`html`
To use the library, no need to install it ! The script can be used via the plugin Tampermonkey.
First, install the plugin. Then, you can use the _userscript_ available in the project's userscript folder or@match
directly from the npm repositorry. Just add the script to Tampermonkey. The script is configured to target every
website. If you want to target only specific websites, you can modify the directive script header. You can
as well change the Cowac version by modifying the import URL. Don't forget to activate the script.
`js
// ==UserScript==
// @name Cowac Web
// @namespace Cowac
// @version 2025-01-26
// @description Instrument WebAssembly (add a numerical sniffer, find and signal overflow in running time)
// @author Dimitri Julmy
// @match ==> CHANGE HERE <==
// @grant none
// @run-at document-start
// ==/UserScript==
...
var module
try {
// ==> CHANGE HERE <==
module = await import('https://cdn.jsdelivr.net/npm/cowac_web@x.x.x/index.js')
} catch (error) {
console.error("Failed to load Cowac Web module:", error)
return
}
``