Giter VIP home page Giter VIP logo

atosl-node's Introduction

atosl-node

项目使用 create-neon 构建

具体实现使用了 atosl-rs

该库仅仅是将 atosl-rs 变为可直接node调用的依赖

关于符号化

iOS 崩溃日志在线符号化

安装

必要环境配置 NodeJs && Rust.

初始化:

$ npm install

编译 atosl-node

$ npm run build

该命令使用 cargo-cp-artifact 把Rust代码打包成 ./index.node.

使用

const atosl = require('./index.node');
// type atosl.parse = (
  option: {
    file: string              //文件完整路径 ( dylib || dwarf )
    load_address: string      //起始地址
    addresses: Array<string>  //运行地址
  },
  text_segment?: boolean      // 默认false
) => {
  success: boolean, 
  data: Array<{address: string, result: string}>
  message?: string
}
const data = atosl.parse({
    file: "/Users/packy/Desktop/TestAapp.dSYM/Contents/Resources/DWARF/Flutter",
    load_address: '0x109810000',
    addresses: [
        '0x0000000109ad88b0',
    ],
});
console.log(data);
/**
成功: 
{
  success: true,
  data: [
    {
      address: 4457334960,
      result: 'GrMtlCommandBuffer::getRenderCommandEncoder(MTLRenderPassDescriptor*, GrMtlPipelineState const*, GrMtlOpsRenderPass*) (in Flutter) + 408'
    },
  ],
  message: null,
}
失败: 
{
  success: false,
  data: [],
  message: 'Unsupported file format'
}
**/

可用命令

项目根目录下:

npm install

安装项目所需依赖

npm buildnpm build-debug

从Rust源码构建Node依赖 (index.node)

Rust构建参数cargo build需要通过 npm buildnpm build-* 命令执行. 例如: cargo feature:

npm run build -- --feature=beetle

npm build-release

npm build等同, 但是执行cargo release(https://doc.rust-lang.org/cargo/reference/profiles.html#release)

项目目录

atosl-node/
├── Cargo.toml
├── README.md
├── index.node
├── package.json
├── src/
    ├── atosl.rs
    ├── demangle.rs
|   └── lib.rs
└── target/

Cargo.toml

Rust项目的配置文件

index.node

构建产物

package.json

npm的配置文件

src/

Rust源码目录

src/atosl.rs

atosl主要调用方法

src/demangle.rs

atosl util

src/lib.rs

Rust项目入口文件

target/

二进制Rust产物

相关文档

Neon documentation.

Rust documentation.

Node documentation.

atosl-node's People

Watchers

 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.