Commit Graph

1040 Commits

Author SHA1 Message Date
momo5502
6eb4ef33ff Handle invalid page protections
This fixes #420
2025-07-20 09:34:25 +02:00
momo5502
5e57360dc3 Fix buffer overflow 2025-07-18 07:15:54 +02:00
Maurice Heumann
acc5dd9646 Fix compilation 2025-07-17 19:49:16 +02:00
Maurice Heumann
4d4c04eb78 Finish tenet tracer refactoring 2025-07-17 19:42:59 +02:00
Maurice Heumann
6e71e495bc More fixes 2025-07-17 18:55:16 +02:00
Maurice Heumann
3c05c7a607 Small fixes 2025-07-17 18:53:07 +02:00
Maurice Heumann
d09b32eb5e Fix clang tidy warnings 2025-07-17 18:45:18 +02:00
Maurice Heumann
b5e40c3627 Revert line endings 2025-07-17 18:38:26 +02:00
Maurice Heumann
8caf724c95 Fix formatting 2025-07-17 18:30:00 +02:00
Maurice Heumann
079d367792 Generate an output that the Tenet plugin can read (#416)
Generates a Tenet tracer output with the -t parameter. The original
Tenet tracer plugin is outdated, so I made updates to support our
emulator. The forked project below works well.

https://github.com/maskelihileci/tenet/tree/master/plugins_sogen-support
2025-07-17 18:11:47 +02:00
Maurice Heumann
9e5a6b509b Implement guard pages (#406)
Hey, looking for feedback on my guard page implementation. 

I wasn't sure on how to structure the additional windows specific memory
flags, since the emulation backends won't like additional guard flag. I
opted to create a new `memory_permission_ext` enum to hold the guard
flag, and a `nt_memory_permission` struct to wrap the "common" memory
permission flags, with the new extended flags. This struct implicitly
coerces to the original `memory_permission` to reduce the amount of
changes for the PR.

This however meant that I changed signatures of `map_memory` and
`apply_memory_protection` in `memory_interface` to accommodate this new
structure, and was an afterthought.

The `map_nt_to_emulator_protection` function might also need some
attention now, too. For future reference, windows uses
[MiMakeProtectionMask](https://doxygen.reactos.org/d1/d9a/marea_8c.html#adfb66408771a4df77c1056cc2a99ef21)
in ntoskrnl to map `PAGE_*` flags to [MM PTE
constants](https://reactos.org/wiki/Techwiki:Memory_management_in_the_Windows_XP_kernel).

The test added to the `test-sample` binary seems to be passing.

Fixes #21
2025-07-17 17:41:06 +02:00
3fault
188b95af5d Fix formatting 2025-07-17 11:27:23 -04:00
3fault
f1d54f7417 Parameterize basic_memory_region to support extended memory flags 2025-07-17 11:19:56 -04:00
3fault
9f637105fb Unset extended flags in nt_memory_permission assignment operator 2025-07-17 11:06:26 -04:00
3fault
8cea9fc75a Ensure memory is freed after guard page test 2025-07-17 10:55:45 -04:00
maskelihileci
20f96841de Generate an output that the Tenet plugin can read
Generates a Tenet tracer output with the -t parameter.
The original Tenet tracer plugin is outdated, so I made updates to support our emulator. The forked project below works well.

https://github.com/maskelihileci/tenet/tree/master/plugins_sogen-support
2025-07-17 14:36:29 +03:00
Maurice Heumann
7632a77c36 Ah fuck it 2025-07-13 12:37:16 +02:00
Maurice Heumann
24ed6db02e Try different fix 2025-07-13 12:25:20 +02:00
Maurice Heumann
cc8aa65aec Fix icicle deprecation warning 2025-07-13 12:07:46 +02:00
Maurice Heumann
d7a1a269b7 Setup thread before dispatching APC 2025-07-12 21:33:12 +02:00
momo5502
ac2d34c143 Small cleanup 2025-07-12 15:40:04 +02:00
momo5502
7a3a5d760e Fix thread deletion 2025-07-12 15:28:30 +02:00
momo5502
08995a4205 Print memory stats 2025-07-12 14:17:52 +02:00
momo5502
0794c1038b Display emulation status 2025-07-11 13:43:21 +02:00
momo5502
acb65dc10d Log message box arguments 2025-07-09 21:17:32 +02:00
3fault
f4fc9c4a6c fix memory_permissions_ext includes 2025-07-09 14:49:26 -04:00
3fault
19574fb512 remove references to nt_memory_permission from backend 2025-07-09 14:43:06 -04:00
3fault
8ec184d57f remove unneeded windows-emulator/memory_permission_ext.cpp 2025-07-09 14:39:49 -04:00
momo5502
adb94f37bd Prepare memory 64 support 2025-07-09 17:38:10 +02:00
Maurice Heumann
a711a8faad Fix posix colors 2025-07-08 18:55:29 +02:00
Maurice Heumann
965efadb51 Detailed CPUID logging 2025-07-08 18:50:40 +02:00
Maurice Heumann
d656a18c8b Print CPUID leaf 2025-07-08 16:36:23 +02:00
Maurice Heumann
a9c30bce33 Also log ExpandEnvironmentStringsA 2025-07-08 12:29:20 +02:00
Maurice Heumann
43bcac8f5b Print details for certain functions 2025-07-07 21:18:49 +02:00
3fault
6e203d9590 Fix formatting issues 2025-07-02 14:47:51 -04:00
3fault
af21473cf1 merge test_guard_page with test_native_exceptions, fixes MinGW build 2025-07-02 14:27:05 -04:00
3fault
2ecd3e4440 add STATUS_GUARD_PAGE_VIOLATION constant to platform includes 2025-07-02 14:06:37 -04:00
3fault
9a6da790cf Remove #include <winnt.h> in exception_dispatch 2025-07-02 13:41:23 -04:00
3fault
68a5800c85 Add test for guard page in test-sample, formatting fix 2025-07-02 12:09:21 -04:00
3fault
2e17f37f78 Update hook_memory_violation to handle guard page violations 2025-07-01 19:17:05 -04:00
3fault
1276c7e2bc Update occurances of memory_permission to nt_memory_permission where needed 2025-07-01 19:04:22 -04:00
3fault
7d8daf7c68 Update map_nt_to_emulator_protection to support PAGE_GUARD flag 2025-07-01 18:28:54 -04:00
3fault
a8ae617e50 Add memory_permission_ext to windows-emulator 2025-07-01 18:14:02 -04:00
3fault
ceadcbc3e8 Add dispatch_guard_page_violation to exception_dispatch 2025-07-01 17:50:45 -04:00
dependabot[bot]
ecdc05bd52 Bump pcode in /src/backends/icicle-emulator/icicle-bridge
Bumps [pcode](https://github.com/icicle-emu/icicle-emu) from `2cdcf4b` to `e80282d`.
- [Commits](2cdcf4bdbc...e80282d3e1)

---
updated-dependencies:
- dependency-name: pcode
  dependency-version: e80282d3e1f53177b3f5a82fc48ac7538826a7d9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 07:26:54 +00:00
Maurice Heumann
a2d343c35b Update main.cpp 2025-06-30 21:45:47 +02:00
momo5502
6b6dcc9ce2 Conditionally print access to executable memory 2025-06-30 21:22:12 +02:00
momo5502
415d2d2efe Display application success in playground 2025-06-30 17:32:24 +02:00
momo5502
f1ca3e0981 Log CPUID executions 2025-06-27 19:36:27 +02:00
Maurice Heumann
778647aedb Update unicorn_x86_64_emulator.cpp 2025-06-26 20:23:00 +02:00