|
You last visited: Today at 02:44
Advertisement
Memory & Offsets
Discussion on Memory & Offsets within the AutoIt forum part of the Coders Den category.
08/22/2010, 16:46
|
#1
|
elite*gold: 0
Join Date: Apr 2008
Posts: 347
Received Thanks: 1,286
|
Memory & Offsets
what i want to do?
i want to get the current value of MP / HP.
but my code doesnt give me the correct value, its always = 0
here is my own code
though the $Addr_CheckLogin, $Addr_CheckCharName is static so no problem with that.. but my problem is with the dynamic addresses that need offset and base address stuff.
Code:
#include <NomadMemory.au3>
#include <GUIConstants.au3>
#include <GUIListBox.au3>
#include <Misc.au3>
#include <Array.au3>
#include <asm.au3>
#include <basememory.au3>
;#RequireAdmin
;Declaring Variables
Global $MemPointer, $finalADDR, $baseADDR
;Check if Khan Online is running.
If ProcessExists("KhanClient.exe") = 0 Then
MsgBox(0, "Error", "Khan Online is not running. Please start Khan first.")
Exit
EndIf
;Get Khan Process and Open Memoryz
$ID=_MemoryOpen(ProcessExists("KhanClient.exe"))
;Function Calls
_ReadCurHP($ID)
;Addresses
$Addr_CheckLogin=0x0184B30C
$Addr_CheckCharName=0x00718DB4
$Addr_Exp=0x006F526E
;$Addr_CurHP=0x006F532C
$Addr_FullHP=0x006F5330
;$Addr_CurMP=0x
$Addr_FullMP=0x006F5356
;Check If Logged in to Khan
$Check_Login=_MemoryRead($Addr_CheckLogin,$ID)
If $Check_Login = "" Then
MsgBox(0x1010, "Error", "Please Login.")
Exit
EndIf
;Check Selected Character Name
$Check_CharName=_MemoryRead($Addr_CheckCharName,$ID)
If $Check_CharName = "" Then
MsgBox(0x1010, "Error", "Please Select Character.")
Exit
EndIf
;Display Character Selected
$Char_Chosen=_MemoryRead($Addr_CheckCharName, $ID, "Char[21]")
MsgBox(0, "Character Chosen",$Char_Chosen)
;Display Characters Current Exp
$Char_Exp=_MemoryRead($Addr_Exp, $ID, "Char[31]")
MsgBox(0, "Character EXP",$Char_Exp)
;Display Characters Current HP
$Char_CurHP=_MemoryRead($Addr_Exp, $ID, "Char[31]")
MsgBox(0, "Character HP",$baseADDR)
;functions for getting offsets
Func _ReadCurHP($ID)
Global $CurHPOffset[6]
$CurHPOffset[0] = 0
$CurHPOffset[1] = Dec("017C")
$CurHPOffset[2] = Dec("0108")
$CurHPOffset[3] = Dec("0004")
$CurHPOffset[4] = Dec("0004")
$CurHPOffset[5] = Dec("0020")
$StaticOffset = Dec("0030EA80")
$openmem = _MemoryOpen($ID)
$baseADDR = _MemoryGetBaseAddress($openmem, 1)
$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
$MemPointer = _MemoryPointerRead($finalADDR, $openmem, $CurHPOffset)
_MemoryClose($openmem)
Return $MemPointer
EndFunc
I saw this code somewhere, and I'm trying to edit it to work with the game I'm playing. I have the Base Address and My Offsets, but i have a problem.
i don't know how to complete the code.
please help?
Code:
#include <NomadMemory.au3>
$h=WinGetHandle("[CLASS:ZElementClient Window]","")
$pid = ProcessExists("elementclient.exe")
$pointer = Dec("00AF9094")
$offset = Dec("28")
$hp_current = Dec("270")
$hp_max = Dec("288")
$mp_current = Dec("274")
$mp_max = Dec("28C")
$openmem = _MemoryOpen($pid)
$base=_MemoryRead($pointer,$openmem)
$offsetADDR = "0x" & Hex($offset + $base)
$finalADDR=_memoryread($offsetADDR,$openmem)
$hp_current_ADDR = "0x" & Hex($hp_current + $finalADDR)
$hp_max_ADDR = "0x" & Hex($hp_max + $finalADDR)
$mp_current_ADDR = "0x" & Hex($mp_current + $finalADDR)
$mp_max_ADDR = "0x" & Hex($mp_max + $finalADDR)
this is the information about my address and offset,
i just used a generator to get this autoit function. i dont even understand much of this. but can someone help merge this code with the code above? thanks...
Code:
Func _ReadCurMP($pid)
Global $CurMPOffset[6]
$CurMPOffset[0] = 0
$CurMPOffset[1] = Dec("017C")
$CurMPOffset[2] = Dec("010C")
$CurMPOffset[3] = Dec("0004")
$CurMPOffset[4] = Dec("0004")
$CurMPOffset[5] = Dec("0020")
$StaticOffset = Dec("0030EA80")
$openmem = _MemoryOpen($pid)
$baseADDR = _MemoryGetBaseAddress($openmem, 1)
$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
$MemPointer = _MemoryPointerRead($finalADDR, $openmem, $CurMPOffset)
_MemoryClose($openmem)
Return $MemPointer
EndFunc
|
|
|
08/23/2010, 02:37
|
#2
|
elite*gold: 0
Join Date: Jun 2009
Posts: 497
Received Thanks: 1,464
|
PHP Code:
$MPread = _MemoryPointerRead($finalADDR,$openmem,$CurMPOffset) MsgBox(0, "Info", $MPread[1])
Try this.
|
|
|
08/23/2010, 07:21
|
#3
|
elite*gold: 0
Join Date: Apr 2008
Posts: 347
Received Thanks: 1,286
|
hi , thanks for the reply..
but i still cant make it work? could you please correct my code.
im looking for a char[10], because HP is stored in TEXT  thanks
Code:
#include <NomadMemory.au3>
#include <GUIConstants.au3>
#include <GUIListBox.au3>
#include <Misc.au3>
#include <Array.au3>
#include <asm.au3>
#include <basememory.au3>
$ID = ProcessExists("KhanClient.exe")
Global $CurHPOffset[6]
$CurHPOffset[0] = 0
$CurHPOffset[1] = Dec("017C")
$CurHPOffset[2] = Dec("0108")
$CurHPOffset[3] = Dec("0004")
$CurHPOffset[4] = Dec("0004")
$CurHPOffset[5] = Dec("0020")
$StaticOffset = Dec("0030EA80")
$openmem = _MemoryOpen($ID)
$baseADDR = _MemoryGetBaseAddress($openmem, 1)
$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
$MemPointer = _MemoryPointerRead($finalADDR, $openmem, $CurHPOffset)
_MemoryClose($openmem)
$MPread = _MemoryPointerRead($finalADDR,$openmem,$CurHPOffset)
MsgBox(0, "Info", $MPread)
|
|
|
08/24/2010, 01:27
|
#4
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
PHP Code:
#include <NomadMemory.au3>
$ID = ProcessExists("KhanClient.exe")
If $ID > 0 Then
Global $CurHPOffset[6] = [0, 0x17C, 0x108, 0x4, 0x4, 0x20]
$StaticOffset = 0x30EA80
$openmem = _MemoryOpen($ID)
$baseADDR = _MemoryGetBaseAddress($openmem, 1)
$finalADDR = "0x" & Hex($baseADDR + $StaticOffset)
$HPread = _MemoryPointerRead($finalADDR, $openmem, $CurHPOffset, "char[10]")
_MemoryClose($openmem)
MsgBox(0, "Info", $HPread[1])
EndIf
|
|
|
08/24/2010, 14:04
|
#5
|
elite*gold: 0
Join Date: Apr 2008
Posts: 347
Received Thanks: 1,286
|
Thank you  now i have this code..
but i have a little question, how do i keep the value real time?
i mean, if the value changed in game, it will also change on my msgbox? or GUI?
and is there a cleaner code? i think my code is too long..hehe
Code:
#include <NomadMemory2.au3>
SetPrivilege("SeDebugPrivilege", 1)
;get process
$ID = ProcessExists("KhanClient.exe")
;check if khan is running
If ProcessExists("KhanClient.exe") = 0 Then
MsgBox(0, "Error", "Khan Online is not running. Please start Khan first.")
Exit
EndIf
;Offset Array
Global $CurHPOffset[7] = [0, 0x18570DC, 0x4338, 0x3C, 0x6C, 0x0, 0xC0]
Global $MaxHPOffset[7] = [0, 0x18570DC, 0x4338, 0x3C, 0x6C, 0x0, 0xC8]
Global $CurMPOffset[7] = [0, 0x18570DC, 0x4338, 0x3C, 0x6C, 0x4, 0xC0]
Global $MaxMPOffset[7] = [0, 0x18570DC, 0x4338, 0x3C, 0x6C, 0x4, 0xC8]
Global $CurEXPOffset[3] = [0, 0x7198BC, 0x128]
Global $MaxEXPOffset[3] = [0, 0x7197B4, 0x101C]
;Static Offsets
$HPMPStaticOffset = 0x18570DC
$CurEXPStaticOffset = 0x7198BC
$MaxEXPStaticOffset = 0x7197B4
;Process 1
$openmem = _MemoryOpen($ID)
$baseADDR = _MemoryGetBaseAddress($openmem, 1)
;get final read addresss
$HPMPfinalADDR = "0x" & Hex($baseADDR + $HPMPStaticOffset)
$CurEXPfinalADDR = "0x" & Hex($baseADDR + $CurEXPStaticOffset)
$MaxEXPfinalADDR = "0x" & Hex($baseADDR + $MaxEXPStaticOffset)
;Read
$CurHPread = _MemoryPointerRead($HPMPfinalADDR, $openmem, $CurHPOffset)
$MaxHPread = _MemoryPointerRead($HPMPfinalADDR, $openmem, $MaxHPOffset)
$CurMPread = _MemoryPointerRead($HPMPfinalADDR, $openmem, $CurMPOffset)
$MaxMPread = _MemoryPointerRead($HPMPfinalADDR, $openmem, $MaxMPOffset)
$CurEXPread = _MemoryPointerRead($CurEXPfinalADDR, $openmem, $CurEXPOffset)
$MaxEXPread = _MemoryPointerRead($MaxEXPfinalADDR, $openmem, $MaxEXPOffset)
;Close Memory
_MemoryClose($openmem)
;Get Percentage
$hp_perc = Int(($CurHPread[1]/$MaxHPread[1])*100)
$mp_perc = Int(($CurMPread[1]/$MaxMPread[1])*100)
$exp_perc = Int(($CurEXPread[1]/$MaxEXPread[1])*100)
;Test Display
MsgBox(0, "HP/MP/EXP", "HP: " & $CurHPread[1] & " / " & $MaxHPread[1] & " - " & $hp_perc & "%" & @CRLF & "MP: " & $CurMPread[1] & " / " & $MaxMPread[1] & " - " & $mp_perc & "%" & @CRLF & "EXP: " & $CurEXPread[1] & " / " & $MaxEXPread[1]& " - " & $exp_perc & "%")
|
|
|
 |
Similar Threads
|
Aktuellen memory offsets aoc
10/17/2009 - General Gaming Releases - 1 Replies
Hat hier einer die aktuellen pointer und offsets von ageofconan?
|
New offsets - memory issue
10/09/2009 - GW Bots - 7 Replies
I wonder if Anet shifted some offsets by +4
Can any1 could confirm it
So far new offsets works for me
Max_Kurzick = 0x744 (old 740)
Max_Luxon = 0x748 (old 744)
Max_Balthazar = 0x74c (old 748)
|
Memory Locations or Offsets? PWI
02/02/2009 - Perfect World - 1 Replies
I have the offsets for MaHP, HP, MaMP, MP and the base for the pwi clients. But what i am looking for are the memory locations for the petHP for each pet slot. This is the only automation i cannot make as i do not have the source and i am too lazy to learn the Cheat Engine or what ever to isolate the offsets on my own. (might as well be honest about it) Anyone have any pointers? I am like three steps away from unleashing a whole party controller. Bots of your choice, or control all 5 other...
|
Finding Memory Offsets in WoW?
07/12/2007 - World of Warcraft - 3 Replies
Hey people,
i make bots, and so far i had some guy finding the offsets for me. how to do? do u know?
|
Need help with memory offsets and packet opcodes
01/09/2007 - Conquer Online 2 - 7 Replies
Im currently involved in a new botting program project, called FuckBot, which when done, will be a scirptable, multi game bot. We are moving along in development quite well, and are beginning to work on compatibility with Conquer Online. To help speed up development, i'm asking that people help contribute here, by posting memory offsets for various things, such as health, exp, level, spouse and such, everything possible, as well as packets, and their opcodes. Packet logs would be extremely...
|
All times are GMT +1. The time now is 02:45.
|
|