Reading Access rights menu

User Tag List

Results 1 to 1 of 1
  1. #1
    L33ch's Avatar Member
    Reputation
    5
    Join Date
    Aug 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reading Access rights

    Hello All,

    I've noticed that some of you are talking about admin rights in VS2010/VS2k8 or w/e when running your... app...

    so, i started to wonder...
    what am i doing wrong by using :

    contstants :
    Code:
            public const uint PROCESS_TERMINATE = 0x0001;
            public const uint PROCESS_CREATE_THREAD = 0x0002;
            public const uint PROCESS_SET_SESSIONID = 0x0004;
            public const uint PROCESS_VM_OPERATION = 0x0008;
            public const uint PROCESS_VM_READ = 0x0010;
            public const uint PROCESS_VM_WRITE = 0x0020;
            public const uint PROCESS_DUP_HANDLE = 0x0040;
            public const uint PROCESS_CREATE_PROCESS = 0x0080;
            public const uint PROCESS_SET_QUOTA = 0x0100;
            public const uint PROCESS_SET_INFORMATION = 0x0200;
            public const uint PROCESS_QUERY_INFORMATION = 0x0400;
    
            public const uint TH32CS_SNAPHEAPLIST = 0x00000001;
            public const uint TH32CS_SNAPPROCESS = 0x00000002;
            public const uint TH32CS_SNAPTHREAD = 0x00000004;
            public const uint TH32CS_SNAPMODULE = 0x00000008;
            public const uint TH32CS_SNAPMODULE32 = 0x00000010;
            public const uint TH32CS_SNAPALL = (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE);
            public const uint TH32CS_INHERIT = 0x80000000;
    
            public const int SE_PRIVILEGE_ENABLED = 0x00000002;
            public const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
            public const int TOKEN_QUERY = 0x00000008;
    openprocess :
    Code:
            public void OpenProcess()
            {
                m_hProcess = ProcessMemoryReaderApi.OpenProcess(ProcessMemoryReaderApi.PROCESS_CREATE_PROCESS | ProcessMemoryReaderApi.PROCESS_QUERY_INFORMATION | ProcessMemoryReaderApi.PROCESS_VM_OPERATION | ProcessMemoryReaderApi.PROCESS_VM_WRITE | ProcessMemoryReaderApi.PROCESS_VM_READ | ProcessMemoryReaderApi.PROCESS_TERMINATE, 1, (uint)m_ReadProcess.Id);
                if (m_hProcess == IntPtr.Zero)
                {
                    IntPtr pDACL, pSecDesc;
    
                    ProcessMemoryReaderApi.GetSecurityInfo((int)Process.GetCurrentProcess().Handle, /*SE_KERNEL_OBJECT*/ 6, /*DACL_SECURITY_INFORMATION*/ 4, 0, 0, out pDACL, IntPtr.Zero, out pSecDesc);
                    m_hProcess = ProcessMemoryReaderApi.OpenProcess(0x40000, 0, (uint)ReadProcess.Id);
                    ProcessMemoryReaderApi.SetSecurityInfo((int)m_hProcess, /*SE_KERNEL_OBJECT*/ 6, /*DACL_SECURITY_INFORMATION*/ 4 | /*UNPROTECTED_DACL_SECURITY_INFORMATION*/ 0x20000000, 0, 0, pDACL, IntPtr.Zero);
                    ProcessMemoryReaderApi.CloseHandle(m_hProcess);
    
                    m_hProcess = ProcessMemoryReaderApi.OpenProcess(ProcessMemoryReaderApi.PROCESS_CREATE_PROCESS | ProcessMemoryReaderApi.PROCESS_QUERY_INFORMATION | ProcessMemoryReaderApi.PROCESS_VM_OPERATION | ProcessMemoryReaderApi.PROCESS_VM_WRITE | ProcessMemoryReaderApi.PROCESS_VM_READ | ProcessMemoryReaderApi.PROCESS_TERMINATE, 0, (uint)m_ReadProcess.Id);
                    if (m_hProcess == IntPtr.Zero)
                    {
                        MessageBox.Show("no handle found", "scan stopped");
                        return;
                    }
                }
            }
    I never had to use admin rights... lucky me? really scarry noob way of accesing memory?

    If anyone could confirm if this is an OK way to acces or not, that would be great.

    found it on the MSDN website :
    OpenProcess Function (Windows)
    Process Security and Access Rights (Windows)
    but forgot what pointed me there in the first place (probably the minesweeper memory scanner...)

    Reading Access rights

Similar Threads

  1. Replies: 6
    Last Post: 07-03-2012, 06:35 PM
  2. [Question]Thread Access Rights: PROCESS_SET_SESSIONID Flag
    By nilum in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 04-27-2012, 06:21 AM
  3. [WIP] World of Smurfcraft (yes you read that right)
    By The Lex in forum World of Warcraft Model Editing
    Replies: 22
    Last Post: 05-26-2010, 09:12 AM
  4. [Must read] Scam going on right here!
    By HolyForce in forum World of Warcraft General
    Replies: 11
    Last Post: 04-04-2007, 04:53 PM
All times are GMT -5. The time now is 06:36 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search