diff options
author | bloodstalker <thabogre@gmail.com> | 2018-10-04 20:50:16 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-10-04 20:50:16 +0000 |
commit | 08b4f01e716b4bfc079861f5b3091fbcc943d67a (patch) | |
tree | 5a4fe8235eca07b866684d021fbba4442b48c843 | |
parent | wip, testing the wasm setters. most of them are working now. (diff) | |
download | mutator-08b4f01e716b4bfc079861f5b3091fbcc943d67a.tar.gz mutator-08b4f01e716b4bfc079861f5b3091fbcc943d67a.zip |
more bug fixes
-rw-r--r-- | bruiser/autogen/wasm/wasm.xml | 6 | ||||
-rw-r--r-- | bruiser/lua-scripts/wasmtest.lua | 17 |
2 files changed, 12 insertions, 11 deletions
diff --git a/bruiser/autogen/wasm/wasm.xml b/bruiser/autogen/wasm/wasm.xml index 81299a0..db68ed7 100644 --- a/bruiser/autogen/wasm/wasm.xml +++ b/bruiser/autogen/wasm/wasm.xml @@ -105,10 +105,10 @@ <Resizable_Limit name="resizable_limit_t" isaggregate="true" luatype="lightuserdata"> <Flags name="flags" encoding="leb128u" type="uint8" count="1" luatype="integer"></Flags> <Initial name="initial" encoding="leb128u" type="uint32" count="1" luatype="integer"></Initial> - <Maximum name="maximum" encoding="leb128u" type="uint32" count="1" luatype="integer"></Maximum> + <Maximum name="maximum" encoding="leb128u" type="uint32" count="self::Flags" luatype="integer"></Maximum> </Resizable_Limit> <Global_Type name="global_type_t" isaggregate="true" luatype="lightuserdata"> - <Value_Type name="value_type" type="uint32" count="1" luatype="integer"></Value_Type> + <Value_Type name="value_type" type="uint8" count="1" luatype="integer"></Value_Type> <Mutability name="mutability" encoding="leb128u" type="uint8" count="1" luatype="integer"></Mutability> </Global_Type> <Table_Type name="table_type_t" isaggregate="true" luatype="lightuserdata"> @@ -156,7 +156,7 @@ </Element_Segment> <Local_Entry name="W_Local_Entry" isaggregate="true" luatype="lightuserdata"> <Count name="count" encoding="leb128u" type="uint32" count="1" luatype="integer"/> - <Type name="type" encoding="leb128u" type="uint16" count="self::Count" luatype="lightuserdata"/> + <Type name="type" encoding="leb128u" type="uint16" count="1" luatype="integer"/> </Local_Entry> <Function_Body name="W_Function_Body" isaggregate="true" luatype="lightuserdata"> <Body_size name="body_size" encoding="leb128u" type="uint32" count="1" luatype="integer"/> diff --git a/bruiser/lua-scripts/wasmtest.lua b/bruiser/lua-scripts/wasmtest.lua index 50b753a..f005448 100644 --- a/bruiser/lua-scripts/wasmtest.lua +++ b/bruiser/lua-scripts/wasmtest.lua @@ -40,7 +40,7 @@ function libwasm.dump_import_section(a) io.write("field len:"..v:field_len().."\t") io.write("field str:"..v:field_str().."\t") io.write("kind:"..v:kind().."\t") - io.write("type:"..v:type().."\n") + io.write("kind:"..type(v:type()).."\t") end else print(colors("%{red}".."section doesnt exist.")) @@ -198,10 +198,10 @@ function libwasm.dump_code_section(a) io.write(colors("\n%{cyan}".."entry:\n")) io.write("body_size:"..v:body_size().."\t") io.write("local_count:"..v:local_count().."\t") - io.write(tostring(v:locals()).."\t") + io.write(tostring(v:locals()).."\n") for i, j in pairs(v:locals()) do io.write("locals count:"..j:count().."\t") - io.write("locals type:"..j:type().."\t") + io.write("locals type:"..j:type().."\n") end io.write("function body:\n") for i,j in pairs(v:code()) do @@ -247,8 +247,8 @@ end function libwasm.dump_all(wasm_path) local a = getwasmobj(wasm_path) - libwasm.dump_import_section(a) libwasm.dump_type_section(a) + libwasm.dump_import_section(a) libwasm.dump_function_section(a) libwasm.dump_table_section(a) libwasm.dump_memory_section(a) @@ -272,8 +272,8 @@ function libwasm.demo_getters(wasm_path) for k, v in pairs(a) do print(k, v, type(k), type(v)) end - libwasm.dump_import_section(a) libwasm.dump_type_section(a) + libwasm.dump_import_section(a) libwasm.dump_function_section(a) libwasm.dump_table_section(a) libwasm.dump_memory_section(a) @@ -1010,7 +1010,7 @@ function libwasm.demo_setters(wasm_path) body1:set_code({12,13,11}) body2:set_code({12,13,11}) body3:set_code({12,13,11}) - --body1:set_locals(l_entry1) + body1:set_locals(l_entry1) --body2:set_locals(l_entry2) --body3:set_locals(l_entry3) local new_bodies = {} @@ -1018,7 +1018,7 @@ function libwasm.demo_setters(wasm_path) new_bodies[2] = body2 new_bodies[3] = body3 - a["code_section"]:set_count(pre) + a["code_section"]:set_count(5) pre = a["code_section"]:bodies() a["code_section"]:set_count(3) a["code_section"]:set_bodies(new_bodies) @@ -1132,7 +1132,8 @@ end --libwasm.dev("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") --libwasm.demo_getters("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") -libwasm.demo_setters("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") +libwasm.demo_getters("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/aggregate.wasm") +--libwasm.demo_setters("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") --libwasm.dump_all("/home/bloodstalker/devi/hell2/bruiser/autogen/wasm/ft/test.wasm") return libwasm |