Commit Graph

79 Commits

Author SHA1 Message Date
WerWolv 808b051a3e sys: Fixed sockets compiling on MacOS 2021-12-07 23:21:07 +01:00
WerWolv c55146a78c sys: Fix sockets compiling on Unix 2021-12-07 23:09:30 +01:00
WerWolv cc5a437573 provider: Added basic GDB Server provider 2021-12-07 22:47:57 +01:00
WerWolv 4a53717676 sys: Moved all views to builtin plugin 2021-12-07 22:47:41 +01:00
WerWolv a000b1a2fe common: Added missing include 2021-12-03 00:00:25 +01:00
RADICS Áron 467e9d1463
Tests for the CRC and hash algorithms (#335)
* Update TEST_ASSERT to do nothing if condition is true

The TEST_ASSERT should not return if the condition is true, because:
- it prevents the usage of multiple TEST_ASSERT in a single test case,
- that behavior differs from how the assert in the standard library
works, and thus may give unexpected results.

Make the TEST_ASSERT to print an error message (with an formatted
optional user part) when it fails to make debugging easier.

* Fix some bugs in TestProvider, add unit tests

Use pointer-to-vector in TestProvider so writes can be tested, too.

* Add test EncodeDecode16, fix some encode16 bugs

The function mbedtls_mpi_write_string needs a bit longer buffer than the
resulting string actually will be.

Known bug: mbedtls_mpi_read_binary ingores initial null bytes

* Add test EncodeDecode64, fix some bugs

The functions mbedtls_base64_encode and mbedtls_base64_decode needs a
bit longer buffer than the resulting string actually will be.

* Remove check for empty data from TestProvider

It can be valid to get the hash of empty string.

* Add tests for CRC calculation

Two type of thests:
- compare the result of the CRC calculation to a known to be good
results,
- generate random data as message, calculate of it's CRC and append that
to the message, the CRC of this new data should be 0.

* Add test for hash algorithms

* Add includes in tests

* Remove the use of C++20 ranges

It seems that Apple Clang does not support range-based constrained
algorithms at this time.

* Replace encode16 implementation

To encode the zero bytes at the begining of the input vector, too.
2021-11-26 22:14:44 +01:00
WerWolv 673d43b526 sys: Fixed copy-paste error 2021-10-31 16:36:45 +01:00
WerWolv c88053a575 windows: Added context menu entry option
Closes #333
2021-10-31 16:28:10 +01:00
RADICS Áron a6b8597f5a
Fix CRC and hash calculations (#321)
* Fix CRC calculation, add more CRC parameters

Use the Boost CRC module to calculate the CRC values.
Add options for final xor value, reflectIn and reflectOut.
Fixes #320

* Cleanup Hash view combo box, add CRC8

* Use offset/size consistently

* Cleanup: unify processing data by chunks

* Change CRC algorithm back, drop boost dependency

This is mostly the original algorithm, with a few fixes and small
additions (support for reflect In / Out, final XOR value).

* Use size_t for file read size consistently
2021-10-26 17:21:48 +02:00
Kuruyia 72ec6baf79
sys: Fix macOS compilation (as of 2dc1886) (#317)
* sys: Updated curl to latest version

* sys: Fix macOS compilation

* ui: Fix splash screen OpenGL init for macOS

* sys: Fix std::min compile errors

* git: Re-enabled macos workflow

* sys: Remove includes of the range library

* build: Find OpenGL using CMake

* sys/build: Fix bundled plugins on macOS

* build: Copy plugins to bundle when creating a bundle

* build: Fixup bundled plugins

* sys: Search for plugins in the bundle instead of in Application Support

* sys: Allow resources to be placed in multiple directories on macOS

* build: Output built plugins to the plugins/ directory when not creating a bundle on macOS

* sys: Fix Application Support paths on macOS

* sys: Define ftruncate64 on macOS

* sys: Fix absolute value computation for std::string::at on macOS

Co-authored-by: WerWolv <werwolv98@gmail.com>
2021-10-09 23:07:58 +02:00
WerWolv a67263fa27 patterns: Added basic file i/o functions 2021-10-07 14:49:49 +02:00
WerWolv 044e65eb20 sys: Fixed non-existing files being created in Read mode 2021-10-05 18:47:10 +02:00
WerWolv 545604da63 sys: Fixed reading empty file as string crashing 2021-10-05 18:46:57 +02:00
WerWolv 5db608c3fc ui: Fixed automatic pattern loading, added better pattern browse popup 2021-09-26 21:18:25 +02:00
WerWolv e57481b87c tools: Added file shredder, splitter and combiner 2021-09-22 17:56:06 +02:00
WerWolv 26a0352851 tests: Fixed unit test compiling 2021-09-21 02:48:41 +02:00
WerWolv 8631cb0c2a sys: Allow multiple files to be loaded simultaneously 2021-09-21 02:29:54 +02:00
WerWolv d3fb00d441 sys: Allow resources to be placed in appdata on windows 2021-09-13 23:55:50 +02:00
WerWolv ea2d181741 utils: Fix file wrapper 2021-09-12 20:29:05 +02:00
WerWolv 8396e40fa0 tests: Added initial test structure 2021-09-11 14:41:18 +02:00
WerWolv b3d102419b sys: Fixed opening custom protocols in the web browser 2021-09-10 21:42:35 +02:00
WerWolv f0697679f4 sys: Add local search for plugins and resources on Linux 2021-09-10 15:30:49 +02:00
WerWolv a8c9e96b72 fix: Inverted logic when checking for libmagic error 2021-09-09 01:56:48 +02:00
WerWolv e74c0f5cf5 sys: Tons of long overdue cleanup
- std::string -> const std::string& where needed
- Added a FileIO abstraction class
- Fixed recent files not updating
- Removed localization file from global include
- Renamed lang to pattern_language/pl
- Renamed EventFileDropped to RequestFileOpen
2021-09-08 15:18:24 +02:00
WerWolv 6879cf765f sys: Cleanup libmagic mess 2021-09-06 16:15:05 +02:00
WerWolv 4b40546750 views: Add simple pattern, library and magics store 2021-09-03 02:34:40 +02:00
WerWolv 68d72eac16 sys: Move imhex path resolution away from utils 2021-09-03 02:33:15 +02:00
WerWolv 82cb7917e4 ui: Added half floats to data inspector 2021-09-01 00:23:45 +02:00
WerWolv 5f63db4a34 ui: Add first unifont plane by default 2021-08-31 15:22:00 +02:00
WerWolv 32eddbf581 ui: Fix wide characters and utf-8 display in inspector 2021-08-30 19:12:46 +02:00
WerWolv 633fa7213a sys: More compile time improvements 2021-08-29 22:15:18 +02:00
WerWolv 02d31d2d2a sys: First attempt at reducing build times 2021-08-29 14:18:45 +02:00
WerWolv 3138d2c4a2 tools: Added Anonfiles uploader 2021-08-28 00:45:59 +02:00
WerWolv d3a227d0bc sys: Fixed open webpage command, added run command 2021-08-22 21:43:31 +02:00
WerWolv 66f94a452d net: Fix SSL verification with curl
This fixes update detection
2021-08-22 20:22:46 +02:00
WerWolv 37d2d58d2f ui: Added toolbar 2021-08-21 00:52:11 +02:00
WerWolv a53cfaa63a sys: Make crypto wrapper compatible with mbedtls 2 and 3 2021-08-17 17:28:33 +02:00
WerWolv e8d77f8269 sys: Embed resources into rodata 2021-07-31 17:10:19 +02:00
WerWolv 35c7f826bc views: Added constants search view 2021-06-26 01:18:33 +02:00
Foster Brereton ac53b4bcab
Add rpath to binary executable on macOS (#258)
* removing superfluous slash from paths

* Add a necessary rpath to the imhex binary

* add a little error handling to dlopen

* fall back on en-US if no language specified in prefs

* PR changes as per @WerWolv
2021-06-18 20:09:36 +02:00
WerWolv ee2b412a10 nodes: Added primitive saving and loading mechanism
Not fully integrated yet. Also doesn't yet save any node settings, just nodes and links
2021-05-17 23:17:58 +02:00
WerWolv 1f2fe6b93d sys: Merge splash screen and ImHex into one application
This fixes so many issues the previous implementation had, especially on Unix
2021-04-20 21:46:48 +02:00
WerWolv ebbbcafe5c
sys: Implement more functionality into splash screen (#223)
* build: Add libcurl

* build: Stop the whole static linking on Windows mess. There's no use anymore

* sys: Added update detector and moved some startup tasks to splash screen

* sys: Updated ImHex icon

* fix: Settings button on welcome page once again works

* build: Fix build on Linux

* sys: Fixed splash window not searching all paths for resources
2021-04-18 20:24:42 +02:00
WerWolv 8a485575f5 ui: Added recent files to File menu 2021-04-13 08:41:59 +02:00
WerWolv 907f25c231 patterns: Added `parent` keyword to access members of the parent struct 2021-04-12 20:49:37 +02:00
WerWolv d805d976a6 sys: Replace the terrible event manager with a much better one 2021-03-27 11:36:36 +01:00
WerWolv ef747cc4c0 sys: Explicitly delete views so destructors get called properly 2021-03-16 22:44:37 +01:00
WerWolv 188723e888 sys: Replace printf formatting with libfmt 2021-03-03 19:58:22 +01:00
WerWolv f1c03f8b1d sys: Place config files in AppData/Local/imhex folder on Windows
Fixes #182
2021-03-02 10:20:29 +01:00
WerWolv 3e6865ffa9
sys/build: Properly support per-system metadata file paths (#181)
* sys: Move away from metadata paths next to executable in the application

Build system doesn't properly install / pack stuff yet

* build: Updated README to contain better install instructions

* sys: Search for imhex resource files in ~/Application Support

* sys: MAX_PATH -> PATH_MAX

* sys: Seach for imhex resource files in Application Support using NSFileManager (#180)

* sys: Allow for multiple file search paths

Also use install prefix instead of just /usr on Linux

* build: Fixed IMHEX_INSTALL_PREFIX macro definition

* build: Fix duplicate switch entry on Linux

* docs: Updated readme to properly reflect new paths and dependencies

* sys: Install files in their proper paths on linux (#183)

* Install files in their proper paths on linux

* Only create user directories

* Follow the XDG specification on linux

XDG specification specifies how to find config and data directories on
linux systems. Specifically, it says this:

- Data should be written to $XDG_DATA_HOME
- Config should be written to $XDG_CONFIG_HOME
- Data should be read from $XDG_DATA_HOME:$XDG_DATA_DIRS
- Config should be read from $XDG_CONFIG_HOME:$XDG_CONFIG_DIRS

The default values are this:

- XDG_DATA_HOME: $HOME/.local/share
- XDG_CONFIG_HOME: $HOME/.config
- XDG_DATA_DIRS: /usr/share:/usr/local/share
- XDG_CONFIG_DIRS: /etc/xdg

Platforms with non-standard filesystems (like NixOS) will correctly set
up those environment variables, allowing softwares to work unmodified.

In order to make integration as simple as possible, we use a simple
header-only dependency called XDGPP which does all the hard work for us
to find the default directories.

* Look for plugins in all Plugin Paths

If the plugin folder was missing from one of the PluginPaths, we would
immediately stop loading plugins. We now keep looking even if one of the
path is missing.

Co-authored-by: Nichole Mattera <me@nicholemattera.com>
Co-authored-by: Robin Lambertz <unfiltered@roblab.la>
2021-03-01 08:56:49 +01:00