Sign in to follow this  
Followers 0
MotionFlex

Need help with _WinAPI_OpenProcess

6 posts in this topic

#1 ·  Posted (edited)

#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

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

"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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

For a game?

 

As DatMCEyeBall said, it's for the cheat engine tutorial.

ZOw0GOM.png

Edited by MotionFlex

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

#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

Share this post


Link to post
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
Sign in to follow this  
Followers 0