内容摘要:: dnf漫游枪手加点地下城与勇士sf,
地下城与勇士sf,[原创][一]过掉DNF游戏保护,仅供学习研究.不得用于非法途径., 【原创】【一】过掉DNF游戏保护,仅供学习研究。不得用于非法途径。由于我的C用的比较少,所以大部分都用的汇编,部分地方用汇编写不是很方便,所以我用的C,,[原创][一]过掉DNF游戏保护,仅供学习研究.不得用于非法途径.地下城与勇士sf 。
,
【原创】【一】过掉DNF游戏保护,仅供学习研究。不得用于非法途径。由于我的C用的比较少,所以大部分都用的汇编,部分地方用汇编写不是很方便,所以我用的C,由于只是学习,所以内核地址我没有计算都是硬编码的。过DNF主要分为三步,也许我的思路不太正确,反正可以OD调试,下断。 程序没怎么修边幅,因为只是测试,所以一般都没有写更改内核后的恢复,不过不妨碍使用。 第一步,这也是最起码的,你必须要能够打开游戏进程和线程,能够开打进程和线程后不被检测到 第二步,能够读写进村内存 第三步,能够用OD附加游戏进程 第四步,能够下硬件断点而不被检测 跳过NtReadVirtualMemory,NtWriteVirtualMemory函数头的钩子 代码: #include<ntddk.h> typedef struct _SERVICE_DESCRIPTOR_TABLE { PVOID ServiceTableBase; PULONG ServiceCounterTableBase; ULONG NumberOfService; ULONG ParamTableBase; }SERVICE_DESCRIPTOR_TABLE,*PSERVICE_DESCRIPTOR_TAB LE; //由于KeServiceDescriptorTable只有一项,这里就简单点了 extern PSERVICE_DESCRIPTOR_TABLE KeServiceDescriptorTable;//KeServiceDescriptorTabl e为导出函数 ///////////////////////////////////// VOID Hook(); VOID Unhook(); VOID OnUnload(IN PDRIVER_OBJECT DriverObject); ////////////////////////////////////// ULONG JmpAddress;//跳转到NtOpenProcess里的地址 ULONG JmpAddress1;//跳转到NtOpenProcess里的地址 ULONG OldServiceAddress;//原来NtOpenProcess的服务地下城的勇士任务地址 ULONG OldServiceAddress1;//原来NtOpenProcess的服务地址 ////////////////////////////////////// __declspec(naked) NTSTATUS __stdcall MyNtReadVirtualMemory(HANDLE ProcessHandle, PVOID BaseAddress, PVOID Buffer, ULONG NumberOfBytesToRead, PULONG NumberOfBytesReaded) { //跳过去 __asm { push 0x1c push 804eb560h //共十个字节 jmp [JmpAddress] } } __declspec(naked) NTSTATUS __stdcall MyNtWriteVirtualMemory(HANDLE ProcessHandle, PVOID BaseAddress, PVOID Buffer, ULONG NumberOfBytesToWrite, PULONG NumberOfBytesReaded) { //跳过去 __asm { push 0x1c push 804eb560h //共十个字节 jmp [JmpAddress1] } } ////////////////////////////////////////////////// / NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,PUNICODE_STRING RegistryPath) { DriverObject->DriverUnload = OnUnload; DbgPrint("Unhooker load"); Hook(); return STATUS_SUCCESS; } ////////////////////////////////////////////////// /// VOID OnUnload(IN PDRIVER_OBJECT DriverObject) { DbgPrint("Unhooker unload!"); Unhook(); } ////////////////////////////////////////////////// /// VOID Hook() { ULONG Address, Address1; Address = (ULONG)KeServiceDescriptorTable->ServiceTableBase 0xBA * 4;//0x7A为NtOpenProcess服务ID Address1 = (ULONG)KeServiceDescriptorTable->ServiceTableBase 0x115 * 4;//0x7A为NtOpenProcess服务ID DbgPrint("Address:0xX",Address); OldServiceAddress = *(ULONG*)Address;//保存原来NtOpenProcess的地址 OldServiceAddress1 = *(ULONG*)Address1;//保存原来NtOpenProcess的地址 DbgPrint("OldServiceAddress:0xX",OldServiceAddr ess); DbgPrint("OldServiceAddress1:0xX",OldServiceAdd ress1); DbgPrint("MyNtOpenProcess:0xX",MyNtReadVirtualM emory); DbgPrint("MyNtOpenProcess:0xX",MyNtWriteVirtual Memory); JmpAddress = (ULONG)0x805b528a 7; //跳转到NtOpenProcess函数头+10的地方,这样在其前面写的JMP都失效了 JmpAddress1 = (ULONG)0x805b5394 7; DbgPrint("JmpAddress:0xX",JmpAddress); DbgPrint("JmpAddress1:0xX",JmpAddress1); __asm { //去掉内存保护 cli mov eax,cr0 and eax,not 10000h mov cr0,eax } *((ULONG*)Address) = (ULONG)MyNtReadVirtualMemory;//HOOK SSDT *((ULONG*)Address1) = (ULONG)MyNtWriteVirtualMemory; __asm { //恢复内存保护 mov eax,cr0 or eax,10000h mov cr0,eax sti } } ////////////////////////////////////////////////// //// VOID Unhook() { ULONG Address, Address1; Address = (ULONG)KeServiceDescriptorTable->ServiceTableBase 0xBA * 4;//查找SSDT Address1 = (ULONG)KeServiceDescriptorTable->ServiceTableBase 0x115 * 4; __asm{ cli mov eax,cr0 and eax,not 10000h mov cr0,eax } *((ULONG*)Address) = (ULONG)OldServiceAddress;//还原SSDT *((ULONG*)Address1) = (ULONG)OldServiceAddress1;//还原SSDT __asm{ mov eax,cr0 or eax,10000h mov cr0,eax sti } DbgPrint("Unhook"); } 由于它不断对DebugPort清零,所以要修改调试相关函数,使得所有的访问DebugPort的地方全部访问EPROCESS中的ExitTime字节,这样它怎么清零都无效了,也检测不到 代码: .386 .model flat, stdcall option casemap:none include dnf_hook.inc .const Dspdo_1 equ 803db6h Dmpp_1 equ 802d5eh Dmpp_2 equ 802dh Dct_1 equ 8045d3h Dqm_1 equ 803089h Kde_1 equ 804ff5fdh Dfe_1 equ 804340h Pcp_1 equ 805d1a0dh Mcp_1 equ 805b0c06h Mcp_2 equ 805b0d7fh Dmvos_1 equ 80497fh Dumvos_1 equ 804a45h Pet_1 equ 805d32f8h Det_1 equ 80486ch Dep_1 equ 8048e6h .code ;还原自己的Hook DriverUnload proc pDriverObject:PDRIVER_OBJECT ret DriverUnload endp ModifyFuncAboutDbg proc addrOdFunc, cmd_1, cmd_2 pushad mov ebx, addrOdFunc mov eax, cmd_1 mov DWORD ptr [ebx], eax mov eax, cmd_2 mov DWORD ptr [ebx 4], eax popad ret ModifyFuncAboutDbg endp DriverEntry proc pDriverObject:PDRIVER_OBJECT, pusRegistryPath:PUNICODE_STRING cli mov eax, cr0 and eax, not 10000h mov cr0, eax invoke ModifyFuncAboutDbg, Dspdo_1, 90784789h, 0fde89090h invoke ModifyFuncAboutDbg, Dmpp_1, 90787e39h, 950f9090h invoke ModifyFuncAboutDbg, Dct_1, 90785e39h, 840f9090h invoke ModifyFuncAboutDbg, Dqm_1, 9078408bh, 45899090h invoke ModifyFuncAboutDbg, Kde_1, 90787839h, 13749090h invoke ModifyFuncAboutDbg, Dfe_1, 9078418bh, 0d2329090h invoke ModifyFuncAboutDbg, Pcp_1, 90784389h, 45f69090h invoke ModifyFuncAboutDbg, Mcp_1, 90785e39h, 950f9090h invoke ModifyFuncAboutDbg, Mcp_2, 90784a89h, 5e399090h invoke ModifyFuncAboutDbg, Dmvos_1, 9078498bh, 0cb3b9090h invoke ModifyFuncAboutDbg, Dumvos_1, 00787983h, 74909090h invoke ModifyFuncAboutDbg, Pet_1, 00787f83h, 74909090h invoke ModifyFuncAboutDbg, Det_1, 9078498bh, 0c9859090h invoke ModifyFuncAboutDbg, Dep_1, 9078498bh, 0c9859090h ;invoke ModifyFuncAboutDbg, Dmpp_2, 8bc0950fh, 8b90c032h mov eax, pDriverObject assume eax : ptr DRIVER_OBJECT mov [eax].DriverUnload, offset DriverUnload assume eax : nothing mov eax, cr0 or eax, 10000h mov cr0, eax sti mov eax, STATUS_SUCCESS ret DriverEntry endp end DriverEntry dnf动漫16