1
0
mirror of synced 2024-11-14 19:17:42 +01:00
Commit Graph

963 Commits

Author SHA1 Message Date
WerWolv
afa149f2db patterns: Updated pattern language
Fixes #1361
2023-10-11 22:20:25 +02:00
lomekragow
7fc2ff3002
fix: Event unsubscribe not working correcetly when using same key for multiple events (#1309)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->

Fixed possible bug of  `EventManager::unsubscribe`

`std::map` only allows unique key, but the same token can subscribe to
multiple events.

1a2a926b77/lib/libimhex/include/hex/api/event.hpp (L104-L107)

If the previous token has already subscribed to an event, then when
subscribing again, `getTokenStore().insert` will not do anything
(Because its type is `std::map`)


1a2a926b77/lib/libimhex/include/hex/api/event.hpp (L122-L134)

At this point in `unsubscribe`, the `iter` may not be able to find the
correct event and erase it



### Implementation description
<!-- Explain what you did to correct the problem -->

Change `tokenStore` to `std::multimap` instead of `std::map`, which
cannot unsubscribe multiple events correctly

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->

### Additional things
<!-- Anything else you would like to say -->
2023-10-07 23:35:35 +02:00
WerWolv
23e1c714d6 patterns: Updated pattern language 2023-10-06 19:31:48 +02:00
WerWolv
e57c9ff4f6 build: Updated libwolv 2023-10-04 16:13:40 +02:00
WerWolv
ed8c0794bb fix: Querying default folder paths not working right on the web 2023-10-04 16:10:14 +02:00
WerWolv
a06752b349 build: Updated libwolv 2023-10-04 13:41:21 +02:00
iTrooz
d15bd4771d
feat: Support for building ImHex for the web (#1328)
Co-authored-by: WerWolv <werwolv98@gmail.com>
Co-authored-by: AnnsAnn <git@annsann.eu>
2023-10-04 12:00:32 +02:00
WerWolv
a62ede7840 fix: Properly fix possibility of no provider being selected when closing one 2023-10-01 20:56:25 +02:00
WerWolv
bcab657a06 fix: No provider being selected in some cases when closing a provider 2023-10-01 20:18:26 +02:00
WerWolv
51880fc2a8 build: Fixed build/install of refactored forwarder 2023-09-27 15:13:58 +02:00
StarrFox
25ddaa08dc
build: Fix building with capstone < 5 (#1323)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->
This might fix building with capstone 4 as discussed in
https://discord.com/channels/789833418631675954/1155669027306340393/1155669027306340393

### Implementation description
<!-- Explain what you did to correct the problem -->
moves the max definition inside the if statement that checks for
capstone 5
2023-09-25 21:52:28 +02:00
WerWolv
f79e2df11a feat: Added shortcut to switch between providers 2023-09-24 18:11:17 +02:00
paxcut
c577a42f62
impr: Refactoring of floating point tool to decrease code complexity. (#1275)
I noticed the bad score on code factor so I reorganized it to make it
more readable and maintainable. In order to break down the big function
into it much smaller parts I encapsulated all the variables that the
functions need to access in two classes, one for the imgui related
statics and the other for non-static variables.

When writing the smaller functions I was noticed that there was room to
simplify the existing algorithms by writing functions that could be
called by parts that previously shared no code. I tested the changes the
same way I tested the original and it seems to work the same way but
maybe a bit faster. Although it may be possible to further optimize the
present code code factor no longer flags the function at all.
2023-09-20 10:48:44 +02:00
Lennard Fonteijn
ad69ac84b1
feat: Added hex::group attribute and various fixes (#1302)
As discussed (many times) on Discord, does the same as the new favorite
tag, but instead allows you to add multiple groups.

Initially, this would cause some insane issues with draw/reset
(apparantly) fighting eachother in the pattern drawer. After a lot of
trial and error, I decided to rewrite the flow that is responsible for
calling reset. Now evaluating patterns is the one to decide when the
reset happens, not the core "game"-loop.

To make sure that draw and reset can never happen at the same time, the
mutex originally used for the favorites has been repurposed. Due to the
restructuring, the mutex in the favorite-task is no longer needed, as
that will only ever kick-off after reset is called and if there are
actually patterns, which can never line up to be accessed on different
threads at the same time.

Last but not least, I noticed that hard crashes could result in your
config file getting overridden. I added a check to prevent that.

Last I issue I can see is that if you use an excessive amount of
favorites/groups, a crash can still happen, but it only happens when you
close the program (occasionally, but unpredictable). Before, this would
happen if you ran the evaluation a second time. I boiled the cause of
the crash down to these lines of code in evaluator.cpp >
patternDestroyed:

```cpp
if (pattern->isPatternLocal()) {
    if (auto it = this->m_patternLocalStorage.find(pattern->getHeapAddress()); it != this->m_patternLocalStorage.end()) {
        auto &[key, data] = *it;

        data.referenceCount--;
        if (data.referenceCount == 0)
            this->m_patternLocalStorage.erase(it);
    } else if (!this->m_evaluated) {
        err::E0001.throwError(fmt::format("Double free of variable named '{}'.", pattern->getVariableName()));
    }
}
```

Specifically, trying to access the `*it` is the reason for the crash
(this was also the cause of the crashes before my fixes, but then during
evaluation).

I'm suspecting the root cause is somewhere in the `.clone` methods of
the patterns. I'd say that for now a crash when closing the program is
more acceptable than during evaluation (which can even happen if you use
favorites).
2023-09-16 13:09:59 +02:00
WerWolv
d011f37658 impr: Added better provider documentation 2023-09-08 21:59:27 +02:00
WerWolv
68b203eb75 patterns: Updated pattern language 2023-09-05 10:40:10 +02:00
WerWolv
1bb0a72bed fix: Issues with various float nodes 2023-09-04 19:59:09 +02:00
WerWolv
fc91c8e4b0 patterns: Updated pattern language 2023-09-04 19:58:31 +02:00
iTrooz
57084fd797
build: Update libfmt to 10.1.1 (#1286) 2023-09-03 22:49:47 +02:00
WerWolv
9badfc043b patterns: Updated pattern language 2023-09-03 22:37:58 +02:00
WerWolv
563ff5a774 fix: Future proof the previous fix 2023-09-03 16:18:29 +02:00
WerWolv
dc5e5344c5 fix: ImHex not starting at all anymore when launched through the explorer 2023-09-03 14:07:47 +02:00
WerWolv
632f388ece impr: Make --pl subcommand automatically register ImHex's include dirs 2023-09-03 12:25:00 +02:00
WerWolv
632ca944de impr: Align log output better 2023-09-03 11:45:20 +02:00
WerWolv
eba8c82699 fix: Crash when using provider overlays 2023-09-03 10:26:25 +02:00
iTrooz
be3ac26306
fix: Remove remannts of #680 bugfix (#1282) 2023-09-02 22:59:09 +02:00
WerWolv
58cef2361b impr: Added hint when patterns are still loading 2023-08-30 10:04:06 +02:00
WerWolv
7bf9634e6e patterns: Updated pattern language 2023-08-29 12:14:34 +02:00
WerWolv
550392c8d6 fix: Texture loading from romfs 2023-08-26 23:43:35 +02:00
WerWolv
32e05cc62f patterns: Updated pattern language 2023-08-26 23:31:25 +02:00
WerWolv
886c52b322 patterns: Updated pattern language 2023-08-26 12:55:09 +02:00
WerWolv
ba66005585 impr: Various code cleanup 2023-08-26 12:54:52 +02:00
Justus Garbe
bfc835fc54 fix: add new capstone options and fixed overextending name array 2023-08-26 12:21:44 +02:00
iTrooz
32d6ac2241
feat: move PerProvider data to new provider when saving memory provider into file provider (#1264) 2023-08-26 01:47:44 +02:00
WerWolv
758cdd91f3 impr: Make sure logs are always output immediately 2023-08-26 01:44:10 +02:00
WerWolv
6e81ce152e impr: Get rid of some manual memory management 2023-08-25 23:54:39 +02:00
WerWolv
6fc62bac94 build: Remove unnecessary yara autoconf file configuring 2023-08-25 22:55:09 +02:00
iTrooz
175e66a60e
feat: Do not save memory providers as recent entries (#1259) 2023-08-25 15:35:15 +02:00
WerWolv
f598421705 patterns: Updated pattern language 2023-08-17 08:24:38 +02:00
WerWolv
fc93f8bd66 fix: CI being broken on Arch Linux 2023-08-16 23:07:16 +02:00
Lennard Fonteijn
d2e6d8e4d9
Added ImGui extension to create single- and multiline formatted selec… (#1249)
(Partial) implementation of #1245 with additional functionality to
supersede PR #1240.
2023-08-13 17:08:17 +02:00
Justus Garbe
285b79f31e fix: Crypto buffered hexadecimal encoding 2023-08-13 15:27:01 +02:00
Justus Garbe
d468893bb0 build: Updated libwolv 2023-08-13 14:30:52 +02:00
WerWolv
882849e73c fix: Highlighting of found elements not being cleared correctly 2023-08-09 20:01:57 +02:00
WerWolv
49d3fe65a3 fix: Allow converting very long hex strings to bytes 2023-08-09 20:01:29 +02:00
Nik
e77f138514
feat: Added Achievements (#1230)
This PR adds Achievements to ImHex that serve as both a guide and a fun
way to learn more about ImHex and reverse engineering
2023-08-06 21:33:15 +02:00
WerWolv
64a0c3f6e2 build: Updated json and miniaudio libraries 2023-08-06 11:10:42 +02:00
WerWolv
fae8f0a8d5 build: Fixed cmake not using default settings on Windows 2023-08-06 01:52:23 +02:00
WerWolv
1a765ee5ab build: Updated libromfs 2023-08-05 10:26:27 +02:00
WerWolv
e1ca84d89c patterns: Updated pattern language
Fixes #1228
2023-08-05 09:59:53 +02:00