📄 pcidp.cod
字号:
0004f 8b 40 60 mov eax, DWORD PTR [eax+96]
00052 8b 40 18 mov eax, DWORD PTR [eax+24]
00055 3b 41 18 cmp eax, DWORD PTR [ecx+24]
00058 75 5b jne SHORT $L8550
; 581 : IoAcquireCancelSpinLock (&CancelSpin);
0005a 8d 45 f0 lea eax, DWORD PTR _CancelSpin$[ebp]
0005d 50 push eax
0005e ff 15 00 00 00
00 call DWORD PTR __imp__IoAcquireCancelSpinLock@4
; 582 : Interrupt->Irp->Cancel = TRUE;
00064 8b 45 08 mov eax, DWORD PTR _Interrupt$[ebp]
00067 8b 40 04 mov eax, DWORD PTR [eax+4]
0006a c6 40 24 01 mov BYTE PTR [eax+36], 1
; 583 : //Interrupt->Irp->CancelIrql = CancelSpin;
; 584 : Interrupt->Irp->CancelRoutine = NULL;
0006e 8b 45 08 mov eax, DWORD PTR _Interrupt$[ebp]
00071 8b 40 04 mov eax, DWORD PTR [eax+4]
00074 83 60 38 00 and DWORD PTR [eax+56], 0
; 585 : Interrupt->Irp->IoStatus.Status = STATUS_CANCELLED;
00078 8b 45 08 mov eax, DWORD PTR _Interrupt$[ebp]
0007b 8b 40 04 mov eax, DWORD PTR [eax+4]
0007e c7 40 18 20 01
00 c0 mov DWORD PTR [eax+24], -1073741536 ; c0000120H
; 586 : Interrupt->Irp->IoStatus.Information = 0;
00085 8b 45 08 mov eax, DWORD PTR _Interrupt$[ebp]
00088 8b 40 04 mov eax, DWORD PTR [eax+4]
0008b 83 60 1c 00 and DWORD PTR [eax+28], 0
; 587 : IoReleaseCancelSpinLock (CancelSpin);
0008f ff 75 f0 push DWORD PTR _CancelSpin$[ebp]
00092 ff d6 call esi
; 588 : IoReleaseCancelSpinLock (Interrupt->Irp->CancelIrql);
00094 8b 45 08 mov eax, DWORD PTR _Interrupt$[ebp]
00097 8b 40 04 mov eax, DWORD PTR [eax+4]
0009a 8a 40 25 mov al, BYTE PTR [eax+37]
0009d 50 push eax
0009e ff d6 call esi
; 589 :
; 590 : IoCompleteRequest(Interrupt->Irp, IO_NO_INCREMENT);
000a0 8b 45 08 mov eax, DWORD PTR _Interrupt$[ebp]
000a3 32 d2 xor dl, dl
000a5 8b 48 04 mov ecx, DWORD PTR [eax+4]
000a8 ff d3 call ebx
; 591 : FreeEntry(ObjExt, CurrentLink);
000aa ff 75 fc push DWORD PTR _CurrentLink$[ebp]
000ad 57 push edi
000ae e8 00 00 00 00 call _FreeEntry@8
; 592 : }
; 593 : else
000b3 eb 09 jmp SHORT $L8553
$L8550:
; 594 : PutBackEntry(ObjExt, CurrentLink);
000b5 ff 75 fc push DWORD PTR _CurrentLink$[ebp]
000b8 57 push edi
000b9 e8 00 00 00 00 call _PutBackEntry@8
$L8553:
000be 8d 45 08 lea eax, DWORD PTR _Interrupt$[ebp]
000c1 50 push eax
000c2 8d 45 fc lea eax, DWORD PTR _CurrentLink$[ebp]
000c5 50 push eax
000c6 8d 45 f8 lea eax, DWORD PTR _FirstLink$[ebp]
000c9 50 push eax
000ca 57 push edi
000cb e8 00 00 00 00 call _GetNextEntry@16
000d0 3c 01 cmp al, 1
000d2 0f 84 6e ff ff
ff je $L8548
; 575 : FirstLink = NULL;
; 576 : while(GetNextEntry(ObjExt, &FirstLink, &CurrentLink, &Interrupt) == TRUE){
000d8 8b 75 0c mov esi, DWORD PTR _Irp$[ebp]
$L8549:
; 595 : }
; 596 :
; 597 : Irp->IoStatus.Information = 0;
000db 83 66 1c 00 and DWORD PTR [esi+28], 0
; 598 : Irp->IoStatus.Status = STATUS_SUCCESS;
000df 83 66 18 00 and DWORD PTR [esi+24], 0
; 599 : IoCompleteRequest (Irp, IO_NO_INCREMENT);
000e3 32 d2 xor dl, dl
000e5 8b ce mov ecx, esi
000e7 ff d3 call ebx
000e9 5f pop edi
000ea 5e pop esi
; 600 :
; 601 : return STATUS_SUCCESS;
000eb 33 c0 xor eax, eax
000ed 5b pop ebx
; 602 : }
000ee c9 leave
000ef c2 08 00 ret 8
_PCIDPCleanup@8 ENDP
_TEXT ENDS
; COMDAT _PCIDPUnload@4
_TEXT SEGMENT
_PCIDPUnload@4 PROC NEAR ; COMDAT
; 613 :
; 614 : // Debug entry point
; 615 : //DbgPrint("[PCIDP]->Entering Unload...\n"); //debug
; 616 : //DbgBreakPoint(); //debug
; 617 :
; 618 : return STATUS_SUCCESS;
00000 33 c0 xor eax, eax
; 619 : }
00002 c2 04 00 ret 4
_PCIDPUnload@4 ENDP
_TEXT ENDS
PUBLIC _PCIDPCancelInterrupt@8
; COMDAT _PCIDPCancelInterrupt@8
_TEXT SEGMENT
_DeviceObject$ = 8
_Irp$ = 12
_Interrupt$ = -4
_CurrentLink$ = 8
_FirstLink$ = -8
_PCIDPCancelInterrupt@8 PROC NEAR ; COMDAT
; 630 : ){
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 51 push ecx
00004 51 push ecx
; 631 : // Define variables.
; 632 : PPCIDP_EXTENSION ObjExt;
; 633 : PREGISTERED_INTERRUPT Interrupt;
; 634 : PLINKED_LIST CurrentLink;
; 635 : PLINKED_LIST FirstLink;
; 636 :
; 637 : // Debug entry point
; 638 : //DbgPrint("[PCIDP]->Entering CancelInterrupt...\n"); //debug
; 639 : //DbgBreakPoint(); //debug
; 640 :
; 641 : // Initialize variables.
; 642 : ObjExt = (PPCIDP_EXTENSION)DeviceObject->DeviceExtension;
00005 8b 45 08 mov eax, DWORD PTR _DeviceObject$[ebp]
00008 56 push esi
00009 57 push edi
; 643 :
; 644 : // Search the driver's events linked list for an entry containing the
; 645 : // user provided Irp.
; 646 : CurrentLink = NULL;
0000a 83 65 08 00 and DWORD PTR _CurrentLink$[ebp], 0
0000e 8b 70 28 mov esi, DWORD PTR [eax+40]
; 647 : FirstLink = NULL;
; 648 : while(GetNextEntry(ObjExt, &FirstLink, &CurrentLink, &Interrupt) == TRUE){
00011 8d 45 fc lea eax, DWORD PTR _Interrupt$[ebp]
00014 83 65 f8 00 and DWORD PTR _FirstLink$[ebp], 0
00018 50 push eax
00019 8d 45 08 lea eax, DWORD PTR _CurrentLink$[ebp]
0001c 50 push eax
0001d 8d 45 f8 lea eax, DWORD PTR _FirstLink$[ebp]
00020 50 push eax
00021 56 push esi
00022 e8 00 00 00 00 call _GetNextEntry@16
00027 8b 7d 0c mov edi, DWORD PTR _Irp$[ebp]
0002a 3c 01 cmp al, 1
0002c 75 2e jne SHORT $L8574
$L8573:
; 649 :
; 650 : // Delete its linked list entry.
; 651 : if(Irp == Interrupt->Irp){
0002e 8b 45 fc mov eax, DWORD PTR _Interrupt$[ebp]
; 653 : break;
; 654 : }
; 655 : else
; 656 : PutBackEntry(ObjExt, CurrentLink);
00031 ff 75 08 push DWORD PTR _CurrentLink$[ebp]
00034 3b 78 04 cmp edi, DWORD PTR [eax+4]
00037 56 push esi
00038 74 1d je SHORT $L8736
0003a e8 00 00 00 00 call _PutBackEntry@8
0003f 8d 45 fc lea eax, DWORD PTR _Interrupt$[ebp]
00042 50 push eax
00043 8d 45 08 lea eax, DWORD PTR _CurrentLink$[ebp]
00046 50 push eax
00047 8d 45 f8 lea eax, DWORD PTR _FirstLink$[ebp]
0004a 50 push eax
0004b 56 push esi
0004c e8 00 00 00 00 call _GetNextEntry@16
00051 3c 01 cmp al, 1
00053 74 d9 je SHORT $L8573
; 649 :
; 650 : // Delete its linked list entry.
; 651 : if(Irp == Interrupt->Irp){
00055 eb 05 jmp SHORT $L8574
$L8736:
; 652 : FreeEntry(ObjExt, CurrentLink);
00057 e8 00 00 00 00 call _FreeEntry@8
$L8574:
; 657 : }
; 658 :
; 659 : //IoReleaseCancelSpinLock (Irp->CancelIrql);
; 660 : Irp->IoStatus.Information = 0;
0005c 83 67 1c 00 and DWORD PTR [edi+28], 0
; 661 : Irp->IoStatus.Status = STATUS_CANCELLED;
; 662 : IoCompleteRequest(Irp, IO_NO_INCREMENT) ;
00060 32 d2 xor dl, dl
00062 8b cf mov ecx, edi
00064 c7 47 18 20 01
00 c0 mov DWORD PTR [edi+24], -1073741536 ; c0000120H
0006b ff 15 00 00 00
00 call DWORD PTR __imp_@IofCompleteRequest@8
00071 5f pop edi
00072 5e pop esi
; 663 : }
00073 c9 leave
00074 c2 08 00 ret 8
_PCIDPCancelInterrupt@8 ENDP
_TEXT ENDS
PUBLIC _PCIDPForDpcIsr@16
EXTRN __imp_@InterlockedExchange@8:NEAR
; COMDAT _PCIDPForDpcIsr@16
_TEXT SEGMENT
_DeviceObject$ = 12
_RegisteredInt$ = 12
_CancelSpin$ = -12
_CurrentLink$ = -4
_FirstLink$ = -8
_PCIDPForDpcIsr@16 PROC NEAR ; COMDAT
; 675 : ){
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 83 ec 0c sub esp, 12 ; 0000000cH
; 676 : // Define variables.
; 677 : PPCIDP_EXTENSION ObjExt;
; 678 : PINTERRUPT_DATA IntData;
; 679 : PREGISTERED_INTERRUPT RegisteredInt;
; 680 : KIRQL CancelSpin;
; 681 : PLINKED_LIST CurrentLink;
; 682 : PLINKED_LIST FirstLink;
; 683 :
; 684 : // Debug
; 685 : //PULONG MemoryBase;
; 686 :
; 687 : // Initialize variables.
; 688 : ObjExt = (PPCIDP_EXTENSION)DeviceObject->DeviceExtension;
00006 8b 45 0c mov eax, DWORD PTR _DeviceObject$[ebp]
00009 56 push esi
0000a 8b 70 28 mov esi, DWORD PTR [eax+40]
; 689 : IntData = &ObjExt->InterruptData;
; 690 :
; 691 :
; 692 : // Debug
; 693 : //MemoryBase = ObjExt->MemoryBase;
; 694 : //MemoryBase[0x1C53]++;
; 695 :
; 696 : //Service all of the recorded interrupts by checking to see if the interrupt
; 697 : //type has been registered by the user.
; 698 : while(IntData->QueNew != IntData->QueNext){
0000d 8a 46 25 mov al, BYTE PTR [esi+37]
00010 3a 46 24 cmp al, BYTE PTR [esi+36]
00013 0f 84 a1 00 00
00 je $L8596
00019 53 push ebx
0001a 33 db xor ebx, ebx
$L8595:
; 699 :
; 700 : // Debug
; 701 : //MemoryBase[0x1C54]++;
; 702 :
; 703 : CurrentLink = NULL;
0001c 89 5d fc mov DWORD PTR _CurrentLink$[ebp], ebx
; 704 : FirstLink = NULL;
0001f 89 5d f8 mov DWORD PTR _FirstLink$[ebp], ebx
$L8742:
; 705 : while(GetNextEntry(ObjExt, &FirstLink, &CurrentLink, &RegisteredInt) == TRUE){
00022 8d 45 0c lea eax, DWORD PTR _RegisteredInt$[ebp]
00025 50 push eax
00026 8d 45 fc lea eax, DWORD PTR _CurrentLink$[ebp]
00029 50 push eax
0002a 8d 45 f8 lea eax, DWORD PTR _FirstLink$[ebp]
0002d 50 push eax
0002e 56 push esi
0002f e8 00 00 00 00 call _GetNextEntry@16
00034 3c 01 cmp al, 1
00036 75 69 jne SHORT $L8601
; 706 :
; 707 : // Debug
; 708 : //MemoryBase[0x1C55]++;
; 709 :
; 710 : if(IntData->Type[IntData->QueNew] == RegisteredInt->Type){
00038 0f b6 46 25 movzx eax, BYTE PTR [esi+37]
0003c 8b 4d 0c mov ecx, DWORD PTR _RegisteredInt$[ebp]
0003f 8b 44 86 28 mov eax, DWORD PTR [esi+eax*4+40]
00043 3b 01 cmp eax, DWORD PTR [ecx]
00045 75 4f jne SHORT $L8602
; 711 :
; 712 : // Debug
; 713 : //MemoryBase[0x1C56]++;
; 714 :
; 715 : // Found an entry. Disable the cancel routine, complete the I/O for
; 716 : // this IRP, then delete the linked list entry.
; 717 : IoAcquireCancelSpinLock (&CancelSpin);
00047 8d 45 f4 lea eax, DWORD PTR _CancelSpin$[ebp]
0004a 50 push eax
0004b ff 15 00 00 00
00 call DWORD PTR __imp__IoAcquireCancelSpinLock@4
; 718 : IoSetCancelRoutine(RegisteredInt->Irp, NULL);
00051 8b 45 0c mov eax, DWORD PTR _RegisteredInt$[ebp]
00054 33 d2 xor edx, edx
00056 8b 48 04 mov ecx, DWORD PTR [eax+4]
00059 83 c1 38 add ecx, 56 ; 00000038H
0005c ff 15 00 00 00
00 call DWORD PTR __imp_@InterlockedExchange@8
; 719 : IoReleaseCancelSpinLock (CancelSpin);
00062 ff 75 f4 push DWORD PTR _CancelSpin$[ebp]
00065 ff 15 00 00 00
00 call DWORD PTR __imp__IoReleaseCancelSpinLock@4
; 720 : RegisteredInt->Irp->IoStatus.Status = STATUS_SUCCESS ;
0006b 8b 45 0c mov eax, DWORD PTR _RegisteredInt$[ebp]
; 721 : RegisteredInt->Irp->IoStatus.Information = 0 ;
; 722 : IoCompleteRequest(RegisteredInt->Irp, IO_NO_INCREMENT);
0006e 32 d2 xor dl, dl
00070 8b 40 04 mov eax, DWORD PTR [eax+4]
00073 89 58 18 mov DWORD PTR [eax+24], ebx
00076 8b 45 0c mov eax, DWORD PTR _RegisteredInt$[ebp]
00079 8b 40 04 mov eax, DWORD PTR [eax+4]
0007c 89 58 1c mov DWORD PTR [eax+28], ebx
0007f 8b 45 0c mov eax, DWORD PTR _RegisteredInt$[ebp]
00082 8b 48 04 mov ecx, DWORD PTR [eax+4]
00085 ff 15 00 00 00
00 call DWORD PTR __imp_@IofCompleteRequest@8
; 723 :
; 724 : FreeEntry(ObjExt, CurrentLink);
0008b ff 75 fc push DWORD PTR _CurrentLink$[ebp]
0008e 56 push esi
0008f e8 00 00 00 00 call _FreeEntry@8
; 725 : }
; 726 : else
00094 eb 8c jmp SHORT $L8742
$L8602:
; 727 : PutBackEntry(ObjExt, CurrentLink);
00096 ff 75 fc push DWORD PTR _CurrentLink$[ebp]
00099 56 push esi
0009a e8 00 00 00 00 call _PutBackEntry@8
0009f eb 81 jmp SHORT $L8742
$L8601:
; 728 : }
; 729 :
; 730 : IntData->QueNew++;
000a1 fe 46 25 inc BYTE PTR [esi+37]
; 731 : if(IntData->QueNew == InterruptQueSize) IntData->QueNew = 0;
000a4 80 7e 25 10 cmp BYTE PTR [esi+37], 16 ; 00000010H
000a8 75 03 jne SHORT $L8612
000aa 88 5e 25 mov BYTE PTR [esi+37], bl
$L8612:
; 689 : IntData = &ObjExt->InterruptData;
; 690 :
; 691 :
; 692 : // Debug
; 693 : //MemoryBase = ObjExt->MemoryBase;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -