All Projects → mildsunrise → Darter

mildsunrise / Darter

Licence: agpl-3.0
🕵️ Dart / Flutter VM snapshot analyzer

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Darter

Instapy Research
📄 Research repository for InstaPy
Stars: ✭ 60 (+5.26%)
Mutual labels:  jupyter-notebook, reverse-engineering
Iocamljs
An OCaml javascript kernel for the IPython notebook
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Datascience Projects
A collection of personal data science projects
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Cognitive Emotion Python
Python SDK for the Microsoft Emotion API, part of Cognitive Services
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Conf2017slides
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Vehicle Detection
Vehicle detection using machine learning and computer vision techniques for Udacity's Self-Driving Car Engineer Nanodegree.
Stars: ✭ 1,093 (+1817.54%)
Mutual labels:  jupyter-notebook
Vae protein function
Protein function prediction using a variational autoencoder
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Deep learning bootcamp
All the learning material for deep learning bootcamp can be found in this repository
Stars: ✭ 58 (+1.75%)
Mutual labels:  jupyter-notebook
Learn
🏭 Education resources for Chemical and Process Engineering written in Python
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Rbf Network
Minimal implementation of a radial basis function network.
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Carnd Advanced Lane Lines
My solution to the Udacity Self-Driving Car Engineer Nanodegree Advanced Lane Lines project.
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Learn Bioinformatics
List of resources for learning bioinformatics, from beginner to advanced
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Magenta Demos
Demonstrations of Magenta Models
Stars: ✭ 1,093 (+1817.54%)
Mutual labels:  jupyter-notebook
Dll hook Rs
Rust code to show how hooking in rust with a dll works.
Stars: ✭ 57 (+0%)
Mutual labels:  reverse-engineering
Mindspore Nlp Tutorial
Natural Language Processing Tutorial for MindSpore Users
Stars: ✭ 58 (+1.75%)
Mutual labels:  jupyter-notebook
Dmep Python Intro
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Python Crawling Tutorial
Python crawling tutorial
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Machinelearning
Stars: ✭ 57 (+0%)
Mutual labels:  jupyter-notebook
Modellogger.github.io
Model-Logger is a Python library for storing model's profile and rapid inter model comparison.
Stars: ✭ 58 (+1.75%)
Mutual labels:  jupyter-notebook
Data Science At Scale
A Pythonic introduction to methods for scaling your data science and machine learning work to larger datasets and larger models, using the tools and APIs you know and love from the PyData stack (such as numpy, pandas, and scikit-learn).
Stars: ✭ 58 (+1.75%)
Mutual labels:  jupyter-notebook

darter: Dart snapshot parser

darter is a Python module that can fully parse the data inside a Dart snapshot (i.e. the libapp.so file in a release Flutter app).

Features:

  • Parses 100% of the snapshot data, including memory structures.
  • Supports many architectures and the three snapshot types (old, AppJIT and AppAOT).
  • Usually zero-config: autodetects flags & settings from the snapshot.
  • Extracts the blobs from app.so or .snapshot files automatically.
  • Stores back-references, so you can navigate the graph easily.
  • Debugging output & strict mode controls.
  • Disassembles and analyzes the compiled code to find references to VM objects.

Examples of what you can do with the parsed info:

  • Extract string table of the application
  • Find usages of a certain object
  • Export metadata for Radare2
  • Deobfuscate a snapshot by matching it with a reference one
  • Generate call graph, library dependency graph, etc.

Note: Keep in mind that this is for parsing binary (i.e. architecture-dependent) snapshots. .dill files and some .snapshot files contain Kernel AST, which is a completely different format and currently not supported by darter. [Learn more]

How to use

Most of the code is zero-dependency, except for:

  • parse_elf_snapshot(...) requires pyelftools

  • the darter.asm module (for analyzing the assembled code) requires Capstone (and its python binding)

darter in itself is just a module, it has no stand-alone program or CLI.
The recommended way to use it is by including it in a notebook and playing with the parsed data.

Install Jupyter and open the 1-introduction notebook for a basic walkthrough of the parsed data; then head to 2-playground which contains more interesting examples of use.

It's highly recommended that you first play with a known snapshot (i.e. that you have built yourself or have the code), before analyzing the snapshot you are after.

Status

The parser is still at an early stage and will not work in every case.

  • It has been heavily tested on AppAOT Product snapshots on ARM and ARM64.
  • It has been lightly tested on AppJIT Release snapshots on x64.
  • The disassembly analysis is architecture-dependent, and currently supports ARM and ARM64.
  • The rest of the code is mostly architecture-independent, but it may not work on other architectures without some modifications.

This parser was written based on dart-sdk at 1ef83b86ae. The snapshot format is internal to the VM. It dumps some of the objects as they appear in memory; you need to know how the VM (arch, compile flags) was compiled in order to parse it. It can change frequently between versions, as there's not a standard spec (AFAIK) for the format.

Any help or donations are welcome.

Technical details

Given an data section and an instructions section (and optionally a base):

  • Parse the clusters allocation section, building the reference table.
  • Parse the clusters fill section.
  • Parse the root object.
  • Link the references between objects.
  • Parse the native structures (OneByteString, CodeSourceMap, Instructions, etc.).
  • The resulting VM objects (and cluster descriptions) are returned.

The information is returned as parsed as much as possible, so that it is easy to manipulate. Back-references are tracked too, so that it's easy to know where a certain object is referenced from.

darter can parse both 'VM' snapshots and 'isolate' ones (the ones we care about).

The darter.asm module disassembles the compiled code and analyzes it. This is crucial for AOT snapshots, because we get no high-level bytecode.

See also

If you are new to Dart / Flutter reverse-engineering, it's a good idea to read this introduction first: https://mrale.ph/dartvm/

The relevant code on snapshot serialization is at runtime/vm/clustered_snapshot.cc and runtime/vm/raw_object.h.

There's also additional info in the info directory.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].