Mahlet-Inc / Mahlet-Inc/hobbits

Sequence alignment and binary diffing

Open
#127 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
751
Forks
49
PR merge metrics
No merged PRs in 30d

Description

My method of black-box reverse engineering of file formats almost always involves generation of similar files (i.e. with incrementally added records) and binary diffing them. I don't know any good tools for binary diffing (there are tools for binary patching, but they are different beasts, and there are tools for "binary" diffing, where "binary" means an executable format (PE/EFL/Mach-O) filled with machine code of a known arch, so CFG are matched and diffed).

So I usually do the following
1. `hd` all the files
2. split the known stuff with whitespaces
3. then diff
4. then look at boundaries and try to identify more stuff to be splitted
5. then figure out patterns and encode them in Kaitai

An example of such a preliminary analysis is https://github.com/kaitai-io/kaitai_struct_formats/pull/532/files (LTO was initially analysed the same way).

Unfortunately hexdump misses diffs because the data is fit into grid and the grid is diffed too and interferes.

So we need a binary diffing tool.

Diffing is just a sequence alignment problem, there exist lot of impls of sequence alignment, i.e. python standard library contains a one, so it is not a problem.

What is needeed is

1. the mechanism to influence sequence alignment by specifying predefined boundaries
2. the mechanism to store this kind of info
3. the gui for it
4. interoperability with Kaitai

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by surveying the repository's existing GUI and any Kaitai interoperability, then clarify how predefined alignment boundaries and stored metadata should work. Done would require a usable binary diffing interface that supports those boundaries and Kaitai interoperability.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop, reverse-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.