killvxk / afl-wasm Goto Github PK
View Code? Open in Web Editor NEWThis project forked from dwfault/afl-wasm
forked from afl http://lcamtuf.coredump.cx/afl/
This project forked from dwfault/afl-wasm
forked from afl http://lcamtuf.coredump.cx/afl/
``` var importObject = { env: { print_number: function (number) { print('[+] importObject callback.'); print(number); } } }; var wasmCode = new Uint8Array([0x0, 0x61, 0x73, 0x6d, 0x1, 0x0, 0x0, 0x0, 0x1, 0x7, 0x1, 0x60, 0x2, 0x7f, 0x7f, 0x1, 0x7f, 0x3, 0x2, 0x1, 0x0, 0x4, 0x4, 0x1, 0x70, 0x0, 0x4, 0x6, 0x2e, 0x5, 0x7f, 0x0, 0x41, 0x2a, 0xb, 0x7d, 0x0, 0x43, 0x0, 0x0, 0x0, 0x3f, 0xb, 0x7c, 0x0, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0, 0x3f, 0xb, 0x7d, 0x0, 0x43, 0x0, 0x0, 0xc0, 0x7f, 0xb, 0x7c, 0x0, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xb, 0x7, 0x40, 0x7, 0x5, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x1, 0x0, 0x3, 0x73, 0x75, 0x6d, 0x0, 0x0, 0x6, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x3, 0x0, 0x7, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x31, 0x3, 0x1, 0x7, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x32, 0x3, 0x2, 0x7, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x33, 0x3, 0x3, 0x7, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x34, 0x3, 0x4, 0x9, 0x7, 0x1, 0x0, 0x41, 0x0, 0xb, 0x1, 0x0, 0xa, 0x9, 0x1, 0x7, 0x0, 0x20, 0x1, 0x20, 0x0, 0x6a, 0xb]); //var wasmCode = new Uint8Array([0x0, 0x61, 0x73, 0x6d, 0x1, 0x0, 0x0, 0x0, 0x1, 0x8, 0x2, 0x60, 0x1, 0x7f, 0x0, 0x60, 0x0, 0x0, 0x2, 0x19, 0x1, 0x7, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0xd, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x0, 0x0, 0x3, 0x2, 0x1, 0x1, 0x7, 0x11, 0x1, 0xd, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x0, 0x1, 0xa, 0x8, 0x1, 0x6, 0x0, 0x41, 0x12, 0x10, 0x0, 0xb]); ///////////////////////////////////////////////////////////////////////////INIT try { var wasmModule = new WebAssembly.Module(wasmCode); var wasmInstance = new WebAssembly.Instance(wasmModule, importObject); print('[+] wasmCode validate.'); print(WebAssembly.validate(wasmCode)); } catch (e) { print(e); } ///////////////////////////////////////////////////////////////////////////EXPORTS try { var wasmInstanceExported = wasmInstance.exports; print('[+] wasmInstanceExported.'); try { var wasmInstanceExportedTable = wasmInstance.exports.table; for (var i = 0; i < 100; i++) { print(wasmInstanceExportedTable.get(i)); } } catch (e) { print(e); } try { print(wasmInstanceExported.main(0)); } catch (e) { print(e); } try { for (var i in wasmInstanceExported) { try { print(eval('wasmInstanceExported.' + i + ';')); } catch (e) { print(e); } try { print(eval('wasmInstanceExported.' + i + '(0);')); } catch (e) { print(e); } } } catch (e) { print(e); } var wasmModuleExports = WebAssembly.Module.exports(wasmModule); var varExports = []; print('[+] wasmModuleExported.') for (var i of wasmModuleExports) { print(i + ' : ' + i.kind + ' : ' + i.name); varExports.push(i.name); } for (var i of varExports) { try { print(eval('wasmInstanceExported.' + i + ';')); } catch (e) { print(e); } try { print(eval('wasmInstanceExported.' + i + '(0);')); } catch (e) { print(e); } } } catch (e) { print(e) }; ///////////////////////////////////////////////////////////////////////////IMPORTS try { var wasmModuleImports = WebAssembly.Module.imports(wasmModule); var varImports = []; print('[+] wasmModuleImported.') for (var i of wasmModuleImports) { print(i + ' : ' + i.kind + ' : ' + i.name + ' : ' + i.module); varImports.push(i.name); } } catch (e) { print(e) }; /////////////////////////////////////////////////////////////////////////MEMORY try { var wasmMemory = wasmInstance.exports.memory; print('[+] wasmMemory.'); print(wasmMemory); print(wasmMemory instanceof WebAssembly.Memory); } catch (e) { print(e); } //////////////////////////////////////////////////////////////////////// print('[+] End.'); ```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.