Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Address Help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
eienheart
How do I cheat?
Reputation: 0

Joined: 25 Jun 2012
Posts: 5

PostPosted: Mon Jun 25, 2012 11:15 pm    Post subject: Address Help Reply with quote

Hi, I'm trying to make a simple auto, but the address changes everytime the game is restarted, can anyone tell me how to get a static address for it?

<Game is Jade Dynasty>

Here's my code:

Code:
#cs ----------------------------------------------------------------------------
   AutoIt Version: 1.3.0.0
   Author: eienheart
#ce ----------------------------------------------------------------------------
#include "nomadmemory.au3"
#include <GUIConstants.au3>
#include <Misc.au3>
#include <Array.au3>

Global $process = "Jade Dynasty"
Global $pid = ProcessExists($process)
WinActivate("Jade Dynasty")

Autopot()
Func Autopot()
   While WinActive("Jade Dynasty")

      Global $HPROCESS = _MEMORYOPEN($pid)

      Global $baseaddress = _MemoryGetBaseAddress($HPROCESS, 1) ;it doesn't return any value except 0 why is that?
      Global $static = Dec("008256FC") ;this i have to change everytime i open the game
      Global $static2 = "0x" & Hex($baseaddress + $static)
      Global $hp = _MemoryRead($static2, $HPROCESS)
      Global $offset0 = Dec("00000028")
      Global $offset1 = Dec("0000027c")
      Global $offset2 = Dec("000002a0")
      Global $offset3 = 0x280
      Global $offset4 = 0x2a4

      $CurrentHP = ($static2 + $offset0)+$hp
      $MaxHP = $static2 + $hp

      MsgBox(0, "", $static2)
      If $CurrentHP < (.9) * ($MaxHP) Then
         Send(8)
      EndIf
   WEnd
   _MemoryClose($pid)
EndFunc   ;==>Autopot
Back to top
View user's profile Send private message
maxmakki
How do I cheat?
Reputation: 0

Joined: 29 Jun 2012
Posts: 7

PostPosted: Fri Jun 29, 2012 5:23 pm    Post subject: Reply with quote

Hi eienheart,

You need to find the base address (green addresses) in cheat engine - the following steps should work:

1) Select "New Scan" using the "Unknown Initial Value" option and select "First Scan".
2) Do your action in again, then select "Next Scan". Repeat until you find your address (this address will most likely be a dynamic one). You'll know it's the right one if you can change its value in Cheat Engine and have the value match in game.
3) Double click this address so it shows up in the address list.
4) Right click the new address in your address list and select "Find out what writes to this address".
5) Do your action in game again and see what shows up in the debugger.
5a) If nothing shows up, you have selected the wrong address, repeat steps 3 - 5 until something shows up in the debugger.
6) Double click one of the results in the debugger, you'll get a message saying the address is probably ____. Write down this address and run a new scan with the "Hex" box ticked. Don't forget to write down the offset as well.
7) If you find a green address in this list, that is most likely the address you want. Check to see if the value changes in game to verify. If you don't find a green address, repeat steps 3 - 6 until you do.

In your code the address will be 0xAddress, and the offsets will be 0xOffsets. You can take these values straight from Cheat Engine, no need to modify or convert them.

Cheat Engine also comes with a tutorial explaining how to accomplish this. You can also watch the following video:

[I can't post urls yet, but the video code for youtube is p6psMboRTUY]

Max
Back to top
View user's profile Send private message
truefalse
Newbie cheater
Reputation: 0

Joined: 26 Jun 2012
Posts: 15

PostPosted: Fri Jun 29, 2012 6:18 pm    Post subject: Reply with quote

You need to add ".exe", like this;

Global $process = "Tutorial-i386.exe"


try that..
Back to top
View user's profile Send private message
eienheart
How do I cheat?
Reputation: 0

Joined: 25 Jun 2012
Posts: 5

PostPosted: Sat Jun 30, 2012 3:41 am    Post subject: Reply with quote

Hi guys thanks for the input, I've managed to get the right static address and functions to do, coded :
Code:
#cs ----------------------------------------------------------------------------
   AutoIt Version: 1.4.0.0
   Author: eien
#ce ----------------------------------------------------------------------------
#include <nomadmemory.au3>

$PID = WinGetProcess("Jade Dynasty")
WinActivate("Jade Dynasty") ;bring the game to active window at start
Autopot()
func Autopot()
while WinActive("Jade Dynasty") ;ends script when window isn't active

   Global $HPROCESS = _MEMORYOPEN($PID)
   Global $baseaddress = 0x00821BFC ;static address that accesses my pointer - via CE
   Global $offset1 = 0x27c ;offset for current hp
   Global $offset2 = 0x2a0 ;offset for max hp
   Global $offset3 = 0x280 ;offset for current mp
   Global $offset4 = 0x2a4 ;offset for max mp

   $CurrentHP = _MemoryRead($baseaddress+$offset1, $HPROCESS, "int")
   $MaxHP = _MemoryRead($baseaddress + $offset2, $HPROCESS, "int")
   $CurrentMP = _MemoryRead($baseaddress+$offset3, $HPROCESS, "int")
   $MaxMP = _MemoryRead($baseaddress+$offset4, $HPROCESS, "int")
   msgbox(0,"ab",$baseaddress)

if $CurrentHP < (.9)*($MaxHP) then ;press 8 when HP is below 90%
      Send(8)
EndIf
if $CurrentMP < (.9)*($MaxMP) then ;press 9 when MP is below 90%
      Send(9)
EndIf

WEnd
_MemoryClose($PID)
EndFunc


It runs ok, but when i restart the game i'd have to change
Code:
Global $baseaddress = 0x00821BFC ;static address that accesses my pointer - via CE
-address to a new one (I saved my CE pointers, so I can access it easily)

I also tried this, but It doesn't return the right values.
Code:
$PID = "Jade Dynasty"
$process = "elementclient.exe"
$memhandle = _MemoryOpen($PID)

$staticaddress = 0x00xxxxx ;this is from CE's "elementclient.exe+xxxxxx" which is the base address of the client
$finalbase = _MemoryModuleGetAddress($process, $memhandle) + $staticaddress ;this would be the final basic address of the client
Global $offset1 = 0x27c ;offset for current hp
$CurrentHP = _MemoryRead($finalbase+$offset1, $memhandle) ;this should be the value of the current hp
msgbox(0,"CurHP",$currentHP) ;this should display the current hp value but it displays a big number
Back to top
View user's profile Send private message
truefalse
Newbie cheater
Reputation: 0

Joined: 26 Jun 2012
Posts: 15

PostPosted: Sat Jun 30, 2012 6:52 am    Post subject: Reply with quote

Ok read this page carefully and your probs will be solved, it worked for me atleast Smile



h-ttp-:-//-w-ww-.-ownedcore.-com-/forums/star-wars-old-republic/swtor-bots-programs/340428-autoit-example-reading-value-memory-.-html

and this function might come to use:
http-:-//pastebin-.-com-/UPGn7kBJ

ps: stril the " - " from the url
Back to top
View user's profile Send private message
eienheart
How do I cheat?
Reputation: 0

Joined: 25 Jun 2012
Posts: 5

PostPosted: Sat Jun 30, 2012 1:01 pm    Post subject: Reply with quote

How would i know what to put in this?
Code:
Global $sModule = "MemoryMan.dll"


I tried using kernel32.dll, it outputs numbers, although I am unsure if these are correct:
Code:
Pointer Value:0x756556FC
Pointer Value:0
, and it still outputs 0 as the value for HP.
Code:
#RequireAdmin
SetPrivilege("SetDebugPrivilege", 1)
#include <NomadMemory2.au3>

Global $PID
Global $sModule = "kernel32.dll"
Global $StaticOffset
Global $openmem

$PID = ProcessExists("elementclient.exe")

Local $Offset[1]
$Offset[0] = 0 ; Is ALWAYS 0.

$StaticOffset = Dec("8256FC")

$baseADDR = _MemoryModuleGetBaseAddress($PID, $sModule)
$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)

$r = _MemoryRead($finalADDR, $openmem)
$r = _MemoryRead($r + 0x27c, $openmem, "float")

ConsoleWrite("Pointer Value:" & $finalADDR & @CRLF)
ConsoleWrite("Pointer Value:" & $r & @CRLF)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites