[Windev] Get the access on World of Warcraft process menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    mmosoft's Avatar Active Member CoreCoins Purchaser
    Reputation
    25
    Join Date
    May 2009
    Posts
    60
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Windev] Get the access on World of Warcraft process

    After having found the handle of the windows, you need to gain access on the process to read or write in the memory.

    Found the handle of window

    You need to set debug privilege first
    Create a function

    Code:
    PROCEDURE SetsPrivilege(sPrivilege est une chaîne, bActive est un booléen)
    
    // The SetsPrivilege function will accept a handle to a token, a
    // sPrivilege, and a flag to either enable/disable that sPrivilege. The
    // function will attempt to perform the desired action upon the token
    // returning TRUE if it succeeded, or FALSE if it failed.
    
    LUID est une structure
    	lowpart est un entier
    	highpart est un entier
    FIN
    
    LUID_AND_ATTRIBUTES est une structure
    	pLuid est une LUID
    	Attributes est un entier
    FIN
    
    TOKEN_PRIVILEGES est une structure
    	PrivilegeCount est un entier
    	Privileges est un tableau dynamique
    FIN
    
    nHdwl est un entier
    nRes est un entier
    nToken est un entier = 0
    TP est une TOKEN_PRIVILEGES          	// Used in getting the current token sPrivileges
    TPPrevious est une TOKEN_PRIVILEGES  	// Used in setting the new token sPrivileges
    sLuid est une LUID                    	// Stores the Local Unique Identifier - refer to MSDN
    cbPrevious est un entier              	// Previous size of the TOKEN_sPrivilegeS structure
    lResult est un entier                 	// Result of various API calls
    bSetsPrivilege est un booléen
    nTOKEN_ADJUST_PRIVILEGES est un entier = 0x0020
    nTOKEN_QUERY est un entier = 0x0008
    nSE_PRIVILEGE_ENABLED est un entier = 0x0002
    nANYSIZE_ARRAY est un entier = 1
    nPROCESS_ALL_ACCESS est un entier = 0x1F0FFF
    
    TP:Privileges = allouer un tableau de nANYSIZE_ARRAY LUID_AND_ATTRIBUTES
    TPPrevious:Privileges = allouer un tableau de nANYSIZE_ARRAY LUID_AND_ATTRIBUTES
    
    nHdwl = API("kernel32", "GetCurrentProcess")
    
    SI API("advapi32.dll", "OpenProcessToken", nHdwl, OUBinaire(nTOKEN_ADJUST_PRIVILEGES,nTOKEN_QUERY), &nToken) <> 1 ALORS
    	Erreur("Erreur OpenProcessToken")
    FIN
    
    // Grab the size of the TOKEN_sPrivilegeS structure,
    // used in making the API calls.
    cbPrevious = Dimension(TP)
    
    // Grab the LUID for the request sPrivilege.
    lResult = API("advapi32", "LookupPrivilegeValueA", "", sPrivilege, &sLuid)
    
    // If LoopupsPrivilegeValue fails, the return result will be zero.
    // Test to make sure that the call succeeded.
    SI (lResult = 0) ALORS
    	bSetsPrivilege = Faux
    FIN
    
    // Set up basic information for a call.
    // You want to retrieve the current sPrivileges
    // of the token under concern before you can modify them.
    TP:PrivilegeCount = 1
    TP:Privileges[1]:pLuid = sLuid
    TP:Privileges[1]:Attributes = nSE_PRIVILEGE_ENABLED
    bSetsPrivilege = lResult
    
    // You need to acquire the current sPrivileges first
    lResult = API("advapi32.dll", "AdjustTokenPrivileges", nToken, Faux, &TP, 0, 0, 0)
    
    // If AdjustTokensPrivileges fails, the return result is zero,
    // test for success.
    SI (lResult = 0) ALORS
    	bSetsPrivilege = False
    FIN
    
    // Now you can set the token sPrivilege information
    // to what the user is requesting.
    TPPrevious:PrivilegeCount = 1
    TPPrevious:Privileges[1]:pLuid = sLuid
    
    // either enable or disable the sPrivilege,
    // depending on what the user wants.
    SELON bActive
    	CAS Vrai
    		TPPrevious:Privileges[1]:Attributes = OUBinaire(TPPrevious:Privileges[1]:Attributes,nSE_PRIVILEGE_ENABLED)
    	CASE Faux
    		TPPrevious:Privileges[1]:Attributes = OUExclusifBinaire(TPPrevious:Privileges[1]:Attributes, ETBinaire(nSE_PRIVILEGE_ENABLED, TPPrevious:Privileges[1]:Attributes))
    
    FIN
    
    // Call adjust the token sPrivilege information.
    //lResult = AdjustTokensPrivileges(nHandle, -1, TPPrevious, cbPrevious, TP, cbPrevious)
    
    API("kernel32", "CloseHandle", nToken)
    
    API("kernel32", "CloseHandle", nHdwl)
    
    // Determine your final result of this function.
    SI (lResult = 0) ALORS
    	// You were not able to set the sPrivilege on this token.
    	RENVOYER Faux
    SINON
    	// You managed to modify the token sPrivilege
    	RENVOYER Vrai
    FIN
    And then, you need to get the access and get an ID.

    Simply execute this code

    Code:
    //On autorise la lecture de la mémorie sur le jeu
    SetsPrivilege("SeDebugPrivilege", Vrai)
    
    //On crée un ID avec tous les droits qui pointe vers le handle de WoW
    nRes = API("user32", "GetWindowThreadProcessId", gnWOW_HANDLE, &gnWOW_ID)
    
    //On ouvre l'ID avec tous les droits
    gnWOW = API("kernel32", "OpenProcess", 0x1F0FFF, Faux, gnWOW_ID)
    
    SI gnWOW <> 0 ALORS
    	Info("OK on a récupéré l'id avec les droits " + gnwow)
    SINON
    	Erreur("Erreur : " + API("kernel32", "GetLastError"))
    FIN
    So, let's go, you can now read or write in the memory !!!

    ATTENTION !!!
    If you are developping with Windev 12, you can't get access on the process under Windows Vista and Windows Seven
    You can only get the access with Windev 14.
    But, under Windows XP, all is fine with Windev 12
    Last edited by mmosoft; 09-30-2009 at 01:01 PM.
    OLDER ACCS

    [Windev] Get the access on World of Warcraft process

Similar Threads

  1. Replies: 0
    Last Post: 09-30-2009, 12:48 PM
  2. The Evolution of World of Warcraft
    By sineater213 in forum World of Warcraft General
    Replies: 3
    Last Post: 07-26-2007, 04:25 PM
  3. The final answer (World of warcraft VS Runescape)
    By corn674 in forum World of Warcraft General
    Replies: 7
    Last Post: 11-26-2006, 02:16 AM
  4. The Zones of World of Warcraft
    By Shanaar in forum World of Warcraft Guides
    Replies: 7
    Last Post: 07-05-2006, 12:24 PM
All times are GMT -5. The time now is 04:43 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