Git Product home page Git Product logo

eat-'s Introduction

功能介绍

my_loader.cpp实现了解析.wasm二进制文件,目前能够做到将类型段,函数段以及代码段解析出来,并存入相应的数据结构。

主要数据结构

WASMType

LocalVars

WASMFuntion

WASMModule

section_listnode

主要函数

static int read_leb_u32(char** p)

static bool check_magic_number_and_version(char** p)

static bool create_section_list(const char** p, int *size*, section_listnode* section_list)

static void load_type_section(const char* p, WASMModule* module)

static void load_func_section(const char* p, WASMModule* module, const char* p_code)

static void load_from_sections(WASMModule* module, section_listnode* section_list)

static WASMModule* load(char** p, int size)

int main() 函数入口

与之前实现的区别

  • 简化了module的数据结构,使之结构更加清晰,移除了结构体内不必要的成员变量,减少了内存消耗
  • 相当多的安全性验证没有实现
  • 内存泄漏问题(2021.3.31已修复)

接下来的目标

  • 实现对其他section的解析
  • 增加安全校验
  • 解决内存泄漏问题(2021.3.31已修复)
  • 完善代码注释

eat-'s People

Contributors

ignorancer avatar hungrymegumin avatar yxlzj avatar xiafanglongfei avatar

Watchers

James Cloos avatar

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.