wa-info 0.0.3

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.3                
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.3                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=wa-info&version=0.0.3                
nuke :add-package wa-info --version 0.0.3                

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

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
  -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

Summary of the module and sections

> wa-info.exe 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.exe -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.exe --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.4.0 72 10/30/2024
0.3.0 86 10/8/2024
0.2.0 111 9/13/2024
0.1.0 399 1/17/2023
0.0.13 432 11/30/2022
0.0.12 453 11/4/2022
0.0.11 465 9/8/2022
0.0.9 539 4/11/2022
0.0.8 458 3/30/2022
0.0.7 482 3/25/2022
0.0.6 458 3/15/2022
0.0.5 487 3/7/2022
0.0.4 3,567 11/25/2021
0.0.3 355 10/5/2021
0.0.2 398 10/5/2021
0.0.1 409 10/4/2021