wa-info 0.0.6

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global wa-info --version 0.0.6
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local wa-info --version 0.0.6
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=wa-info&version=0.0.6
nuke :add-package wa-info --version 0.0.6

wa-info

wa-info is a tool to inspect WebAssembly binary format wasm files.

It can show sections overview in the summary output, disassemble function(s) code, show information about dotnet AOT. It is available as dotnet tool.

Installation

To install wa-info as dotnet tool run:

dotnet tool install -g wa-info

to update use:

dotnet tool update -g wa-info

Command line options

Usage: wa-info.exe OPTIONS* file.wasm [file2.wasm ...]

Provides information about WebAssembly file(s)

Copyright 2021 Microsoft Corporation

Options:
      --aot-stats            Show stats about methods
  -a, --assembly-filter=REGEX
                             Filter assemblies and process only those matching
                               REGEX
  -d, --disassemble          Show functions(s) disassembled code
  -f, --function-filter=REGEX
                             Filter wasm functions REGEX
  -h, --help, -?             Show this message and exit
  -o, --instruction-offsets  Show instruction offsets
  -t, --type-filter=REGEX    Filter types and process only those matching REGEX
  -v, --verbose              Output information about progress during the run
                               of the tool

Example usage

Disassemble function

> wa-info -d -f test test.wasm
(func test_simd(param i32) (result i32))
 local 1 123
 local.get $0
 i32x4.splat    [SIMD]
 local.tee $1
 local.get $1
 i16x8.avgr.u    [SIMD]
 i32x4.extract.lane    [SIMD]

Summary of the module and sections

> wa-info dotnet.wasm
Module: path: dotnet.wasm
  size: 74,502,446
  binary format version: 1
  sections: 17
    id: Type size: 5,237
    id: Import size: 4,315
    id: Function size: 163,566
    id: Table size: 9
    id: Memory size: 7
    id: Global size: 19
    id: Export size: 7,213
    id: Element size: 428,929
    id: Code size: 34,177,740
    id: Data size: 9,520,741
    id: Custom name: name size: 21,544,785
    id: Custom name: .debug_info size: 4,035,679
    id: Custom name: .debug_loc size: 1,436,083
    id: Custom name: .debug_ranges size: 140,966
    id: Custom name: .debug_abbrev size: 240,230
    id: Custom name: .debug_line size: 2,060,872
    id: Custom name: .debug_str size: 735,984

Disassemble function

note: build the app with -p:WasmNativeDebugSymbols=true -p:WasmNativeStrip=false to preserve name custom section

> wa-info -d -f ves_icall_RuntimeFieldInfo_GetValueInternal$ dotnet.wasm
(func ves_icall_RuntimeFieldInfo_GetValueInternal(param i32 i32 i32) (result i32))
 local.get $0
 i32.load align:2
 i32.load offset:12 align:2
 local.tee $0
 local.get $1
 if
  local.get $1
  i32.load align:2
 else
  i32.const 0

 local.tee $1
 local.get $2
 call mono_field_get_value_object_checked
 i32.const 11201820
 i32.load align:2
 call mono_handle_new

Get AOT stats

> wa-info --aot-stats dotnet.wasm
AOT stats: 5005 function(s) call(s) interpreter, 2.96% of 169215 functions
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.1.0 368 1/17/2023
0.0.13 397 11/30/2022
0.0.12 422 11/4/2022
0.0.11 433 9/8/2022
0.0.9 506 4/11/2022
0.0.8 426 3/30/2022
0.0.7 449 3/25/2022
0.0.6 435 3/15/2022
0.0.5 449 3/7/2022
0.0.4 3,540 11/25/2021
0.0.3 325 10/5/2021
0.0.2 367 10/5/2021
0.0.1 381 10/4/2021