Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upUnreadable wasm binary encoding has advantages #1047
Comments
This comment has been minimized.
This comment has been minimized.
RyanLamansky
commented
Apr 22, 2017
|
The newest versions of Chrome are already capable of converting binary WASM into a text format. |
This comment has been minimized.
This comment has been minimized.
bobOnGitHub
commented
Apr 22, 2017
|
Are you saying I can go from (following taken from wikipedia entry ) 20 00 to int factorial(int n) { or recognizable as such using chrome as it stands ? |
This comment has been minimized.
This comment has been minimized.
RyanLamansky
commented
Apr 22, 2017
|
No, it returns the not-quite-formally-specified-yet "WAST" format described here: http://webassembly.org/docs/text-format/ .
Web Assembly is optimized for a small, easy-and-fast-to-parse binary format. It doesn't retain enough information to completely recover the original syntax. The larger and more complex the function, the less recognizable the decompilation will be. This is especially true if you look at how structs, classes, templates, and other higher-level features are handled. |
This comment has been minimized.
This comment has been minimized.
bobOnGitHub
commented
Apr 22, 2017
|
Excellent (That's the "intermediate representation" listed in the wikipedia article) - I thought you were suggesting it could already be "prettified" further - I'd prefer if it couldn't be (out-of-the-box). And I'd prefer if everything was done / not done and designed to keep it that way. (I got the impression there was a plan to ultimately be able to translate it back to reasonable pseudo code albeit without meaningful identifiers, in the browser.) |
This comment has been minimized.
This comment has been minimized.
|
Forbidding binary to some form of human-readable source isn't something that WebAssembly can forbid. Anyone can implement their own thing, however pretty / readable. The group instead concerns itself with specifying a portable, size- and load-time-efficient format suitable for compilation to the web. We're also concerned with making something usable, which is why we're specifying a low-level text format, and will likely work on debugging capabilities. It is a non-goal to guarantee any legal protection for or against decompilation, reverse engineering, or other non-technical concerns. This is left up to your own lawyers, and I urge non-lawyers to avoid speculation. We do not want to be in the business of providing legal advice. It looks like prior discussing addresses your question? I'll close, feel free to reopen or continue discussing if not. |
jfbastien
closed this
Apr 22, 2017
This comment has been minimized.
This comment has been minimized.
johnworthley
commented
Oct 26, 2018
|
Any idea on how to disassemble this .wast file to the original source code? |
bobOnGitHub commentedApr 22, 2017
•
edited
Have just looked briefly at project today and am very interested in using it in general development work.
However, if the end result means an end user running wasm in their client browser can access human readable code this is a missed opportunity.
There is no reason to provide the end user with this facility - a developer can have access to it via map files or some similar mechanism requiring the original source.
While it is impossible to deter the determined from decompiling/reverse engineering a product, any deterrent is useful to have ( if you want to give it away include the source / a link to it). If the effort/risk in stealing outweighs the cost of legally licensing. etc etc etc.
The added element of ip security in not providing readability would likely encourage wider/faster adoption (it's a complete no-brainer for me).
On the other hand, if there is no security benefit....then with.faster hw/js engines over time, switching back to C/C++ and maintaining a further expanded skill set does not look so appealing.
Please consider NOT providing a mechanism to make wasm binary encoding readable. Someone else will do it eventually anyway - in the meantime use the resources elsewhere and let us enjoy a short era of unintelligible client side code.
Bob.