помогите пжл. где ошибка в получении привелегий? масм 32 версия 10 заканчивается ERROR_NOACCESS (000003E6) .386 .MODEL Flat, STDCALL option casemap:none include \masm32\include\windows.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib include \masm32\include\advapi32.inc includelib \masm32\lib\advapi32.lib EnableDebugPrivilege Proto .DATA WindowName db "Сапер",0 noGame db "Запусти игру сначала",0 patch dd 3839h ,0 address dd 01002393h,0 Priv db "SeDebugPrivilege",0 .DATA? processID dd ? gameHwnd dd ? gameProcess dd ? .CODE start: invoke EnableDebugPrivilege invoke FindWindowA, addr WindowName, NULL mov gameHwnd, eax .IF eax==0 pushad invoke MessageBox,0,addr noGame,NULL,MB_OK popad .ENDIF invoke GetWindowThreadProcessId, gameHwnd, addr processID invoke OpenProcess, PROCESS_ALL_ACCESS, 0, processID mov gameProcess,eax ;invoke ReadProcessMemory, gameProcess, address,0, 2, NULL invoke WriteProcessMemory, gameProcess, address, patch, 2, NULL invoke ExitProcess,eax EnableDebugPrivilege proc LOCAL hTokenWORD LOCAL tkp:TOKEN_PRIVILEGES LOCAL ReturnLengthWORD LOCAL luid:LUID mov eax,0 invoke GetCurrentProcess invoke OpenProcessToken,INVALID_HANDLE_VALUE, TOKEN_ADJUST_PRIVILEGES,ADDR hToken invoke LookupPrivilegeValue,NULL, addr Priv, ADDR luid .IF eax==0 invoke CloseHandle,hToken ret .ENDIF mov tkp.PrivilegeCount,1 lea eax,tkp.Privileges assume eax:ptr LUID_AND_ATTRIBUTES push luid.LowPart pop [eax].Luid.LowPart push luid.HighPart pop [eax].Luid.HighPart mov [eax].Attributes,SE_PRIVILEGE_ENABLED invoke AdjustTokenPrivileges,hToken,NULL,ADDR tkp,sizeof tkp,ADDR tkp,ADDR ReturnLength invoke GetLastError .IF eax!=ERROR_SUCCESS ret .ENDIF invoke CloseHandle,hToken mov eax,1 ret EnableDebugPrivilege endp WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM .IF uMsg==WM_DESTROY invoke PostQuitMessage,NULL .ELSE invoke DefWindowProc,hWnd,uMsg,wParam,lParam ret .ENDIF xor eax,eax ret WndProc endp end start отбой. получилось