Repository navigation
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.,
RXfor code/trampolines,R/RWfor read-only/mutable data, metadata, IAT,.bss, and remote args) instead of flatPAGE_EXECUTE_READ. - Unified Protection Planning — Local PE/COFF loaders and remote injection staging now share
snd_image_characteristics_to_protectandsnd_memory_protect_region_cbiterators 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
SAFESEHlinking 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, duplicateSND_IMAGE_ORDINAL*macros), and 12 unusedntdll.dll/kernel32.dllhashes fromconfig/hashes.ini. - Stricter PE/COFF Injection Preparation —
snd_inj_prepare_penow rejects missing or out-of-imageAddressOfEntryPointvalues (SND_STATUS_IMAGE_ENTRY_POINT_MISSING), andsnd_inj_prepare_coffenforces upfrontSND_IS_ARCH_COMPATIBLEchecks and bounds-checked entry-symbol resolution (snd_ldr_coff_resolve_entry_offset). - Local COFF Execution Guard —
snd_ldr_coff_execute_imagenow requiresSND_COFF_STAGE_READY_FOR_EXECUTIONand rejects remotely relocated images (local_base != execution_base) withSND_STATUS_COFF_LOADER_LOCAL_EXECUTION_BLOCKED.
Added
- Planned Remote Staging — Added
snd_inj_protect_plan_cbandsnd_inj_set_protections_with_planinsindri/injection/common/staging.hto enforce bounded(offset, size, protect)region application before advancing toSND_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, andsnd_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, andSND_STATUS_COFF_LOADER_ENTRY_POINT_INVALID. - NT DOS-Path Helpers — Extracted shared
snd_nt_build_dos_path_aandsnd_nt_build_dos_path_whelpers insindri/internal/nt/base.hto deduplicate\??\path construction across file and process primitives.
Fixed
- x86 MSVC Build (
SAFESEH& Warnings) — Added/safesehfor x86 MASM objects inCMakeLists.txt(fixingLNK2026/LNK1281onsnd_unit_tests.exeandunified.exe), removed duplicateWINUSERAPIintest_coff_user32.c(C4141), and suppressed expectedLNK4086ontest_inject_marker_x86.dll. - COFF Staging & Section Bounds — Local COFF staging in
snd_ldr_coff_allocate_and_copy_sectionsnow allocatesSND_PAGE_READWRITEbefore 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_regionclampsrun_lengthtovirtual_size - run_offsetand removes the trailing deadpage_offsetassignment. - COFF Entry Default & Cleanup —
snd_ldr_coff_execute_imagedefaultsNULLentry_nameto"go"and drops the unused 4 KB stack buffer;snd_inj_prepare_coffremoves the unusedtotal_payloadstruct; fixed"Unkown error code"insrc/status/generic.c.
Testing
- Added
test_page_protection_flagsintests/unit/test_pe_parser.cand 6 new injection/COFF guard tests intests/unit/test_inject_chains.ccovering PE/COFF per-section remote protections, missing/invalid entry points, protection-plan bounds guards, and local COFF execution guards. - Updated
test_inject_marker_dllandtest_inject_marker_bofwith mutable.data,.bss, and COFF commonbss_baseprobes verified before writingSND_INJECT_OK.
SindriKit is intended for educational, security research, and authorized red-team development.