登录  | 立即注册

游客您好!登录后享受更多精彩

查看: 181|回复: 10

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

[复制链接]

169

主题

23

回帖

1218

积分

管理员

积分
1218
发表于 2025-3-24 23:12:11 | 显示全部楼层 |阅读模式
121305jzp2pits4murnnd2.jpg
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[1];
        TargetInfo[0].Flags = 0x00000001;
        TargetInfo[0].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[0];
        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 [rsp+38h],ecx
                mov     qword ptr [rsp+40h],rcx
                mov     rdx,qword ptr [rax+20h]
                mov     r9,qword ptr [rax+18h]
                mov     r8,qword ptr [rax+10h]
                mov     rcx,qword ptr [rax]
                mov     qword ptr [rsp+20h],rdx
                mov     edx,dword ptr [rax+8]
                mov     rax,qword ptr [rax+28h]
                call    qword ptr [USER32!_guard_dispatch_icall_fptr (00007ffe`87599b10)]
        */
        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);
}


RemoteCall.rar (30.41 KB, 下载次数: 0)





0

主题

75

回帖

195

积分

注册会员

积分
195
发表于 2025-3-25 09:43:43 | 显示全部楼层
果断回帖,如果沉了就是我弄沉的很有成就感
回复

使用道具 举报

0

主题

210

回帖

187

积分

注册会员

积分
187
发表于 2025-4-1 08:25:23 | 显示全部楼层
好东西!!
回复

使用道具 举报

0

主题

52

回帖

83

积分

新手上路

积分
83
发表于 2025-4-18 22:23:39 来自手机 | 显示全部楼层
牛,支持支持支持
回复

使用道具 举报

0

主题

88

回帖

298

积分

注册会员

积分
298
发表于 2025-4-19 09:22:24 | 显示全部楼层
学习一下,谢谢!!
回复

使用道具 举报

0

主题

75

回帖

195

积分

注册会员

积分
195
发表于 2025-4-19 20:53:27 | 显示全部楼层
膜拜神贴,后面的请保持队形~
回复

使用道具 举报

0

主题

88

回帖

298

积分

注册会员

积分
298
发表于 2025-4-20 09:24:51 | 显示全部楼层
果断MARK,前十有我必火!
回复

使用道具 举报

0

主题

75

回帖

195

积分

注册会员

积分
195
发表于 2025-4-20 15:05:32 | 显示全部楼层
哥顶的不是帖子,是寂寞!
回复

使用道具 举报

0

主题

52

回帖

83

积分

新手上路

积分
83
发表于 6 天前 | 显示全部楼层
楼主,我借此贴,询问一下lol源码啥时候能补上
回复

使用道具 举报

169

主题

23

回帖

1218

积分

管理员

积分
1218
 楼主| 发表于 6 天前 | 显示全部楼层
YINXN 发表于 2025-4-22 21:00
楼主,我借此贴,询问一下lol源码啥时候能补上

早就补上了啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|断点社区 |网站地图

GMT+8, 2025-4-28 17:26 , Processed in 0.116083 second(s), 22 queries , Yac On.

Powered by XiunoBBS

Copyright © 2001-2025, 断点社区.

快速回复 返回顶部 返回列表