Jump to content

Need help with _WinAPI_OpenProcess


Go to solution Solved by MotionFlex,

Recommended Posts

#Include <WinAPI.au3>

$PROCESS_ALL_ACCESS = 0x1F0FFF
$ce_PID = ProcessExists("Tutorial-i386.exe")
$MemoryOpen = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS , False, $ce_PID, True)
$errorCode = _WinAPI_GetLastErrorMessage() ;[1]<<
ConsoleWrite( $errorCode)
$MemoryAddress = 0x01766330
$StoredValue = 0
$Transfered = 0

While 1
    $successRate = _WinAPI_ReadProcessMemory($MemoryOpen, $MemoryAddress, $StoredValue, 4, $Transfered)
    $errorCode = _WinAPI_GetLastErrorMessage() ;[2]<<
    ConsoleWrite( $errorCode)
    ToolTip($StoredValue, 0, 0)
    Sleep(1500)
WEnd

_WinAPI_CloseHandle($MemoryOpen)

For some reason i get a error at [1] which says "Not all privileges or groups referenced are assigned to the caller.". I have tried using #RequireAdmin but when i use it even when running as admin the program exits after about half a second.

The second error [2] says "The handle is invalid." which is most likely because of the first error.

Can anyone help me figure out why this is happen and what i need to change. I have used tried to use NomadMemory but it doesn't work for x64. I am running Windows 8 as well.

Edited by MotionFlex
Link to comment
Share on other sites

"Tutorial-i386.exe" is the name of the Cheat-Engine tutorial process, so not a game -- but I could be wrong.

Who knows what the mods will say in terms of "forum-rule-ability".

Edited by DatMCEyeBall

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Link to comment
Share on other sites

  • Solution

Forget it, found a fix for it. To anyone who may encounter this problem, here a fix for it:

If you would like to use autoit x64, then nomadmemory would not work. You have to change the following line in _memoryread function

 
Return $v_Value

to this:

If ($sv_type="ptr") and (@OSArch = "X64") Then
   Return BitAnd($v_value,0xFFFFFFFF)
Else
   Return $v_value
EndIf

Also you don't need to use Hex("<Your hex code>"), $address = 0xCODE works just fine.

Maybe next time i will do a little more searching. :)

Edited by MotionFlex
Link to comment
Share on other sites

  • 1 month later...

#include <NomadMemory.au3>


   $iv_Pid = ProcessExists( "Tutorial-i386.exe" )
   
   $MemoryOpen = _MemoryOpen ($iv_Pid) 
   
   While 1
      
      $var = _MemoryRead('0x' & '017C75B8' , $MemoryOpen)   
      
     
      $mouse = MouseGetPos()
      ToolTip($var,0,0)  ; Here always shows 0, no matter what I do. I even changed the code of the Nomad Memory Described by MotionFlex
      
      Sleep(100) 
       
   WEnd 
   
   _MemoryClose($MemoryOpen)

S.O Windows 8 , 64x

Help me :( i don't know how i go read memory, send me good's tutorials

Edited by arrois
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...