Fasmi is a F# to Jitted ASM / IL disassembler as a dotnet tool. Maintained by folks at D-EDGE.
Install fasmi as a global dotnet tool
dotnet tool install fasmi -g
or as a dotnet local tool
dotnet new tool-manifest
dotnet tool install fasmi
Create a demo.fsx F# interactive script:
let inc x = x+1
run fasmi:
dotnet fasmi ./demo.fsx
and open at the generated demo.asm file:
Demo.inc(Int32)
L0000: lea eax, [rcx+1]
L0003: ret
run fasmi in watch mode:
dotnet fasmi ./demo.fsx -w
Open the demo.fsx and demo.asm files side by side in your favorite editor, make changes to demo.fsx and save. The demo.asm file is updated on the fly.
USAGE: dotnet fasmi [--help] [--console] [--output <string>] [--watch] [--platform <x86|x64>] [--language <asm|il>] <string>
SOURCE:
<string> the source fsx or dotnet assembly file
OPTIONS:
--console, -c output to console
--output, -o <string> specifiy the output file
--watch, -w run in watch mode
--platform, -p <x86|x64>
specify the platform for disassembly
--language, -l <asm|il>
specify the output language (asm/il)
--help display this list of options.
The input can be a fsx F# script file or any dotnet .dll assemlby file. F# scripts are compiled for net 5.0.
Using a dotnet assembly as an input, you can use fasmi on any dotnet language.
With the -c
flag, the result is output to console rather than in a file.
Use the -o
flag to specifie the target file path and name.
The -w
flag runs fasmi in watch mode. The file is recompiled and disassembled automatically when saved.
Use the -p
flag to force x64 or x86 platform for disassembly.
Specify the target language with the -l
flag:
This tool is based on Andrey Shchekin code for https://sharplab.io/.
Help and feedback is always welcome and pull requests get accepted.