Comments (11)
You can list the exports using wasm-objdump -j export
.
We could add a flag to allow you to disassamble just exported functions but I'm not clear why that would be useful. Why would you only want to disassemble the exported functions?
Aside from that I'm not quite sure what you are asking for here. The data in wasm module is no generally associated with particular function. Any function can access any data. There may have been some link/assosiation in the source language but those links are not present in the binaryn.
from wabt.
In the case of a shared library and I forgot all the exported functions I included in it
from wabt.
Also I just tried wasm-objdump -j export
and I had to add -x and then it told me "section not found: export" also checked the plural form
from wabt.
Also I just tried
wasm-objdump -j export
and I had to add -x and then it told me "section not found: export" also checked the plural form
What don't wasm-objdump -h
tell you? Does the file really not have an export section?
from wabt.
all wasm-objdump -h
tells me is
wasm-objdump: expected filename argument.
Try '--help' for more information.
if I try --help
usage: wasm-objdump [options] filename+
Print information about the contents of wasm binaries.
examples:
$ wasm-objdump test.wasm
options:
--help Print this help message
--version Print version information
-h, --headers Print headers
-j, --section=SECTION Select just one section
-s, --full-contents Print raw section contents
-d, --disassemble Disassemble function bodies
--debug Print extra debug information
-x, --details Show section details
-r, --reloc Show relocations inline with disassembly
--section-offsets Print section offsets instead of file offsets in code disassembly
and idk how to check for export section (all i know is that wasm2c produces valid C code)
from wabt.
The -h
or --headers
flag lists the headers of a wasm file. You need to also specify the wasm file on the command line along with the -h
flag. Sorry I wasn't more clear about that.
from wabt.
so it appears the propper command is wasm-objdump -j Export -x
but this includes the export of memory
and also fails to include the function types (inputs/outputs)
from wabt.
Right, -j Export lists all the exports, not just the functions. There is not flag for listing just part of the export section. Each section is listed in it's entirety, or not at all.
The signatures are in a different section so you would use a different -j
flag to list those.
If you are looking for other ways to introspect a wasm module you might also want to take a look at wasm-dis from the binaryen project.
from wabt.
wasm-dis imo feels like a worse wasm2wat
from wabt.
(also totally not considering implementing my own WASM VM in lua since the only wasm2lua I can find is broken and apparently abandoned)
from wabt.
afterall for my specific binary I would only have to implement 101 diffrent opcodes (not including some other important stuff)
from wabt.
Related Issues (20)
- Error using wasm2wat on a wasm file generated by Moonbit: "unexpected type form (got -0x30)" HOT 1
- Out-of-Memory Program Abort in wabt::interp::Table::Grow() HOT 2
- Out-of-Memory Program Abort in BinaryReaderInterp::OnDataCount()
- Invalid Memory Read in FreeList<wabt::interp::Object*>::IsUsed()
- error initializing module: invalid import "a.a" HOT 1
- Error while running testsuite (simd_lane, simd_load) "loop not vectorized" HOT 3
- wasm2wat: support component wasm HOT 1
- Wrong type error when validating globals with gc proposal features
- wat2wasm: Assertion `!"ParseExpr should only be called when IsExpr() is true"' failed in wabt::WastParser::ParseExpr
- Wast2Json fails on the testsuite HOT 8
- Library not loaded: /usr/local/opt/openssl@3/lib/libcrypto.3.dylib HOT 8
- Missing Import when running global.wast HOT 1
- `wast2json` miscompiles "if.wast" from the specification tests HOT 4
- Build failed on Apple Silicon platform HOT 4
- [wasm2c] Strange issue with double parsing in msvc HOT 5
- wasm2c compiling minimal example issues HOT 1
- [wasm2c] catching traps without exception runtime
- “picosha2.h”: No such file or directory HOT 2
- Allocator is out of memory in wasm-interp HOT 3
- Invalid Read Memory in wabt::interp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wabt.