PKU-ASAL / SeeWasm

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

Reconstruct file system #77

Closed HNYuuu closed 2 years ago

HNYuuu commented 2 years ago

Current file system is not implemented well, and does not integrated with library functions. For example, the fd_close, which closes the given fd, does not actually modify the structure in states. In other words, the behavior that breaks rules, e.g., close a file twice, in source code may not be raised by our engine. Thus, we need to revise the file system, engine's option, as well as the behavior of emulated functions.

I will detail the revision plan in the following.

HNYuuu commented 2 years ago
  1. Enable --stdin <INPUT_STRING> and --sym_stdin <LENGTH_OF_STRING>, both of which have no relationship with --sym_files.
HNYuuu commented 2 years ago

I have removed all the original variables related to output buffer, and added a data structure: file_sys, in each state.

Specifically, the file_sys is a dict, whose key is each file's fd, and value is the corresponding file's information. The information is also a dict, in which it maintains the file's name, open mode, opened or not, and file content.

In write_result, I will output all files' content whose mode contain 'w'.

HNYuuu commented 2 years ago

The modification is done in pr #78