Giter VIP home page Giter VIP logo

fhex's Introduction

Fhex - A Full-Featured HexEditor

This project is born with the aim to develop a lightweight, but useful tool. The reason is that the existing hex editors have some different limitations (e.g. too many dependencies, missing hex coloring features, etc.).

screenshot screenshot2 screenshot3

This project is based on qhexedit2, capstone and keystone engines. New features could be added in the future, PRs are welcomed.

Features

  • Chunks loader - Used to load only a portion of large files without exhaust the memory (use alt + left/right arrows to move among chunks). Please note that in chunk mode, all the operations (e.g. search) applies only to the current chunk except for file save (the entire file is saved). However, each time you edit a chunk, save it before to move to another chunk, otherwise you will lose your changes.
  • Search and replace (UTF-8, HEX, regex, reverse search supported) [CTRL + F]
  • Colored output (white spaces, ASCII characters, 0xFF, UTF-8 and NULL bytes have different colors)
  • Interpret selected bytes as integer, long, unsigned long [CTRL + B]
  • Copy & Paste [CTRL + C and CTRL + V]
  • Copy selected unicode characters [CTRL + Space]
  • Zeroing all the selected bytes [Delete or CTRL + D]
  • Undo & Redo [CTRL + Z and CTRL + Y]
  • Drag & Drop (Hint: Drag&Drop two files to diff them)
  • Overwrite the same file or create a new one [CTRL + S]
  • Goto offset [CTRL + G]
  • Insert mode supported in order to insert new bytes instead to overwrite the existing one [INS]
  • Create new instances [CTRL + N]
  • Basic text viewer for the selected text [CTRL + T]
  • Reload the current file [F5]
  • Compare two different files at byte level
  • Browsable Binary Chart (see later for details) [F1]
  • Hex - Dec number converter [F2]
  • Hex String escaper (e.g from 010203 to \x01\x02\x03) [F3]
  • Pattern Matching Engine (see later for details)
  • Disassebler based on Capstone Engine [F4]
  • Assembler based on Keystone Engine [F4]
  • Zoom-Out/Zoom-In bytes view (CTRL + Up/Down or CTRL + -/+)
  • Shortcuts for all these features

Pattern Matching Engine

Fhex can load at startup a configuration file (from ~/fhex/config.json) in JSON format with a list of strings or bytes to highlight and a comment/label to add close to the matches.

Examples:

{
    "PatternMatching":
    [
        {
            "string" : "://www.",
            "color" : "rgba(250,200,200,50)",
            "message" : "Found url"
        },
        {
            "bytes" : "414243",
            "color" : "rgba(250,200,200,50)",
            "message" : "Found ABC"
        }
    ]
}

To activate pattern matching press CTRL + P At the end, Fhex will show also an offset list with all the result references. Note: Labels with comments are added only if the window is maximized, if labels are not displayed correctly please try to run pattern matching again.

Binary Chart

Fhex has the feature to chart the loaded binary file (Note: In order to compile the project, now you need also qt5-charts installed on the system). The y-axis range is between 0 and 255 (in hex 0x0 and 0xff, i.e. the byte values). The x-axis range is between 0 and the filesize.

The chart plots the byte values of the binary file and let you focus only on the relevant sections. For example, if in a binary file there is an area full of null bytes, you can easily detect it from the chart.

Compilation

The project has the following dependences: qt5-charts (package: libqt5charts5-dev in debian/ubuntu), capstone (optional) and keystone (optional). On linux you can check if you have the mandatory library with ldconfig -p | grep -i qt5charts

Fhex by default is compiled with the MINIMAL profile, this means it doesn't include capstone and keystone. You can change this option removing the related line from fhex.pro.

In order to build Fhex on linux execute these commands:

mkdir build
cd build
qmake ..
make -j$(nproc)

License

GPL-3

fhex's People

Contributors

echo-devim avatar tpxp 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fhex's Issues

Add color customization

Black zeros on black background are not really that well visible, it would be nice to have an option to pick some colors.

Question about matching

I'm trying to highlight the start of a NAL in H.264 using config.json. Startcode is either 3 or 4 bytes long

00 00 00 01
or
00 00 01

Can't get it to work though. I have found many ways to have the tool segfault on me though

$ ./Fhex_Linux_x64_2.4_qt5.9.6_static_libs ~/static.264 
Exception occurred while parsing json configuration file:
[json.exception.parse_error.101] parse error at line 15, column 16: syntax error while parsing value - invalid string: forbidden character after backslash; last read: '"\x'
QLayout: Attempting to add QLayout "" to QFrame "", which already has a layout
QLayout: Attempting to add QLayout "" to QFrame "", which already has a layout
terminate called after throwing an instance of 'nlohmann::detail::type_error'
  what():  [json.exception.type_error.302] type must be string, but is null
Aborted (core dumped)

How can I match the 3-4 byte pattern using config.json?

If possible include libQt5Charts.so.5 with static libs build

Ubuntu 20.04 when I try to execute fhex I get "./fhex: error while loading shared libraries: libQt5Charts.so.5: cannot open shared object file: No such file or directory", I can sudo apt get install but as you provide a compiled version would it be possible to include the missing lib?

Thank you.
image

Updated static Windows build

This isn't an issue, but if possible would you provide an updated v2.4 static Windows binary release. Thanks!

Save window position & size - feature request

It would be great if the application saved window size and possibly it's screen position in a ~/.fhex file. It would also be great if Pattern Matching Engine allowed to specify from the UI menubar the config.json file path instead of using the hardcoded ~/fhex/ (the last opened config.json could be saved in the ~/.fhex file). Thank you.

Highlight the selected byte in the other column

Hello, and thanks a lot for this f****ng cool editor.

It would be super helpful if the currently selected byte could be shown in the right column (when selecting an hex value) and the other way round. It helps finding strings the file (and the data in between). Perhaps changing the background, or adding a border?

Here is what it looks like in FrHed (please do something more stylish ๐Ÿ™)
frhed

Oh, also, could you provide a Windows build for the latest version? Installing all the QT stuff on Windows is sooo long. ๐Ÿ˜ด

I also noticed you didn't add an about screen, you deserve it! ๐Ÿ˜‰

macOS release?

Hey,

is there any prebuild pkg for macOS or instructions to build it?

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.