|
|
|
如何让函数内的一个标号变成全局有效?
感谢楼上錒,学了下远程注入的东东. 不过我的应用环境跟你有点不一样.为什么我说 自定位来不及呢? 我的目的是劫持kbdclass的回调例程,在它之前做一些自己的处理 NTSTATUS DriverEntry ( PDRIVER_OBJECT DriverObject, PUNICODE_STRING registerPath ) { xxxx ................................... 代码A处 /*这里是把i8042prtdeviceextension结构里指向KeyboardClassServiceCallback的指针改成指向MyKeyboardClassServiceCallback*/ _asm push eax _asm push ebx _asm mov eax,gkbdCallBack.AddressStoreCallBack _asm mov ebx,MyKeyboardClassServiceCallback _asm mov dword ptr[eax],ebx _asm pop ebx _asm pop eax ........................................ xxxxx return STATUS_SUCCESS; MyKeyboardClassServiceCallback: _asm pushad _asm xor ecx,ecx _asm mov esi,[esp+28h] _asm mov ecx,[esp+2ch] _asm sub ecx,esi _asm push ecx _asm push esi _asm call MyWriteCircleBuff _asm popad _asm jmp gkbdCallBack.serviceCallBack } 我只需要在我的驱动里面有空间容纳我的处理代码(红色部分)就行了,刚开始是想弄个函数把处理代码放在函数里面,但里面的标号是局部的,没办法弄成全局,所以出帖向大家请教.用自定位的确是可以把这个标号的地址保存到一个全局变量里, VOID MyKeyboardClassServiceCallbackMom() { MyKeyboardClassServiceCallback: _asm call Next Next: _asm pop ebx ...... _asm mov GdbTab,ebx _asm pushad _asm mov esi,[esp+28h] _asm mov ecx,[esp+2ch] _asm sub ecx,eax _asm lea edi,KeyBoardBuff _asm rep movsb _asm popad _asm jmp gkbdCallBack.serviceCallBack }; 但我要得到这个全局标号的前提是这段代码要先于代码A处运行(代码A那里就要用到这个标号).那这个函数就要先跑一遍,但我现在这样的情况...这函数不管怎么弄,一跑肯定蓝屏..所以我说自定位来不及. |
|
如何让函数内的一个标号变成全局有效?
自定位来不及,在未运行到自定位就要用这个标号,只有在入口函数末尾把代码放上去,不用函数形式了. |
|
[分享]也是静态注入
能不能不改变节的属性.... |
|
[分享]也是静态注入
偶编译不了,通不过,问下,如果节之间空隙足够,你的注入会改变其中节的属性不?比如....代码节被加了个可写属性 |
|
[求助]MmIsAddressValid 当前DDK版本不支持
的确好用,非常感谢,用了之后才知道,这个函数返回的MmIsAddressValid和从ntoskernel导出来的函数不一样...我倒! |
|
[求助]MmIsAddressValid 当前DDK版本不支持
MmGetSystemRoutineAddress动态调用。 用用看 |
|
[求助]IoSetCompletionRoutine
没想到跟踪这个过程的好方法..再琢磨琢磨 |
|
[求助]求证ObReferenceObjectByName函数增加引用的对象
我想也是,,,多谢楼上錒 |
|
[求助]MmIsAddressValid 当前DDK版本不支持
额...自己用内联汇编做了个 BOOLEAN _stdcall MmIsAddressValid (PVOID VirtualAddress) { _asm mov ecx, [ebp+8] _asm mov eax, ecx _asm shr eax, 14h _asm mov edx, 0FFCh _asm and eax, edx _asm sub eax, 3FD00000h _asm mov eax, [eax] _asm test al, 1 _asm jz loc_41EDC7 _asm test al, al _asm js loc_40AFA1 _asm shr ecx, 0Ah _asm and ecx, 3FFFFCh _asm sub ecx, 40000000h _asm mov eax, ecx _asm mov ecx, [eax] _asm test cl, 1 _asm jz loc_41EDC7 _asm test cl, cl _asm js loc_44F176 _asm jmp loc_40AFA1 loc_44F176: _asm and eax, edx _asm mov eax, [eax-3FD00000h] _asm and ax, 81h _asm cmp al, 81h _asm jnz loc_40AFA1 _asm jmp loc_41EDC7 loc_40AFA1: _asm mov al, 1 _asm jmp loc_40AFA3 loc_41EDC7: _asm xor al, al loc_40AFA3: _asm nop } 可7600.16385.0版本的DDK编译环境为啥不支持 _asm ( ***** )形式的内联..一直是编译错误,疑惑錒 |
|
[求助]IoSetCompletionRoutine
我还有点没有想明白: 就是在完成例程中对pending的处理 ..... if (Irp->PendingReturned) { IoMarkIrpPending (Irp); } return STATUS_CONTINUE_COMPLETION; } 既然此IRP已经被下层用IoCompleteRequest给结束了,完成例程也完成了自己的任务.既然本层所有工作都完成了,该返回上层了..为啥还要把Irp设置成pending?还要让上层的iocalldriver(假设是同步IRP)返回status_pending??? |
|
|
|
[求助]IoSetCompletionRoutine
装个vmware沙 |
|
[讨论]利用异常做修复与跳转
玩命大哥,能不能透露下QQ群号 |
|
[求助]IoSetCompletionRoutine
原以为IoSetCompletionRoutine设置的完成例程被放在了下一层的io_stack_location中,当完成例程被调用时,它的输入参数会对应于下一层的deviceobject,IO_STACK_LOCATION也对应着下一层,所以始终理解不了. 今天特意用windbg跟踪了一下,虽然完成例程被放在了下一层的io_stack_location,但调用它时,它的输入参数依然时本层的deviceobject,它使用的io_stack_location依然对应的是本层的.这样就能理解通了, 谢谢onepc一起讨论 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值