**** idk if im stupid or what i got problem again but this time with this + pointers
it work fine with player name because have only base address but enemy name have offsets
and i dont know where to put them
Code:
Global $eName = 0x0112C1C4 ; enemy name
Global $eNamePointer[5] = [0x0, 0x324, 0x8, 0x0, 0x270] ; enemy pointer
Func _enemyName()
$handles = _KDMemory_OpenProcess($processId)
$baseAddress = _KDMemory_GetModuleBaseAddress($handles, $moduleName) + $eName
; $memoryData = _KDMemory_ReadProcessMemory($handles, $baseAddress, "WCHAR[25] (Unicode)", $eNamePointer)
$memoryData = _KDMemory_ReadProcessString($handles, $baseAddress, 0, 1)
If Not @error Then
If GUICtrlRead($enemyName) <> $memoryData[1] Then GUICtrlSetData($enemyName, $memoryData[1])
EndIf
_KDMemory_CloseHandles($handles)
EndFunc
**** idk if im stupid or what i got problem again but this time with this + pointers
it work fine with player name because have only base address but enemy name have offsets
and i dont know where to put them
I was actually looking through your 2 examples last night before I fell asleep, but it was a little confusing for me. I'm going to take another look at it later today after work, but would it be possible for you to add more ;notes explaining what some of the lines do? I felt a little lost.
The reason why the pointer address is wrong is because my UDF doesn't need the useless (and annoying) zero-offset. Instead of using two offsets you're using three offsets.
This line can't work. The fourth parameter ($unicode) can be either 0 or 1. It determines if the string is a Unicode string or not. It should be 1 in your case. This function will read the complete string, you don't have to make the decision how long the string could be.
It would also be correct if you replace the function with _KDMemory_ReadProcessMemory(), but I recommend to use the _KDMemory_ReadProcessString() function.
#AutoIt3Wrapper_UseX64=n ; 32 Bit application
;~ #AutoIt3Wrapper_UseX64=y ; 64 Bit application
#RequireAdmin
#include <Array.au3>
#include "KDMemory.au3"
Const $processName = "Gw2.exe", $moduleName = $processName
Const $offsets[1] = [0x67]
$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
; Do you actually need the base address?
$baseAddress = _KDMemory_GetModuleBaseAddress($handles, $moduleName)
If @error Then
MsgBox(48, "Error", "Can't get ModuleBaseAddress ('" & $moduleName & "')!" & @CRLF & "@error: " & @error & ", @extended: " & @extended)
Else
Local $errors
$readAddress = _KDMemory_FindAddress($handles, "FF 50 1C 85 C0 74 1B", $baseAddress, 0x7FFFFFFF, $errors) ; Is it possible to decrease the $endAddress? This scan could take a lot of time after the game is patched and the pattern is invalid.
If @error Or @extended Then
MsgBox(48, "Error", "_KDMemory_FindAddress failed!" & @CRLF & "@error: " & @error & ", @extended: " & @extended)
If IsArray($errors) Then _ArrayDisplay($errors)
Else
$memoryData = _KDMemory_ReadProcessMemory($handles, $readAddress - 0x04, "DWORD", $offsets) ; You may want to change the type.
If @error Then
MsgBox(48, "Error", "Can't read memory!" & @CRLF & "@error: " & @error & ", @extended: " & @extended)
Else
MsgBox(64, "Info", "(Final) Address: " & $memoryData[0] & @CRLF & "Value: " & $memoryData[1])
EndIf
EndIf
EndIf
_KDMemory_CloseHandles($handles)
EndIf
EndIf
The original was from another forum to determine the Lootadresse.
With the help of your KDMemory I have now found another way and get the Lootpointer directly.
I had not found any example for the use of _KDMemory_FindAddress.
The original was from another forum to determine the Lootadresse.
With the help of your KDMemory I have now found another way and get the Lootpointer directly.
I had not found any example for the use of _KDMemory_FindAddress.
Thank you.
I was looking around this forum and saw your post a week later lol. Why not try this, uses string functions to scan for an AOB. Much much faster, just don't use unknown bytes.
erstmal möchte ich mich für deine UDF bedanken, allerdings hab ich ein kleineres Problem.
Wenn ich mein Programm in 64-Bit starte wird die richtige BaseAddress herausgefunden, allerdings kann ich keine Addressen auslesen und den richtigen Wert finden. Hier der Code und Screenshots:
Wenn ich das Programm im 32-Bit Modus starte finde ich nicht die richtige / keine BaseAddress und dementsprechend kann ich auch keine Addressen finden. Hier der gleiche Code auf 32Bit umgestellt und die Screenshots:
Der zweite Error kommt direkt nachdem ich den ersten weggedrückt habe.
Wär echt gut wenn irgendjemand ne Lösung für mein Problem hat!
Edit: Wichtige Frage, funktioniert das überhaupt wenn ich den StaticCast (0x025BDB80) zu den Offsets hinzufüge. Im Grunde wird diese Adresse ja genau wie die andere auch auf die BaseAddress addiert....