Giter VIP home page Giter VIP logo

wail's People

Contributors

iamsanjid avatar qwokka avatar rndmcnlly 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

Watchers

 avatar  avatar  avatar  avatar  avatar

wail's Issues

import parser corrupts the import table

Hello, been having an issue

let parser = new WailParser(binary);
parser.getGlobalIndex(0); //just so the import section gets parsed
parser.parse();
let output = parser.write(); //this produces the corrupt output

It seems to output 2 bytes short at the end of the table omitting the kind and type byte of the last entry (shifting the next section into the 2 bytes).
Happened on quite a big binary but was able to reproduce on a small demo one

data.zip

OP_BLOCK critical bug

Hey,
I've just noticed that OP_BLOCK in wail reads a single byte ahead, which is supposed to be the block's return type, but in fact it should be a varuint read, because whatever type follows OP_BLOCK is allowed to be one of the module type definitions. I was just working on a WASM module that had a hand-crafted block like this:

    block  ;; label = @1
      f32.const 0x1.fffe1cp-96 (;=2.52432e-29;)
      drop
    end)

That translates to [2, 128, 4, 67, 14, 255, 255, 15, 26, 11, 11]. As you can see, once WAIL reads 128, it then thinks the next opcode is 4 (OP_IF), once again it reads one byte, then the opcode it encounters is 14 (OP_BR_TABLE), and then it reads the varuint value of 245888 or so. But of course that isn't the end of problems, because then it reads 245888 more varuints, which all end up outside of the memory bounds so it keeps growing the memory and reading zeroes constantly. All this is handled by the browser perfectly, since the browser reads a varuint. It would be cool to see WAIL fix this bug to read a varuint too :)
I would assume that OP_LOOP and OP_IF have the same vulnerability.

[QUESTION] Unity game

First I would like to thank you immensely for this tool, and second I would like to ask if you have any example of game modifications made by unity. I have a problem because 90% of games are using RSA or AES to protect requests, is there any way to hook these functions?

Question: Is there any way to get the type of a function from index?

(Awesome tool first of all) I want to be able to edit/call a function without knowing originally what the target method looks like. Like the title says, is there a way I get the params/return type from a function index to help with this?
Something like?

const funcIndex = wail.getFunctionIndex(0);
const functionParams = wail.getFunctionParams(funcIndex);
const functionReturnType = wail.getFunctionReturnType(funcIndex);

Not sure if I'm making a lot of sense

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.