encounter / objdiff

A local diffing tool for decompilation projects
Apache License 2.0
79 stars 13 forks source link

Split CLI & GUI, alternative output formats #11

Open encounter opened 1 year ago

encounter commented 1 year ago

For integration into other tools, objdiff could have different output formats like asm-differ:

Having it be usable as a one-shot CLI app will permit integration with decomp.me.

NickCondron commented 1 year ago

The first step to accomplishing this is to segregate the core functionality from the GUI functionality. Then you can reuse the core functionality for the GUI & CLI. I think there is some work to be done in this area. For example, one thing I noticed are the idx fields for coloring in different structs like obj::ObjInsArgDiff that should probably be moved to GUI-specific code.

The convention I've seen in some projects is to have a top-level Cargo.toml that defines a virtual manifest and then you put any binary and library crates in some subfolder (eg. crates/*). See also discussion here https://matklad.github.io/2021/08/22/large-rust-workspaces.html#Large-Rust-Workspaces

I'm still familiarizing myself with the code base, so I'm curious how well-separated you think the code is?

encounter commented 1 year ago

Agreed on the objdiff-core approach. The existing code should be easy to separate, it’s already abstracted to support the threaded “job” system.

The idx fields aren’t necessarily GUI specific, they’re precalculated so that work doesn’t have to be done every frame.