Git Product home page Git Product logo

wasm's People

Contributors

athre0z avatar buaabyl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wasm's Issues

Could i get CVE numbers for reporting the bugs

I fuzzed this library and got some crash. Could i get cve numbers for reporting the bugs. crash like this:

    for cur_sec, cur_sec_data in mod_iter:
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/wasm/decode.py", line 45, in decode_module
    sec_len, sec_data, _ = sec.from_raw(None, module_wnd)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/wasm/types.py", line 302, in from_raw
    data_len, val, data_type = cur_field.from_raw(data, raw[offs:])
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/wasm/types.py", line 188, in from_raw
    return self.choice_field_map[choice].from_raw(ctx, raw)
KeyError: 90

wasm assembler

Is there also a python wasm assembler somewhere, so that we can write back the modified AST?

KeyError: 96

Hi, just did a simple test:

int add(int a, int b) {
	return a + b;
}

emcc testwasm.c -o test.wasm -s WASM=1 -s SIDE_MODULE=1

Command wasmdump --disas test.wasm fails with:

emscripten@euve254883:~$ wasmdump --disas test.wasm
- [ ModuleHeader
  | magic = 0x6d736100
  | version = 0x1
- [ Section
  | id = 0
  | payload_len = 12
  | name_len = 6
  | name = "dylink"
  | payload = [0x80, 0x80, 0xc0, 0x2, 0x0, 0x1, 0x9c, 0x80, 0x80, 0x80, 0x0, 0x6]
  | overhang = []
Traceback (most recent call last):
  File "/home/emscripten/.local/bin/wasmdump", line 11, in <module>
    load_entry_point('wasm==1.1', 'console_scripts', 'wasmdump')()
  File "/home/emscripten/.local/lib/python2.7/site-packages/wasm/__main__.py", line 34, in dump
    for cur_sec, cur_sec_data in mod_iter:
  File "/home/emscripten/.local/lib/python2.7/site-packages/wasm/decode.py", line 45, in decode_module
    sec_len, sec_data, _ = sec.from_raw(None, module_wnd)
  File "/home/emscripten/.local/lib/python2.7/site-packages/wasm/types.py", line 302, in from_raw
    data_len, val, data_type = cur_field.from_raw(data, raw[offs:])
  File "/home/emscripten/.local/lib/python2.7/site-packages/wasm/types.py", line 188, in from_raw
    return self.choice_field_map[choice].from_raw(ctx, raw)
KeyError: 96

Version emcc -v:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.37.18
clang version 4.0.0  (emscripten 1.37.18 : 1.37.18)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: E:\emsdk-1.35.0-portable-64bit\clang\e1.37.18_64bit
INFO:root:(Emscripten: Running sanity checks)

Decoder fails on some WASM files

Error like

  File "/usr/local/lib/python3.7/site-packages/wasm-1.2-py3.7.egg/wasm/types.py", line 302, in from_raw
    data_len, val, data_type = cur_field.from_raw(data, raw[offs:])
  File "/usr/local/lib/python3.7/site-packages/wasm-1.2-py3.7.egg/wasm/types.py", line 188, in from_raw
    return self.choice_field_map[choice].from_raw(ctx, raw)
KeyError: 105

Documentation?

This looks like it could be a very useful library for my use case, but the two very short examples provided give no insight into how I can use the module to extract functions from a .wasm file. Could you provide some kind of documentation for the module's methods, classes and class methods, etc. along with more comprehensive examples, so that we don't have to sift through the source code to figure out how to use this module?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.