📄 pcidpprivate.asm
字号:
; 357 : }
; 358 : *CurrentLink = CurrentLnk;
mov DWORD PTR [eax], ecx
$GetNextExit$8555:
; 359 : }
; 360 :
; 361 : GetNextExit:
; 362 : //ObjExt->MemoryBase[0x1C57] = ObjExt->LLData.InsertedCount; //debug
; 363 : KeReleaseSpinLock(&ObjExt->LListSpin, LListIrql);
mov dl, BYTE PTR _LListIrql$[ebp]
mov ecx, ebx
call DWORD PTR __imp_@KfReleaseSpinLock@8
; 364 :
; 365 : return Status;
mov al, BYTE PTR _Status$[ebp]
pop edi
pop esi
pop ebx
; 366 : }
leave
ret 16 ; 00000010H
_GetNextEntry@16 ENDP
_TEXT ENDS
PUBLIC _PutBackEntry@8
; COMDAT _PutBackEntry@8
_TEXT SEGMENT
_ObjExt$ = 8
_CurrentLink$ = 12
_PutBackEntry@8 PROC NEAR ; COMDAT
; 369 : BOOLEAN PutBackEntry(PPCIDP_EXTENSION ObjExt, PLINKED_LIST CurrentLink){
push ebx
push esi
; 370 :
; 371 : BOOLEAN Status;
; 372 : KIRQL LListIrql;
; 373 :
; 374 : KeAcquireSpinLock(&ObjExt->LListSpin, &LListIrql);
mov esi, DWORD PTR _ObjExt$[esp+4]
push edi
lea edi, DWORD PTR [esi+116]
mov ecx, edi
call DWORD PTR __imp_@KfAcquireSpinLock@4
; 375 : if(CurrentLink->Status == LL_CHECKEDOUT){
mov ecx, DWORD PTR _CurrentLink$[esp+8]
cmp BYTE PTR [ecx+8], 4
jne SHORT $L8569
; 376 : CurrentLink->Status = LL_INSERTED;
mov BYTE PTR [ecx+8], 2
; 377 : ObjExt->LLData.InsertedCount++;
inc WORD PTR [esi+106]
; 378 : Status = TRUE;
mov bl, 1
; 379 : }
; 380 : else
jmp SHORT $L8570
$L8569:
; 381 : Status = FALSE;
xor bl, bl
$L8570:
; 382 :
; 383 : KeReleaseSpinLock(&ObjExt->LListSpin, LListIrql);
mov dl, al
mov ecx, edi
call DWORD PTR __imp_@KfReleaseSpinLock@8
pop edi
; 384 : //ObjExt->MemoryBase[0x1C57] = ObjExt->LLData.InsertedCount;//debug
; 385 : //ObjExt->MemoryBase[0x1C58]++;//debug
; 386 : return Status;
mov al, bl
pop esi
pop ebx
; 387 : }
ret 8
_PutBackEntry@8 ENDP
_TEXT ENDS
PUBLIC _FreeEntry@8
; COMDAT _FreeEntry@8
_TEXT SEGMENT
_ObjExt$ = 8
_CurrentLink$ = 12
_FreeEntry@8 PROC NEAR ; COMDAT
; 390 : BOOLEAN FreeEntry(PPCIDP_EXTENSION ObjExt, PLINKED_LIST CurrentLink){
push ebx
push esi
; 391 :
; 392 : BOOLEAN Status;
; 393 : KIRQL LListIrql;
; 394 :
; 395 : KeAcquireSpinLock(&ObjExt->LListSpin, &LListIrql);
mov esi, DWORD PTR _ObjExt$[esp+4]
push edi
lea edi, DWORD PTR [esi+116]
mov ecx, edi
call DWORD PTR __imp_@KfAcquireSpinLock@4
; 396 : if(CurrentLink->Status == LL_CHECKEDOUT || CurrentLink->Status == LL_ACQUIRED){
mov ecx, DWORD PTR _CurrentLink$[esp+8]
mov bl, BYTE PTR [ecx+8]
cmp bl, 4
je SHORT $L8579
cmp bl, 1
je SHORT $L8579
; 400 : }
; 401 : else
; 402 : Status = FALSE;
xor bl, bl
jmp SHORT $L8580
$L8579:
; 397 : CurrentLink->Status = LL_AVAILABLE;
mov BYTE PTR [ecx+8], 3
; 398 : ObjExt->LLData.CurrentLink = CurrentLink->Prev;
mov ecx, DWORD PTR [ecx+4]
mov DWORD PTR [esi+112], ecx
; 399 : Status = TRUE;
mov bl, 1
$L8580:
; 403 :
; 404 : KeReleaseSpinLock(&ObjExt->LListSpin, LListIrql);
mov dl, al
mov ecx, edi
call DWORD PTR __imp_@KfReleaseSpinLock@8
pop edi
; 405 : //ObjExt->MemoryBase[0x1C59]++;//debug
; 406 :
; 407 : return Status;
mov al, bl
pop esi
pop ebx
; 408 : }
ret 8
_FreeEntry@8 ENDP
_TEXT ENDS
PUBLIC _GetFreeEntry@4
EXTRN __imp__ExAllocatePoolWithTag@12:NEAR
; COMDAT _GetFreeEntry@4
_TEXT SEGMENT
_ObjExt$ = 8
_GetFreeEntry@4 PROC NEAR ; COMDAT
; 411 : PLINKED_LIST GetFreeEntry(PPCIDP_EXTENSION ObjExt){
push ebp
mov ebp, esp
push ebx
push esi
; 412 :
; 413 : PLINKED_LIST FirstLink;
; 414 : PLINKED_LIST ReturnLink = NULL;
; 415 : KIRQL LListIrql;
; 416 :
; 417 : KeAcquireSpinLock(&ObjExt->LListSpin, &LListIrql);
mov esi, DWORD PTR _ObjExt$[ebp]
push edi
xor ebx, ebx
lea ecx, DWORD PTR [esi+116]
mov DWORD PTR 8+[ebp], ecx
call DWORD PTR __imp_@KfAcquireSpinLock@4
; 418 : if(ObjExt->LLData.IsEmpty == FALSE) {
cmp BYTE PTR [esi+104], bl
jne SHORT $L8591
; 419 : FirstLink = ObjExt->LLData.CurrentLink;
mov edi, DWORD PTR [esi+112]
; 420 : do{
; 421 : ObjExt->LLData.CurrentLink = ObjExt->LLData.CurrentLink->Next;
mov ecx, DWORD PTR [edi]
$L8707:
mov DWORD PTR [esi+112], ecx
; 422 : if(ObjExt->LLData.CurrentLink->Status == LL_AVAILABLE){
cmp BYTE PTR [ecx+8], 3
je SHORT $L8704
; 425 :
; 426 : //ObjExt->MemoryBase[0x1C65]++; //debug
; 427 :
; 428 : break;
; 429 : }
; 430 : } while(FirstLink != ObjExt->LLData.CurrentLink);
cmp edi, ecx
je SHORT $L8591
; 420 : do{
; 421 : ObjExt->LLData.CurrentLink = ObjExt->LLData.CurrentLink->Next;
mov ecx, DWORD PTR [ecx]
; 422 : if(ObjExt->LLData.CurrentLink->Status == LL_AVAILABLE){
jmp SHORT $L8707
$L8704:
; 423 : ObjExt->LLData.CurrentLink->Status = LL_ACQUIRED;
mov BYTE PTR [ecx+8], 1
; 424 : ReturnLink = ObjExt->LLData.CurrentLink;
mov ebx, DWORD PTR [esi+112]
$L8591:
; 431 : }
; 432 : KeReleaseSpinLock(&ObjExt->LListSpin, LListIrql);
mov ecx, DWORD PTR 8+[ebp]
mov dl, al
call DWORD PTR __imp_@KfReleaseSpinLock@8
; 433 :
; 434 : if(ReturnLink == NULL){
test ebx, ebx
jne SHORT $L8597
; 435 : ReturnLink = ExAllocatePool(NonPagedPool, sizeof(LINKED_LIST));
push 543908932 ; 206b6444H
push 20 ; 00000014H
push ebx
call DWORD PTR __imp__ExAllocatePoolWithTag@12
mov ebx, eax
; 436 : if(ReturnLink != NULL){
test ebx, ebx
je SHORT $L8597
; 437 : ReturnLink->Status = LL_NEW;
and BYTE PTR [ebx+8], 0
$L8597:
pop edi
; 438 :
; 439 : //ObjExt->MemoryBase[0x1C64]++; //debug
; 440 :
; 441 : }
; 442 : }
; 443 :
; 444 : return ReturnLink;
mov eax, ebx
pop esi
pop ebx
; 445 : }
pop ebp
ret 4
_GetFreeEntry@4 ENDP
_TEXT ENDS
PUBLIC _InsertEntry@8
; COMDAT _InsertEntry@8
_TEXT SEGMENT
_ObjExt$ = 8
_Entry$ = 12
_InsertEntry@8 PROC NEAR ; COMDAT
; 448 : BOOLEAN InsertEntry(PPCIDP_EXTENSION ObjExt, PLINKED_LIST Entry){
push ebx
push esi
; 449 :
; 450 : BOOLEAN Status = TRUE;
; 451 : PLINKED_LIST CurrentLink;
; 452 : KIRQL LListIrql;
; 453 :
; 454 : KeAcquireSpinLock(&ObjExt->LListSpin, &LListIrql);
mov esi, DWORD PTR _ObjExt$[esp+4]
push edi
mov bl, 1
lea edi, DWORD PTR [esi+116]
mov ecx, edi
call DWORD PTR __imp_@KfAcquireSpinLock@4
; 455 : if(Entry->Status == LL_NEW){
mov ecx, DWORD PTR _Entry$[esp+8]
mov dl, al
mov al, BYTE PTR [ecx+8]
test al, al
jne SHORT $L8606
; 456 : Entry->Status = LL_INSERTED;
mov BYTE PTR [ecx+8], 2
; 457 : ObjExt->LLData.FreeMax++;
inc WORD PTR [esi+108]
; 458 : ObjExt->LLData.InsertedCount++;
inc WORD PTR [esi+106]
; 459 : if(ObjExt->LLData.IsEmpty == TRUE) {
cmp BYTE PTR [esi+104], bl
jne SHORT $L8607
; 460 : Entry->Prev = Entry;
mov DWORD PTR [ecx+4], ecx
; 461 : Entry->Next = Entry;
mov DWORD PTR [ecx], ecx
; 462 : ObjExt->LLData.CurrentLink = Entry;
; 463 : ObjExt->LLData.IsEmpty = FALSE;
and BYTE PTR [esi+104], al
mov DWORD PTR [esi+112], ecx
; 464 :
; 465 : //ObjExt->MemoryBase[0x1C66]++; //debug
; 466 : }
; 467 : else {
jmp SHORT $L8611
$L8607:
; 468 : CurrentLink = ObjExt->LLData.CurrentLink;
mov esi, DWORD PTR [esi+112]
; 469 : Entry->Prev = CurrentLink;
mov DWORD PTR [ecx+4], esi
; 470 : Entry->Next = CurrentLink->Next;
mov eax, DWORD PTR [esi]
mov DWORD PTR [ecx], eax
; 471 :
; 472 : CurrentLink->Next->Prev = Entry;
mov eax, DWORD PTR [esi]
mov DWORD PTR [eax+4], ecx
; 473 : CurrentLink->Next = Entry;
mov DWORD PTR [esi], ecx
; 474 :
; 475 : //ObjExt->MemoryBase[0x1C67]++; //debug
; 476 : }
; 477 : }
; 478 : else if(Entry->Status == LL_ACQUIRED){
jmp SHORT $L8611
$L8606:
cmp al, 1
jne SHORT $L8610
; 479 : Entry->Status = LL_INSERTED;
mov BYTE PTR [ecx+8], 2
; 480 : ObjExt->LLData.InsertedCount++;
inc WORD PTR [esi+106]
; 481 :
; 482 : //ObjExt->MemoryBase[0x1C68]++; //debug
; 483 : }
; 484 : else
jmp SHORT $L8611
$L8610:
; 485 : Status = FALSE;
xor bl, bl
$L8611:
; 486 :
; 487 : KeReleaseSpinLock(&ObjExt->LListSpin, LListIrql);
mov ecx, edi
call DWORD PTR __imp_@KfReleaseSpinLock@8
pop edi
; 488 : //ObjExt->MemoryBase[0x1C5A] = ObjExt->LLData.FreeMax;//debug
; 489 : //ObjExt->MemoryBase[0x1C57] = ObjExt->LLData.InsertedCount;//debug
; 490 :
; 491 : return Status;
mov al, bl
pop esi
pop ebx
; 492 : }
ret 8
_InsertEntry@8 ENDP
_TEXT ENDS
EXTRN __imp__ExFreePool@4:NEAR
; COMDAT _DeleteAllEntries@4
_TEXT SEGMENT
_ObjExt$ = 8
_DeleteAllEntries@4 PROC NEAR ; COMDAT
; 495 : BOOLEAN DeleteAllEntries(PPCIDP_EXTENSION ObjExt){
push esi
; 496 :
; 497 : PLINKED_LIST CurrentLink = ObjExt->LLData.CurrentLink;
mov esi, DWORD PTR _ObjExt$[esp]
push edi
mov edi, DWORD PTR [esi+112]
$L8716:
; 498 :
; 499 : while(ObjExt->LLData.IsEmpty == FALSE) {
cmp BYTE PTR [esi+104], 0
jne SHORT $L8618
; 500 :
; 501 : if(CurrentLink->Status == LL_INSERTED)
cmp BYTE PTR [edi+8], 2
jne SHORT $L8619
; 502 : ObjExt->LLData.InsertedCount--;
dec WORD PTR [esi+106]
$L8619:
; 503 :
; 504 : if(CurrentLink->Next == CurrentLink) {
mov eax, DWORD PTR [edi]
cmp eax, edi
jne SHORT $L8620
; 505 : ObjExt->LLData.IsEmpty = TRUE;
mov BYTE PTR [esi+104], 1
; 506 : }
; 507 : else {
jmp SHORT $L8621
$L8620:
; 508 : CurrentLink->Prev->Next = CurrentLink->Next;
mov ecx, DWORD PTR [edi+4]
mov DWORD PTR [ecx], eax
; 509 : CurrentLink->Next->Prev = CurrentLink->Prev;
mov eax, DWORD PTR [edi]
mov ecx, DWORD PTR [edi+4]
mov DWORD PTR [eax+4], ecx
; 510 : CurrentLink = CurrentLink->Prev;
mov edi, DWORD PTR [edi+4]
$L8621:
; 511 : }
; 512 : ObjExt->LLData.FreeMax--;
; 513 : //ObjExt->MemoryBase[0x1C5A] = ObjExt->LLData.FreeMax;//debug
; 514 : //ObjExt->MemoryBase[0x1C57] = ObjExt->LLData.InsertedCount;//debug
; 515 :
; 516 : ExFreePool(ObjExt->LLData.CurrentLink);
push DWORD PTR [esi+112]
dec WORD PTR [esi+108]
call DWORD PTR __imp__ExFreePool@4
jmp SHORT $L8716
$L8618:
; 517 : }
; 518 :
; 519 : return(!ObjExt->LLData.IsEmpty);
xor eax, eax
pop edi
cmp BYTE PTR [esi+104], al
pop esi
sete al
; 520 : }
ret 4
_DeleteAllEntries@4 ENDP
_TEXT ENDS
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -