Commit Graph

226 Commits

Author SHA1 Message Date
ahm3dgg
34b4bc1609 Correctly build transitive dll list 2026-01-14 06:10:11 +02:00
ahm3dgg
f9fccedf4f Merge branch 'main' of https://github.com/momo5502/sogen into knowndlls-patch 2026-01-13 01:58:32 +02:00
ahm3dgg
0438b7a62b Update module_load_count when unmapping 2026-01-13 01:44:36 +02:00
Igor Pissolati
fc036ca2c5 Fix wrong return value of user_handle_table::get_server_info 2026-01-11 17:08:45 -03:00
Igor Pissolati
ffd7058bec Fix NtCreateFile's create_disposition behavior 2026-01-11 17:07:34 -03:00
ahm3dgg
5b03324342 Formatting 2026-01-11 00:32:00 +02:00
ahm3dgg
8dc54d7816 Clang Tidy Fix 2026-01-11 00:22:35 +02:00
ahm3dgg
fc0853aab6 NtOpenSection: Do Case-Insensitive String Comparison 2026-01-11 00:15:22 +02:00
ahm3dgg
58d6a10837 Simplify code and remove uncessary comments 2026-01-09 13:35:38 +02:00
ahm3dgg
0b47eb77f1 Formatting fix 2026-01-07 19:54:34 +02:00
ahm3dgg
1ec9816d9a Return STATUS_IMAGE_MACHINE_TYPE_MISMATCH in case a 64-bit process tries to map a 32-bit executable 2026-01-07 19:50:26 +02:00
ahm3dgg
f61946335c fix cast 2026-01-07 08:57:09 +02:00
ahm3dgg
981faf3600 fix 2026-01-07 08:42:12 +02:00
ahm3dgg
c3a760dace Fixed Formatting 2026-01-07 08:23:00 +02:00
ahm3dgg
4f8745ce1b Support for KnownDLLs and Some Refactoring 2026-01-07 08:06:19 +02:00
ahm3dgg
f54bc3467f Support for KnownDLLs and Some Refactoring 2026-01-07 07:34:34 +02:00
momo5502
45ac1fc32f Cleanup headers 2026-01-06 11:29:39 +01:00
Maurice Heumann
5d81d8bda9 Implement NtQueryMultipleValueKey (#684)
This PR implements `NtQueryMultipleValueKey` that is used in calls like
`RegQueryMultipleValues`.
2026-01-06 10:38:10 +01:00
Maurice Heumann
e46e8dcf7a more object syscalls (#687) 2026-01-06 10:30:47 +01:00
Maurice Heumann
d3af3c781c Add support for user_object/user_handle_table (#677)
Fixes #641

This PR is my attempt to add support for user32 objects and the user32
handle table. I also added a test, but as expected, it fails on Windows
2022. I’ll try to fix that another day, but feel free to review the code
😄
2026-01-06 10:21:58 +01:00
redthing1
cafa0ebd0b NTSTATUS: add STATUS_NOT_SAME_OBJECT 2026-01-05 23:08:05 -08:00
ahm3dgg
b642486bc4 Add Support for KnownDLLs 2026-01-06 08:34:41 +02:00
Igor Pissolati
5d59700ec7 Remove parse_number 2026-01-05 09:00:45 -03:00
ssvine
37c2184bfc Implement NtQueryMultipleValueKey 2026-01-05 13:11:35 +03:00
ahm3dgg
3e7813b269 Merge branch 'patch' of github.com:ahm3dgg/sogen into patch 2026-01-04 21:38:11 +02:00
ahm3dgg
cf2dacb304 Fixed Types for Heap Related Fields in PEB64 2026-01-04 21:37:13 +02:00
Igor Pissolati
7112d619b4 Fix clang tidy 2026-01-04 16:28:30 -03:00
Igor Pissolati
5302900a9d Fix for older Windows builds 2026-01-04 16:01:13 -03:00
Maurice Heumann
f218ec5d1d Fix virtual memory semantics and refactor region policy (#681) 2026-01-04 19:46:14 +01:00
thejanit0r
3b68260921 Fixed build errors 2026-01-04 14:53:53 +01:00
thejanit0r
f524a8cc38 Fixed clang-tidy errors 2026-01-04 14:47:08 +01:00
brian
ea1bbb8b82 Add MEM_IMAGE define 2026-01-04 18:21:07 +08:00
brian
6943b4369a Fix virtual memory semantics and refactor region policy 2026-01-04 18:01:24 +08:00
Igor Pissolati
de491ade0e Add support for user_object/user_handle_table 2026-01-02 19:46:04 -03:00
Maurice Heumann
0de53515ed Fix waiting (#675)
This PR fixes `INFINITE` waiting (`SleepEx`, `WaitForSingleObject`,
etc). Currently `INFINITE` is not infinite but "at this moment" (waiting
point in time == `clock.steady_now()`).
2026-01-02 22:14:02 +01:00
ssvine
9bdb5c9562 Fix INFINITE time waiting 2026-01-02 18:33:27 +03:00
ssvine
b9df0682ad Support SystemEmulationProcessorInformation 2026-01-02 18:28:38 +03:00
Maurice Heumann
1f936c024d Fix thread support (#640)
This PR fixes several things related to threads emulation:

1. Support `SameTebFlags.InitialThread`
This flag is needed to support emulation of .net executables (not yet
fully supported) that don't have an entry point set in `PE` header. This
applies to both `PE32` and `PE64` executables. If `InitialThread` is set
the loader substitutes an entry point of the .net executable with
`mscoree.dll!_CorExeMain`.

2. Fix static thread local storage for `WOW64`
This fix resolves `shell32.dll` initialization on `WOW64`. This fix also
uses correct structure and field names that are obtained from the
corresponding `.pdb` files.

3. Fix dynamic thread local storage for `WOW64`

4. Fix setting argument of a `WOW64` thread start proc

5. Fix creating suspended thread and parse create_flags
Currently creating suspended thread doesn't work because
`NtCreateThreadEx` handler uses invalid flag `CREATE_SUSPENDED`. This PR
fixes that, and moreover it carefully parses create_flags of the
`NtCreateThreadEx` call.

6. Fix `FS` and `GS` handling
This PR fixes several problems with `GS` and `FS` segments:

    * Wrong GDT descriptor for selector 0x53
* Update GDT descriptor for selector 0x53 for a `WOW64` process every
context switch like Windows does
* Set `GS` base when `GS` segment register is updated in 64-bit code
(code selector is `0x33`). When `GS` segment register is loaded with
correct selector (`0x2b`) `GS` base is set to 0. So, when the code
accesses something like `gs:[0]`, a page fault occurs. `KiPageFault`
handles this situation and sets correct `GS` base.

Also, take into account that `teb64.ExceptionList` initially contains
`teb32` address for `WOW64` process. This is used to setup `FS` base
when `wrfsbase` instruction is available. We can enable this instruction
using `kusd.ProcessorFeatures.arr[PF_RDWRFSGSBASE_AVAILABLE] = 1;` and
this work perfectly with `unicorn` backend. Unfortunately `icicle`
backend does not support `wrfsbase`, so I don't enable this instruction
by default.
2025-12-30 17:56:30 +01:00
ssvine
57ad277158 Fix creating suspended thread and parse create_flags 2025-12-30 15:18:55 +03:00
ssvine
1ebe5356c9 Fix dynamic TLS for WOW64 2025-12-30 15:18:33 +03:00
ssvine
04ff582fa9 Fix static TLS for WOW64
This fix resolves shell32.dll TLS problems.
Also it uses correct structure and field names
2025-12-30 15:18:18 +03:00
66hh
d83c602f19 Change data type to fix 32-bit build 2025-12-28 12:40:51 +08:00
66hh
95b17566a0 Add NtRaiseHardError error message logging 2025-12-27 17:17:24 +08:00
66hh
ecc00216d6 Support ProcessInstrumentationCallback 2025-12-27 17:17:23 +08:00
ssvine
8438a1f456 Support extended variant of ProcessBasicInformation 2025-12-24 18:33:49 +03:00
momo5502
db3a89a0da Support KeyCachedInformation 2025-12-23 09:31:10 +01:00
momo5502
2be5f73755 Support ProcessPriorityClass in NtQueryInformationProcess 2025-11-20 18:25:33 +01:00
momo5502
ed7c7085b4 Fix formatting 2025-11-01 10:34:26 +01:00
momo5502
cb4fe6c30f Merge remote-tracking branch 'origin/main' into wow64 2025-10-25 11:06:03 +02:00
Igor Pissolati
2c82277b5e Add FileIdInformation file info class 2025-10-23 11:19:17 -03:00