Giter Site home page Giter Site logo

crumblingstatue / hexerator Goto Github PK

View Code? Open in Web Editor NEW
284.0 4.0 5.0 2.05 MB

Versatile GUI hex editor focused on binary file exploration and aiding pattern recognition

Home Page: https://crumblingstatue.github.io/hexerator-book/

License: Apache License 2.0

Rust 99.91% Lua 0.09%
hex-editor reverse-engineering rust

hexerator's People

Contributors

alisajid avatar crumblingstatue avatar nilstrieb avatar rtunreal avatar supercilex avatar trumank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hexerator's Issues

Bookmarked offsets

Have a list of named bookmarks for different interesting offsets in the file

cargo build --release using latest code

stardust@MacBook-Pro ~/git-repos/hexerator (main)
$ git pull             
Already up to date.
stardust@MacBook-Pro ~/git-repos/hexerator (main)
$ cargo build --release
   Compiling hexerator v0.1.0 (/Users/stardust/git-repos/hexerator)
error[E0308]: mismatched types
   --> src/app.rs:544:10
    |
537 |     pub(crate) fn load_proc_memory(
    |                   ---------------- implicitly returns `()` as its body has no tail or `return` expression
...
544 |     ) -> anyhow::Result<()> {
    |          ^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
    |
    = note:   expected enum `Result<(), anyhow::Error>`
            found unit type `()`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `hexerator` due to previous error
stardust@MacBook-Pro ~/git-repos/hexerator (main)
$ rustc --version
rustc 1.65.0-nightly (95a992a68 2022-09-16)

Meta diff

Diff with saved metafile of current meta path.
Useful to know what's changed.
Add option to revert each change, etc.

mmap support

My current idea is to have an immutable mmap with "change buffers" that hold the changes, and can grow, etc, as changes are made.
Then on save, we temporarily make the mmap mutable and write the change buffers.

multibuffer support

For example, being able to open two files and diff between their regions, etc. Switch buffers while keeping same view configuration to look at what changed, etc.

Scripting language exploration

  • Lua (current)
    • Only has a single numeric type. Not the most ideal for byte manipulation.
  • Rhai
    • Slower than Lua
    • Has i64 system integer type, but other types are exposed as "custom" types, and working with them is both harder and slower than i64
  • Wasm (wasmtime?)
    • Would probably be as fast, or even faster than Lua
    • Couldn't edit/compile inside hexerator. Major disadvantage.

Ideal candidate would:

  • Support all rust primitives (i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, etc.)
  • Be about as fast, or faster than Lua
  • Optionally, could be fed a byte slice as argument, without having to clone the data

Web version

Eventually, it should be possible to have a version of Hexerator built for the web, and host it on a webpage.

Process memory editing and a few other features will be disabled, but the rest should work, including opening files and saving them back.

Add Continuous integration

I have a pretty decent CI System built in my tool repo. The actual tool is pretty simple but I have a few things running that:

  1. Run a few pre-commit hooks before I commit
  2. Ensure that the commit messages conform to the Conventional Commit standard
  3. Runs a matrix build across four rust toolchains across three operating systems (linux, windows, macos)
  4. Runs the Semantic Release action to see if a new release is needed and if yes, which version marker to bump
  5. Creates a new release if necessary.
  6. Runs a build across the three operating systems and then uploads build artifacts to the release page.

I'd be happy to implement that in this in here.

Change nightly policy

I don't see Hexerator switching away from nightly for the foreseeable future.
I think it's nice to have a big and complex application push Rust to its limits, and I don't like not being able to do something that's possible with a nightly feature.
So the new nightly policy is:
Hexerator relies on latest Rust nightly indefinitely.

Contributors however are free to rewrite code to use stable features if it doesn't result in:

  • A loss of features
  • Reduced performance
  • Significantly worse maintainability

Compilation error on macOS.

I get (cargo build --release):

The following warnings were emitted during compilation:

warning: CSFML/src/System/Clock.cpp:1:10: fatal error: 'SFML/System/Clock.hpp' file not found
warning: #include <SFML/System/Clock.hpp>
warning:          ^~~~~~~~~~~~~~~~~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `sfml v0.20.0`

Can you check for sfml?

Built-in process editing

  • Getting process list
  • Opening process memory
  • Get the memory mappings for the process
  • Be able to seek to all mapped memory

Port to winit and wgpu

Advantages:

  • Can be built without having to mess with dylibs and environment variables
  • Hexerator could be published to crates.io to be installable with cargo install
  • Better control over graphics rendering and window creation
  • Easier to set up CI without having to install SFML

Stable metadata format

The metadata format needs to be stable and not break between releases.

It would be very inconvenient if the project someone worked hard on for weeks, reverse engineering some unknown format got destroyed by a Hexerator upgrade.

For serious use, the metadata format will need to be stable.

Jump not working when inside a process

Jump inside ctrl+J and bookmark menu (hyperlink and button) are not working inside a process. Ctrl+J jump sets the cursor to 0, bookmark menu buttons do nothing at all. Region goto hyperlinks work, and so do the ones inside the find menu.

Hexerator is being run with sudo. Nothing reported inside debug panel.

All of them work in a typical file.

Built today with rust nightly, would be great to have this functionality! Not sure if it's just my machine.

Pasting from clipboard on a new and empty session crashes. (+ smart paste?)

Regarding the crash:
Let's say that I have this in my clipboard (as a string): 20 00 62 75 69 6C, I open Hexerator (a new session) and i go Edit > Paste at cursor > Hex text from clipboard then boom, panic:
image
As I often inspect hex from my clipboard (as I get it as output from my program) I would like to be able to directly paste it on a new session to inspect it.

Regarding 'smart paste':
Doing println!("{:02X?}", data); (where data is an Vec<u8> for example, it outputs in the console this string: [20, 00, 62, 75, 69, 6C], and I want to copy and paste it in the program (let's say without the ending square brackets (so my clipboard now is 20, 00, 62, 75, 69, 6C), i get this error:
image
... which is understandable as the string contains commas, but annoying as I have to get rid of all my commas to paste it in. Which is also a bit annoying as I apparently can't just CTRL + V to paste it.

Proper scrolling

The view position currently is solely based on a byte offset, but this isn't correct for all purposes.

Ideally the user should be able to

  • Scroll left before the first column
  • Scroll right after the last column
  • At what offset the view begins should be a different property

Compilation Issues with latest nightly

Thanks for writing this tool!

Since I had some issues while trying to compile hexerator with the latest Rust version I'd like to suggest that instead of writing just channel=nightly to the rust-toolchain.toml each commit or each realease should come with a specific nightly-date version that's able to compile correcty.

For example with Rust nightly-2022-11-07 I cannot compile hexerator 0.1.0 due to rust-lang/rust#93050

I pinned the Rust version to nightly-2022-09-15 and it works but I had to manually fix package builds
https://aur.archlinux.org/packages/hexerator

Views

Views are configurable views of regions (#2). For example you can set column count for a view for aligning data nicely.

Investigate support for WASM modules

Could be cool to support loading wasm modules for parsing binary data, like custom Rust programs that parse data and then add them as regions.

Right now I'm working on a .wz file parser for example, would be cool to be able to test it using Hexerator.

add help->about

  • version info
  • link to git repo
  • link to discussions forum
  • link to hexerator book

Named regions

Have a list named bookmarks for different regions in the file.
For example one region in a game save file could contain item data, another could contain progression data.
Perhaps bookmarks (#1) could be just regions with a size of 1.

mmap thoughts

If it's possible to safely write back cowed regions: The changed regions must be written back exactly to avoid undefined behavior. So damage ranges should never cover more than they changed. No merging of damaged ranges with unchanged data inbetween. It should however be possible to merge ranges that are exactly next to each other, like when editing bytes one after another.

If it turns out it's necessary to copy changes to memory buffers separate from cow before saving, keep track of memory that would be needed, and warn user if memory needed would be too great to safely save.

address language

Used for example when entering an offset to jump to

  • Autodetect hex if it contains non-decimal characters
  • Allow explicit hex with 0x...

Transition to stable Rust version

It's much easier to get packaged in distributions, etc, if we use a stable Rust version.
This is a long term goal, for now nightly features are considered useful for speeding up development.

hold alt for overlays

When alt is held, show names of views as overlays over the views, as well as potentially show region names, etc.

Allow restoring individual meta attributes

Like restore regions, perspectives, etc, individually, instead of restoring whole metafile.
Useful for experimentation, while saving only the useful results of the experimentation.

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.