|
[原创]WIN64驱动编程基础教程(福利:过WIN7/8/8.1签名强制的LIB、过WIN7“补丁守卫”的SRC、吊销的正规数字签名)
没想到这么快就得到作者的回应 问题已解决,原来的代码改写,保留了低4位的数据,编译后试验通过了 ParameterCount = ServiceTableBase[Index]&0x0f ; ServiceTableBase[Index]=ParameterCount + GetOffsetAddress(*OldProcess); ParameterCount是堆栈传递的参数个数 调试信息如下 SemaphoreHandle = 8e358 DesiredAccess = 1f0003 ObjectAttributes = 8ebb0 InitialCount = 0 MaximumCount = 5 <----第5个参数已正确传递了, MyNtCreateSemaphore called! 说明:参数个数,如果是4个以下,应该为0,始过4个,=参数个数-4 如CreateSemaphore有5个参数,5-4=1个参数,是通过堆栈传递的 |
|
[原创]WIN64驱动编程基础教程(福利:过WIN7/8/8.1签名强制的LIB、过WIN7“补丁守卫”的SRC、吊销的正规数字签名)
这几天边看边试验HOOK SSDT,原教程的代码是HOOK NtTerminateProcess 能正常运行 接着改写代码 HOOK NtCreateSemaphore运行出错 查找原因,原来NtCreateSemaphore有5个参数,前4个都是通过寄存器传递的,传递正确 而第5个参数是通过堆栈传递的,如果修改了SSDT入口表指向自已的函数,第5个参数传递过来总是0,执行出错。而正常情况,指向原始的函数入口是,第5个能数传递过来的正确的。 ///////////////////////////////163 NtCreateSemaphore typedef NTSTATUS (__fastcall *NTCREATESEMAPHORE)( OUT PHANDLE SemaphoreHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN ULONG InitialCount, IN ULONG MaximumCount ); NTCREATESEMAPHORE NtCreateSemaphore=NULL; NTSTATUS __fastcall MyNtCreateSemaphore( OUT PHANDLE SemaphoreHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN ULONG InitialCount, IN ULONG MaximumCount) { //啥都没干,直接转到原来的函数,但因为第5个参数MaximumCount总是0而出错 NTSTATUS status; status = NtCreateSemaphore( SemaphoreHandle, DesiredAccess, ObjectAttributes, InitialCount, MaximumCount ); return status; } |
|
[测试]Lua脚本利用协程解决游戏中同时处理多个事务
经测试 不用协程也能实现多个脚本同时运行 procedure TForm1.Button2Click(Sender: TObject); var str:string; Lua1: TTestLua; begin Lua1 := TTestLua.Create; str:=form1.Memo1.Text; //这里存放的是要执行的脚本 luaL_loadstring(lua1.LuaInstance ,PAnsiChar(AnsiString(str))); lua_resume(lua1.LuaInstance ,0); //不能进行Free操作, 不然出错 //lua1.Free ; //lua1:=nil; end; Button2这个按钮按几下 脚本就启动几次 |
|
|
|
[讨论]有段代码没有明白为什么要那么奇怪
Delphi源代码 procedure TForm1.Button1Click(Sender: TObject); var s1:string; s2:string; s3:string; begin s1:='1234'; s2:='5678'; s3:=s1+s2; end; 反汇编代码 0044D944 /. 55 PUSH EBP ; =0012F76C 0044D945 |. 8BEC MOV EBP,ESP ; =0012F62C ; s1:string; 0044D947 |. 6A 00 PUSH 0 ; 变量S1 ; s2:string; 0044D949 |. 6A 00 PUSH 0 ; 变量S2 ; s3:string; 0044D94B |. 6A 00 PUSH 0 ; 变量S3 *************编译器加的代码*************************************************************** * 0044D94D |. 33C0 XOR EAX,EAX * 0044D94F |. 55 PUSH EBP ; =0012F62C * 0044D950 |. 68 9ED94400 PUSH Project1.0044D99E ; =44D99E * 0044D955 |. 64:FF30 PUSH DWORD PTR FS:[EAX] ; =12F95C * 0044D958 |. 64:8920 MOV DWORD PTR FS:[EAX],ESP ****************************************************************************************** 0044D95B |. 8D45 FC LEA EAX,DWORD PTR SS:[EBP-4] ; 0012F628 0044D95E |. BA B4D94400 MOV EDX,Project1.0044D9B4 ; 0044D9B4=ASCII "1234" ;s1:='1234'; 0044D963 |. E8 4065FBFF CALL Project1.00403EA8 ; [12F628]=44D9B4 字串指针 0044D968 |. 8D45 F8 LEA EAX,DWORD PTR SS:[EBP-8] ; 0012F624 ;s2:='5678'; 0044D96B |. BA C4D94400 MOV EDX,Project1.0044D9C4 ; ASCII "5678" 0044D970 |. E8 3365FBFF CALL Project1.00403EA8 ;s3:=s1+s2; 0044D975 |. 8D45 F4 LEA EAX,DWORD PTR SS:[EBP-C] 0044D978 |. 8B4D F8 MOV ECX,DWORD PTR SS:[EBP-8] 0044D97B |. 8B55 FC MOV EDX,DWORD PTR SS:[EBP-4] 0044D97E |. E8 9967FBFF CALL Project1.0040411C ; S3=S1+S2 *************编译器加的代码*************************************************************** * 0044D983 |. 33C0 XOR EAX,EAX * 0044D985 |. 5A POP EDX ; 0012F95C * 0044D986 |. 59 POP ECX ; 44D99E * 0044D987 |. 59 POP ECX ; 12F62C * 0044D988 |. 64:8910 MOV DWORD PTR FS:[EAX],EDX ; 0012F95C * 0044D98B |. 68 A5D94400 PUSH Project1.0044D9A5 ; 44D9A5 * 0044D990 |> 8D45 F4 LEA EAX,DWORD PTR SS:[EBP-C] ; 0012F620 * 0044D993 |. BA 03000000 MOV EDX,3 * 0044D998 |. E8 9764FBFF CALL Project1.00403E34 ; 堆栈S1,S2,S2清0 * 0044D99D \. C3 RETN * 0044D99E .^ E9 715EFBFF JMP Project1.00403814 * 0044D9A3 .^ EB EB JMP SHORT Project1.0044D990 ****************************************************************************************** 0044D9A5 . 8BE5 MOV ESP,EBP 0044D9A7 . 5D POP EBP ; =0012F76C 0044D9A8 . C3 RETN |
|
[求助]如何确认游戏角色?
直接找人物名字,也能成功,难度较大,因为字符串都是动态分配的,地址是变的 而且有重复的好几个,要一个个去试 把一般人物当对象理解,这个对象的指针是一个数组类来存放的,数组有数量 你可以用数组的数量来找 找个人少的地方,数下周围的NPC,怪物(一般和人物是一个表的),玩家的数量,用CE找这个数 再上个小号,人数+1,再用CE找 小号下线,人数-1,再用CD找 很快就能找到这个地址,找到后,一般隔4个字节的位置,向前找就能找到数组的指针 再查看内存一下基本就能确定人物名字,坐标,等信息 |
|
[求助]VC内联汇编的问题[已解决]
VC++6 试验了内联汇编几条语句 mov eax, dword ptr ds:[0x5fbbb4] mov eax, ds:[0x5fbbb4] 编译后是:mov eax,[5fbbb4] mov eax, dword ptr [0x5fbbb4] mov eax, [0x5fbbb4] mov eax, 0x5fbbb4 编译后是:mov eax,5fbbb4 所以要从内存读取,一定不能省了段前缀 ds: |
|
[求助]VC内联汇编的问题[已解决]
使用寄存器定义变量,再用Release编译后就是下面的代码,和用内联汇编的一样 定义寄存器变量加个前缀,如 register int i; 100014B1 |. A1 B4BB5F00 mov eax, dword ptr [5FBBB4] 100014BC |. 8B08 mov ecx, dword ptr [eax] 100014BE |. 8B91 98000000 mov edx, dword ptr [ecx+98] 100014C4 |. 8B8F 80000000 mov ecx, dword ptr [edi+80] 100014CA |. 8B42 10 mov eax, dword ptr [edx+10] 100014CD |. 8B80 30060000 mov eax, dword ptr [eax+630] |
|
[求助]VC内联汇编的问题[已解决]
////C语言版编译后的代码 10001ACD |. C745 F4 C6000>MOV DWORD PTR SS:[EBP-C],0C6 10001AD4 |. A1 B4BB5F00 MOV EAX,DWORD PTR DS:[5FBBB4] 10001AD9 |. 8945 F8 MOV DWORD PTR SS:[EBP-8],EAX 10001ADC |. 8B4D F8 MOV ECX,DWORD PTR SS:[EBP-8] 10001ADF |. 8B11 MOV EDX,DWORD PTR DS:[ECX] 10001AE1 |. 8955 F8 MOV DWORD PTR SS:[EBP-8],EDX 10001AE4 |. 8B45 F8 MOV EAX,DWORD PTR SS:[EBP-8] 10001AE7 |. 8B88 98000000 MOV ECX,DWORD PTR DS:[EAX+98] 10001AED |. 894D F8 MOV DWORD PTR SS:[EBP-8],ECX 10001AF0 |. 8B55 F8 MOV EDX,DWORD PTR SS:[EBP-8] 10001AF3 |. 8B42 10 MOV EAX,DWORD PTR DS:[EDX+10] 10001AF6 |. 8945 F8 MOV DWORD PTR SS:[EBP-8],EAX 10001AF9 |. 8B4D F4 MOV ECX,DWORD PTR SS:[EBP-C] 10001AFC |. 8B55 F8 MOV EDX,DWORD PTR SS:[EBP-8] 10001AFF |. 8B04CA MOV EAX,DWORD PTR DS:[EDX+ECX*8] 10001B02 |. 8945 F8 MOV DWORD PTR SS:[EBP-8],EAX 10001B05 |. 8B4D F8 MOV ECX,DWORD PTR SS:[EBP-8] 10001B08 |. 894D F0 MOV DWORD PTR SS:[EBP-10],ECX 10001B0B |. 8B55 F0 MOV EDX,DWORD PTR SS:[EBP-10] 10001B0E |. 52 PUSH EDX 10001B0F |. 8B4D FC MOV ECX,DWORD PTR SS:[EBP-4] 10001B12 |. 83C1 60 ADD ECX,60 10001B15 |. E8 96030000 CALL ildll.?AddString@CListBox@@QAEHPBD@Z ; JMP 到 MFC42D.#1021 /////内联汇编汇编后的代码 10001B1A |. BE C7000000 MOV ESI,0C7 10001B1F |. B8 B4BB5F00 MOV EAX,5FBBB4 10001B24 |. 8B00 MOV EAX,DWORD PTR DS:[EAX] 10001B26 |. 8B00 MOV EAX,DWORD PTR DS:[EAX] 10001B28 |. 8B80 98000000 MOV EAX,DWORD PTR DS:[EAX+98] 10001B2E |. 8B40 10 MOV EAX,DWORD PTR DS:[EAX+10] 10001B31 |. 8B04F0 MOV EAX,DWORD PTR DS:[EAX+ESI*8] 10001B34 |. 8945 F0 MOV DWORD PTR SS:[EBP-10],EAX 10001B37 |. 8B45 F0 MOV EAX,DWORD PTR SS:[EBP-10] 10001B3A |. 50 PUSH EAX 10001B3B |. 8B4D FC MOV ECX,DWORD PTR SS:[EBP-4] 10001B3E |. 83C1 60 ADD ECX,60 10001B41 |. E8 6A030000 CALL ildll.?AddString@CListBox@@QAEHPBD@Z ; JMP 到 MFC42D.#1021 |
|
[求助]VC内联汇编的问题[已解决]
已解决,2个原因 1.内联汇编的mov eax,[0x5fbbb4] 的就是 mov eax,0x5fbbb4 要从内存取数,改成 mov eax, 0x5fbbb4 mov eax, [eax] 2.我计算偏移地址出错,后面的地址指向无效址 下面是读内存数据的C语言版 和 汇编语言版 实现从[[[[[[005fbbb4]+0]+98]+10]+8*n]+0]中读取一个字符串 //第n条[[[[[[005fbbb4]+0]+98]+10]+8*n]+0] int i; int n=198; char *s; /////////////////////内存读取开始C语言 i=(int)*(int *)(0x5fbbb4); i=(int)*(int *)(i+0); i=(int)*(int *)(i+0x98); i=(int)*(int *)(i+0x10); i=(int)*(int *)(i+8*n); //字符串类型 s=(char *)(i); /////////////////////内存读取结束 this->m_list.AddString(s); /////////////////////内存读取开始 内联汇编 _asm{ mov esi, 199 //mov eax, [0x5fbbb4] mov eax, 0x5fbbb4 mov eax, [eax] mov eax, [eax+0] mov eax, [eax+0x98] mov eax, [eax+0x10] mov eax, [eax+8*esi] mov s,eax } /////////////////////内存读取结束 this->m_list.AddString(s); |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值