Pomogite rzobrat'sya s IoCopyCurrentIrpStackLocationToNext. Eto macros: Код (Text): #define IoCopyCurrentIrpStackLocationToNext( Irp ) { \ PIO_STACK_LOCATION irpSp; \ PIO_STACK_LOCATION nextIrpSp; \ irpSp = IoGetCurrentIrpStackLocation( (Irp) ); \ nextIrpSp = IoGetNextIrpStackLocation( (Irp) ); \ RtlCopyMemory( nextIrpSp, irpSp, FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine)); \ nextIrpSp->Control = 0; } A vot uchastok koda asm Код (Text): PAGE:00001D98 mov esi, [ebx+60h] PAGE:00001D9B lea edx, [esi-24h] PAGE:00001D9E push 7 PAGE:00001DA0 pop ecx PAGE:00001DA1 mov edi, edx PAGE:00001DA3 rep movsd PAGE:00001DA5 mov byte ptr [edx+3], 0 PAGE:00001DA9 mov ecx, [ebx+60h] PAGE:00001DAC sub ecx, 24h ; '$' eto na skolko ya ponimayu IoGetNextIrpStackLocation( (Irp) ); , a gde je memcpy? PAGE:00001DA9 mov ecx, [ebx+60h] PAGE:00001DAC sub ecx, 24h ; '$' pomogite, a to u memya uje golova ne varit. Esli mojno, postrojnii razbor asm-koda. Zaranie spasibo.
Код (Text): PAGE:00001D7A loc_1D7A: ; CODE XREF: SpyFsControlMountVolume(x,x)+C5j PAGE:00001D7A mov ecx, [ebp+arg_0] PAGE:00001D7D mov [eax], ecx PAGE:00001D7F mov [eax+4], edi PAGE:00001D82 mov dword ptr [eax+0Ch], offset _SpyFsControlMountVolumeCompleteWorker@4 ; SpyFsControlMountVolumeCompleteWorker(x) PAGE:00001D89 mov [eax+10h], eax PAGE:00001D8C mov [eax+14h], esi PAGE:00001D8F mov [eax+18h], ebx PAGE:00001D92 mov ecx, [ebp+arg_4] PAGE:00001D95 mov [eax+1Ch], ecx PAGE:00001D98 mov esi, [ebx+60h] PAGE:00001D9B lea edx, [esi-24h] PAGE:00001D9E push 7 PAGE:00001DA0 pop ecx PAGE:00001DA1 mov edi, edx PAGE:00001DA3 rep movsd PAGE:00001DA5 mov byte ptr [edx+3], 0 [b]PAGE:00001DA9 mov ecx, [ebx+60h] PAGE:00001DAC sub ecx, 24h ; '$' [/b]PAGE:00001DAF mov dword ptr [ecx+1Ch], offset _SpyFsControlCompletion@12 ; SpyFsControlCompletion(x,x,x) PAGE:00001DB6 mov [ecx+20h], eax PAGE:00001DB9 mov byte ptr [ecx+3], 0E0h ; 'ð' PAGE:00001DBD PAGE:00001DBD loc_1DBD: ; CODE XREF: SpyFsControlMountVolume(x,x)+CEj PAGE:00001DBD mov eax, [ebp+var_4] PAGE:00001DC0 mov ecx, [eax+4] PAGE:00001DC3 mov edx, ebx PAGE:00001DC5 call dword ptr ds:__imp_@IofCallDriver@8 ; __declspec(dllimport) IofCallDriver(x,x)
a eto na C/C++ uchastok koda: Код (Text): completionContext->RecordList = recordList; ExInitializeWorkItem( &completionContext->WorkItem, SpyFsControlMountVolumeCompleteWorker, completionContext ); completionContext->DeviceObject = DeviceObject, completionContext->Irp = Irp; completionContext->NewDeviceObject = newDeviceObject; IoCopyCurrentIrpStackLocationToNext ( Irp ); IoSetCompletionRoutine( Irp, SpyFsControlCompletion, completionContext, //context parameter TRUE, TRUE, TRUE ); status = IoCallDriver( devExt->AttachedToDeviceObject, Irp );
Код (Text): PAGE:00001DA9 mov ecx, [ebx+60h] PAGE:00001DAC sub ecx, 24h ; '$' Да, это IoGetNextIrpStackLocation <font color="gray][ LuckyDevil</font><!--color--><font color="gray]: a gde je memcpy ]</font><!--color--> rep movsd <font color="gray][ LuckyDevil</font><!--color--><font color="gray]: Esli mojno, postrojnii razbor asm-koda. ]</font><!--color--> В KmdKit почаще заглядывай. Код (Text): IoCopyCurrentIrpStackLocationToNext MACRO pIrp:REQ push esi push edi mov eax, pIrp mov esi, (_IRP PTR [eax]).Tail.Overlay.CurrentStackLocation mov edx, (_IRP PTR [eax]).Tail.Overlay.CurrentStackLocation sub edx, sizeof IO_STACK_LOCATION mov edi, edx mov ecx, sizeof IO_STACK_LOCATION rep movsb and (IO_STACK_LOCATION PTR [edx]).Control, 0 and (IO_STACK_LOCATION PTR [edx]).CompletionRoutine, 0 and (IO_STACK_LOCATION PTR [edx]).Context, 0 pop edi pop esi ENDM