MCPcopy Create free account
hub / github.com/DarthTon/Xenos / InjectKernel

Method InjectKernel

src/InjectionCore.cpp:699–727  ·  view source on GitHub ↗

Kernel-mode injection Injection context Target image Init function RVA

Source from the content-addressed store, hash-verified

697/// <param name="img">Target image</param>
698/// <param name="initRVA">Init function RVA</param>
699NTSTATUS InjectionCore::InjectKernel(
700 InjectContext& context,
701 const blackbone::pe::PEImage& img,
702 uint32_t initRVA /*= 0*/
703 )
704{
705 if (context.cfg.injectMode == Kernel_MMap)
706 {
707 return blackbone::Driver().MmapDll(
708 context.pid,
709 img.path(),
710 (KMmapFlags)context.cfg.mmapFlags,
711 initRVA,
712 context.cfg.initArgs
713 );
714 }
715 else
716 {
717 return blackbone::Driver().InjectDll(
718 context.pid,
719 img.path(),
720 (context.cfg.injectMode == Kernel_Thread ? IT_Thread : IT_Apc),
721 initRVA,
722 context.cfg.initArgs,
723 context.cfg.unlink,
724 context.cfg.erasePE
725 );
726 }
727}
728
729/// <summary>
730/// Manually map another system driver into system space

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected