|
You last visited: Today at 06:26
Advertisement
Need help with KDMemory reading
Discussion on Need help with KDMemory reading within the AutoIt forum part of the Coders Den category.
05/20/2014, 21:16
|
#1
|
elite*gold: 0
Join Date: Jan 2014
Posts: 43
Received Thanks: 1
|
Need help with KDMemory reading
Hi i have tried this au3 file and seems to me that it dont work or i didnt make script to work . Its first time for me to work with memory so i need a bit help
i get "@error:15, @extended:1" error
here is my script
Code:
#AutoIt3Wrapper_UseX64=y ; 64 Bit application
#RequireAdmin
#include "KDMemory.au3"
If @AutoItX64 == 0 Then
MsgBox(48, "Error", "Unsupported system")
Exit
EndIf
Const $processName = "AlefClient.exe", $moduleName = $processName
Const $baseOffset = 0x0055D834
Const $offsets[5] = [0x72c, 0x18c, 0x48, 0x6c0, 0x25c]
$processId = ProcessExists($processName)
If $processId == 0 Then
MsgBox(48, "Error", "'" & $processName & "' is not running!")
Else
$handles = _KDMemory_OpenProcess($processId)
If @error Then
MsgBox(48, "Error", "Can't open '" & $processName & "'!" & @CRLF & "@error: " & @error)
Else
$baseAddress = _KDMemory_GetModuleBaseAddress($handles, $moduleName, 0, 0) + $baseOffset
If @error Then
MsgBox(48, "Error", "Can't get ModuleBaseAddress ('" & $moduleName & "')!" & @CRLF & "@error: " & @error & ", @extended: " & @extended)
Else
; test
MsgBox(0, "Module base address", $baseAddress) ; returns 0x000000000095d834
$memoryData = _KDMemory_ReadProcessMemory($handles, $baseAddress, "DWORD", $offsets)
If @error Then
MsgBox(48, "Error", "Can't read memory!" & @CRLF & "@error: " & @error & ", @extended: " & @extended)
Else
MsgBox(64, "Info", "Address: " & $memoryData[0] & @CRLF & "Value: " & $memoryData[1])
EndIf
EndIf
_KDMemory_CloseHandles($handles)
EndIf
EndIf
CE scan
<CheatEntry>
<ID>11</ID>
<Description>"pointerscan result"</Description>
<Color>80000008</Color>
<VariableType>4 Bytes</VariableType>
<Address>"AlefClient.exe"+0055D834</Address>
<Offsets>
<Offset>72C</Offset>
<Offset>18C</Offset>
<Offset>48</Offset>
<Offset>6C0</Offset>
<Offset>25C</Offset>
</Offsets>
</CheatEntry>
Is maybe problem here $moduleName = "AlefClient.exe" because this game not use module like Aion as i saw on this forum
EDIT:
Im running windows 7 64 bit, tried compile app like 64 bit and run as admin still no sucess, but in CE it show right value and its 4byte
"AlefClient.exe"+0055D834
offsets: 72C, 18C, 48, 6C0, 25C
And process name AlefClient.exe *32
EDIT 2 UPDATED CODE + pic
Here is image with all running
Code:
#RequireAdmin
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include "KDMemory.au3"
GUICreate("Form 1", 195, 235)
GUICtrlCreateGroup("Current hp", 8, 8, 177, 53)
$mobHP = GUICtrlCreateInput("", 15, 32, 161, 21, $ES_READONLY)
GUICtrlCreateGroup("Status", 8, 74, 177, 53)
$gameStatus = GUICtrlCreateInput("Game is not running.", 15, 98, 161, 21, $ES_READONLY)
GUISetState()
Global $processName = "AlefClient.exe", $handles = 0, $address = 0
Global $baseOffsetMobHp = 0x0055D834
Global $offsetsHP[5] = [0x72c, 0x18c, 0x48, 0x6c0, 0x25c]
While Sleep(10)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
; is game running
$processId = ProcessExists($processName)
If $processId == 0 Then
If IsArray($handles) Then
GUICtrlSetData($gameStatus, "Game is not running.")
_KDMemory_CloseHandles($handles)
$handles = 0
$address = 0
EndIf
ContinueLoop
EndIf
; opens memory
If $handles == 0 Then
$handles = _KDMemory_OpenProcess($processId)
If @error Then
If MsgBox(52, "Error", "Can't open " & $processName & "! @error: " & @error & @CRLF & "Continue?") == 6 Then
$handles = 0
ContinueLoop
Else
Exit
EndIf
Else
GUICtrlSetData($gameStatus, "Game is running (PID = " & $processId & ").")
EndIf
EndIf
If $address == 0 Then
$address = _KDMemory_GetModuleBaseAddress($handles, $processName) + $baseOffsetMobHp
If @error Then
If MsgBox(52, "Error", "Can't get ModuleBaseAddress! @error: " & @error & ", @extended: " & @extended & @CRLF & "Continue?") == 6 Then
$address = 0
ContinueLoop
Else
Exit
EndIf
EndIf
EndIf
; read memory from process
$memoryData = _KDMemory_ReadProcessMemory($handles, $address, "DWORD", $offsetsHP)
If Not @error Then
If GUICtrlRead($mobHP) <> $memoryData[1] Then GUICtrlSetData($mobHP, $memoryData[1])
EndIf
WEnd
|
|
|
05/22/2014, 17:48
|
#2
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
|
Quote:
Originally Posted by LiveLong23
i get "@error:15, @extended:1" error
|
This error (@error) indicates the function failed while trying to get the pointer at the first offset (@extended). This information should be enough to google a solution.
You could even find the error without any information from the script. You just don't know how CE works. The error has nothing to do with my UDF, it works fine.
Quote:
Originally Posted by LiveLong23
Code:
Const $offsets[5] = [0x72c, 0x18c, 0x48, 0x6c0, 0x25c]
|
Seems to be correct, right? No! Can you find the error? No? I'll give you a hint: the first offset is the last offset and the last offset is the first offset.
Quote:
Originally Posted by LiveLong23
And process name AlefClient.exe *32
|
"*32" indicates that the process is a 32 bit process. You should compile your script as a 32 bit application for compatibility reasons.
Code:
#AutoIt3Wrapper_UseX64=n ; 32 Bit application
;~ #AutoIt3Wrapper_UseX64=y ; 64 Bit application
#RequireAdmin
#include "KDMemory.au3"
Dim $handles = 0, $address = 0, $tmpError = 0, $tmpData[2]
Const $processName = "AlefClient.exe", $moduleName = $processName
Const $baseOffset = 0x0055D834
Const $offsetsMobHP[5] = [0x25C, 0x6C0, 0x48, 0x18C, 0x72C]
GUICreate("Mob HP", 200, 40)
$lbl_Info = GUICtrlCreateLabel("Waiting for '" & $processName & "'...", 5, 5, 190, 30)
GUISetState()
While True
;~ Sleep()
$msg = GUIGetMsg()
Switch $msg
Case -3 ; $GUI_EVENT_CLOSE
Exit
EndSwitch
$processId = ProcessExists($processName)
If $processId == 0 Then
If IsArray($handles) Then
_KDMemory_CloseHandles($handles)
$handles = 0
$address = 0
GUICtrlSetData($lbl_Info, "Waiting for '" & $processName & "'...")
EndIf
ContinueLoop
EndIf
If $handles == 0 Then
$handles = _KDMemory_OpenProcess($processId)
If @error Then
If MsgBox(52, "Error", "Can't open '" & $processName & "'!" & @CRLF & "@error: " & @error & @CRLF & @CRLF & "Continue?") == 6 Then
$handles = 0
ContinueLoop
Else
Exit
EndIf
EndIf
EndIf
If $address == 0 Then
$address = _KDMemory_GetModuleBaseAddress($handles, $processName) + $baseOffset
If @error Then
If MsgBox(52, "Error", "Can't get ModuleBaseAddress '(" & $moduleName & ")'!" & @CRLF & "@error: " & @error & ", @extended: " & @extended & @CRLF & @CRLF & "Continue?") == 6 Then
$address = 0
ContinueLoop
Else
Exit
EndIf
EndIf
EndIf
$memoryData = _KDMemory_ReadProcessMemory($handles, $address, "DWORD", $offsetsMobHP)
If @error Then
If $tmpError <> @error Then
$tmpError = @error
GUICtrlSetData($lbl_Info, "Can't read memory!" & @CRLF & "@error: " & @error & ", @extended: " & @extended)
EndIf
Else
If $tmpData[0] <> $memoryData[0] Or $tmpData[1] <> $memoryData[1] Then
$tmpData = $memoryData
GUICtrlSetData($lbl_Info, "Address: " & $memoryData[0] & @CRLF & "Value: " & $memoryData[1])
EndIf
EndIf
WEnd
|
|
|
05/22/2014, 18:23
|
#3
|
elite*gold: 0
Join Date: Jan 2014
Posts: 43
Received Thanks: 1
|
Still error i tried 64 32 bit compiled or not compiled all ways and here is result
Here is pic of error
I found how to run it, because game must run under sanbox, first i run the game sandboxed and then compiled 32 bit script and now works.
|
|
|
|
Similar Threads
|
KDMemory (AutoIt 32 & 64 Bit)
04/02/2017 - AutoIt - 52 Replies
Functions:
|
KDMemory Problem
11/28/2013 - AutoIt - 5 Replies
Ich kann leider diesen Pointer nicht auslesen:
http://i.epvpimg.com/ffKeg.png
Mein Code:
#RequireAdmin
#include "KDMemory.au3"
Global $pid = ProcessExists("javaw.exe")
Global $handle = _KDMemory_OpenProcess($pid)
$baseAddress = _KDMemory_GetModuleBaseAddress($handle, "jvm.dll") + 0x00007AB4
Dim $offsets =
|
[HELP] READING THE GUI.INI
11/10/2010 - EO PServer Hosting - 3 Replies
As the title said, i would like to have someone to teach me a little bit for play around the GUI.INI(interface on the game where cell x and cell y) i just want to know what kind of interface will be add throw GUI.ini..for sure yes i know how to read cell x and cell y to read know the interface but need some time for it lol..
Example of GUI.ini
x=96
y=48
w=54
h=22
Title=统计资料- 5293;幻兽按钮
|
Reading HP
12/27/2008 - CO2 Programming - 7 Replies
NOTE* Addresses change at almost every update on the Conquer.exe, These addresses might not work on the new patch. This code is written for 5068 patch.
I know some people have had trouble reading HP from Conquers memory so, here's a little "tutorial" how to save the real hp value to a static location. I'm not going much to depth how I found the places I'm using in this tutorial.
First of all, you need a OllyDBG. (Well that's what this tutorial is written for) Next thing we do is, open...
|
All times are GMT +2. The time now is 06:26.
|
|