PKU-ASAL / SeeWasm

A native symbolic execution engine for WebAssembly
39 stars 4 forks source link

Entry Not Found in Some Wasm Files #90

Closed HKJL10201 closed 1 year ago

HKJL10201 commented 1 year ago

In some Wasm modules, the function names are represented by indices, especially in Wasm files compiled by EOSIO.

For example (in .wat):

(func (;0;) (type 0) (param i32) (result i32) ... )
(func (;1;) (type 1) (param i32 i32) (result i32) ... )
...

How can I use such a function as entry? (I tried --entry func0 and --entry 0 and --entry (;0;) , etc., but failed.)

HNYuuu commented 1 year ago

This issue is fixed in #91, please use the command:

python3 launcher.py -f /Users/ningyuhe/Downloads/fib.wasm -s --entry='$func0'

, where the $func0 is the entry.

p.s. If you compile a C file with -Ox optimization, functions' name will be removed. Or if your Wasm binary is not compiled according to this site, some compatibility issue may emerge. Thus, I strongly recommend you compile C files according to the above instructions.