Skip to content

SindriKit v2.4.0

Latest

Choose a tag to compare

@youssefnoob003 youssefnoob003 released this 27 Nov 08:25
· 1 commit to main since this release

v2.4.0 introduces per-section remote memory protections for injected PE and COFF payloads, unifies local loader and remote protection planning, tightens loader and injection validation, removes dead code and unused API hashes, and fixes x86 MSVC SAFESEH builds.

Highlights

  • Per-Section Remote Protections — Injected PE and COFF payloads across classic, APC, and hijack techniques now receive section-accurate remote page protections (e.g., RX for code/trampolines, R/RW for read-only/mutable data, metadata, IAT, .bss, and remote args) instead of flat PAGE_EXECUTE_READ.
  • Unified Protection Planning — Local PE/COFF loaders and remote injection staging now share snd_image_characteristics_to_protect and snd_memory_protect_region_cb iterators so section-to-page protection rules live in one place.
  • Loader & Injection Hardening — Tightened PE/COFF entry-point validation, architecture checks, empty/truncated COFF section handling, and local vs. remote COFF execution boundaries.
  • Codebase & Build Cleanup — Removed dead types, macros, unused status codes, and 12 unused API hashes, deduplicated NT DOS-path helpers, and resolved x86 MSVC SAFESEH linking and build warnings.

Breaking Changes

  • Removed Dead Status Codes & Internal Symbols — Dropped unused status codes (SND_STATUS_THREAD_EXIT_FAILED, SND_STATUS_SECTION_OFFSET_OVERFLOW, SND_STATUS_SYMBOL_RESOLUTION_FAILED, SND_STATUS_STRING_TABLE_OVERFLOW, SND_STATUS_COFF_RELOCATION_PATCH_OUT_OF_RANGE), unused internal types/macros (SND_NtOpenThread_t, SND_PROCESS_CREATE_FLAGS_SUSPENDED, SND_ULARGE_INTEGER, duplicate SND_IMAGE_ORDINAL* macros), and 12 unused ntdll.dll/kernel32.dll hashes from config/hashes.ini.
  • Stricter PE/COFF Injection Preparation — snd_inj_prepare_pe now rejects missing or out-of-image AddressOfEntryPoint values (SND_STATUS_IMAGE_ENTRY_POINT_MISSING), and snd_inj_prepare_coff enforces upfront SND_IS_ARCH_COMPATIBLE checks and bounds-checked entry-symbol resolution (snd_ldr_coff_resolve_entry_offset).
  • Local COFF Execution Guard — snd_ldr_coff_execute_image now requires SND_COFF_STAGE_READY_FOR_EXECUTION and rejects remotely relocated images (local_base != execution_base) with SND_STATUS_COFF_LOADER_LOCAL_EXECUTION_BLOCKED.

Added

  • Planned Remote Staging — Added snd_inj_protect_plan_cb and snd_inj_set_protections_with_plan in sindri/injection/common/staging.h to enforce bounded (offset, size, protect) region application before advancing to SND_INJ_STAGE_PROTECTIONS_SET.
  • Shared Protection & Entry Helpers — Added snd_memory_protect_region_cb (sindri/primitives/memory.h), snd_image_characteristics_to_protect (sindri/internal/windows/image.h), snd_ldr_pe_for_each_protection_region, snd_ldr_coff_for_each_protection_region, and snd_ldr_coff_resolve_entry_offset.
  • COFF Loader Status Codes — Added SND_STATUS_COFF_LOADER_NO_SECTIONS, SND_STATUS_COFF_LOADER_SECTION_TRUNCATED, SND_STATUS_COFF_LOADER_LOCAL_EXECUTION_BLOCKED, and SND_STATUS_COFF_LOADER_ENTRY_POINT_INVALID.
  • NT DOS-Path Helpers — Extracted shared snd_nt_build_dos_path_a and snd_nt_build_dos_path_w helpers in sindri/internal/nt/base.h to deduplicate \??\ path construction across file and process primitives.

Fixed

  • x86 MSVC Build (SAFESEH & Warnings) — Added /safeseh for x86 MASM objects in CMakeLists.txt (fixing LNK2026/LNK1281 on snd_unit_tests.exe and unified.exe), removed duplicate WINUSERAPI in test_coff_user32.c (C4141), and suppressed expected LNK4086 on test_inject_marker_x86.dll.
  • COFF Staging & Section Bounds — Local COFF staging in snd_ldr_coff_allocate_and_copy_sections now allocates SND_PAGE_READWRITE before finalizing protections, rejects empty or truncated non-BSS raw sections, and preserves zero-filled .bss (PointerToRawData == 0).
  • PE Protection Run Clamping — snd_ldr_pe_for_each_protection_region clamps run_length to virtual_size - run_offset and removes the trailing dead page_offset assignment.
  • COFF Entry Default & Cleanup — snd_ldr_coff_execute_image defaults NULL entry_name to "go" and drops the unused 4 KB stack buffer; snd_inj_prepare_coff removes the unused total_payload struct; fixed "Unkown error code" in src/status/generic.c.

Testing

  • Added test_page_protection_flags in tests/unit/test_pe_parser.c and 6 new injection/COFF guard tests in tests/unit/test_inject_chains.c covering PE/COFF per-section remote protections, missing/invalid entry points, protection-plan bounds guards, and local COFF execution guards.
  • Updated test_inject_marker_dll and test_inject_marker_bof with mutable .data, .bss, and COFF common bss_base probes verified before writing SND_INJECT_OK.

SindriKit is intended for educational, security research, and authorized red-team development.