admin 发表于 2025-3-24 23:12:11

C++内核模式远程Call源码



void UsermodeCallback::Init() {
        //KiCallUserMode = (KiCallUserModefn)0xfffff801735c4ac0;
        //MmCreateKernelStack = (MmCreateKernelStackfn)0xfffff8017346c210;
        //MmDeleteKernelStack = (MmDeleteKernelStackfn)0xfffff8017346d1e0;


        ContextUser = (CONTEXT*)UAlloc(sizeof(CONTEXT), PAGE_READWRITE);
        ULONG NtdllSize; auto NtdllBase = GetCurrentProcessModule(E("ntdll.dll"), &NtdllSize);
        NtContinue = GetProcAddress(NtdllBase, "NtContinue");

        CFG_CALL_TARGET_INFO TargetInfo;
        TargetInfo.Flags = 0x00000001;
        TargetInfo.Offset = (ULONG_PTR)((ULONG64)NtContinue - (ULONG64)NtdllBase);

        MEMORY_RANGE_ENTRY RangeEntry;
        RangeEntry.VirtualAddress = NtdllBase;
        RangeEntry.NumberOfBytes = NtdllSize;

        VM_INFORMATION VMInfo;
        VMInfo.NumberOfOffsets = 1;
        VMInfo.MustBeZero = 0;
        VMInfo.TargetsProcessed = &VMInfo.ExpectedFileOffset;

        VMInfo.CallTargets = &TargetInfo;
        VMInfo.Section.Section = 0;
        VMInfo.Section.Data = 0;
        VMInfo.ExpectedFileOffset = 0;

        /*
        *FIX CFG--
       
                USER32!_fnDWORD:
                sub   rsp,58h
                mov   rax,rcx
                xor   ecx,ecx
                mov   dword ptr ,ecx
                mov   qword ptr ,rcx
                mov   rdx,qword ptr
                mov   r9,qword ptr
                mov   r8,qword ptr
                mov   rcx,qword ptr
                mov   qword ptr ,rdx
                mov   edx,dword ptr
                mov   rax,qword ptr
                call    qword ptr
        */
        auto statusss = ImpCall(ZwSetInformationVirtualMemory, (HANDLE)-1, (VIRTUAL_MEMORY_INFORMATION_CLASS)2, 1, &RangeEntry, (PVOID)&VMInfo, 0x28);


        //__db();
        //MmCreateKernelStack = (pv)(RVA(FindPatternSect(KBase, (".text"), ("E8 ? ? ? ? 41 83 CF 04")), 5));
        //ImpCall(DbgPrintEx, 0, 0, "MmCreateKernelStack %llx\n", MmCreateKernelStack);
        //__db();
        //MmDeleteKernelStack = (pv)(RVA(FindPatternSect(KBase, ("PAGE"), ("8B D5 E8 ? ? ? ? 48 8B 05 ? ? ? ? 48 05 ? ? ? ?")), 7));
        //ImpCall(DbgPrintEx, 0, 0, "MmDeleteKernelStack %llx\n", MmDeleteKernelStack);
        //__db();
        //KiCallUserMode = (pv)(RVA(FindPatternSect(KBase, ("PAGE"), ("4D 8D ? ? 48 8B 94 24 ? ? ? ? 48 8B 8C 24 ? ? ? ? E8 ? ? ? ?")), 25));
        //ImpCall(DbgPrintEx, 0, 0, "KiCallUserMode %llx\n", KiCallUserMode);
}








xxxxbzn1 发表于 2025-3-25 09:43:43

果断回帖,如果沉了就是我弄沉的很有成就感

AO1199 发表于 2025-4-1 08:25:23

好东西!!

YINXN 发表于 2025-4-18 22:23:39

牛,支持支持支持

898727201 发表于 2025-4-19 09:22:24

学习一下,谢谢!!

xxxxbzn1 发表于 2025-4-19 20:53:27

膜拜神贴,后面的请保持队形~

898727201 发表于 2025-4-20 09:24:51

果断MARK,前十有我必火!

xxxxbzn1 发表于 2025-4-20 15:05:32

哥顶的不是帖子,是寂寞!

YINXN 发表于 7 天前

楼主,我借此贴,询问一下lol源码啥时候能补上{:-_-kelian-_-:}{:-_-kelian-_-:}

admin 发表于 7 天前

YINXN 发表于 2025-4-22 21:00
楼主,我借此贴,询问一下lol源码啥时候能补上

早就补上了啊
页: [1] 2
查看完整版本: C++内核模式远程Call源码