Das hier ist die Maestia API, die ich mir in den letzten Jahren so zusammen geschrieben habe.
Sie bietet die Möglichkeit Werte zu lesen und zu schreiben.
Die API ist in AutoIt geschrieben.
Sie basiert auf der NomadMemory.au3, da diese genutzt wird um den Speicher zu lesen und zu schreiben.
Also bevor ihr diese API nutzen könnt müsst ihr die NomadMemory.au3 downloaden und includen.
Alle werte kommen direkt aus dem speicher, daher lässt sich die API auch bei minimiertem Fenster nutzen.
um die API zu nutzen braucht ihr ebenfalls die Memory_Constants.au3
in ihr stehen die Patterns und die Offsets für die Memorywerte
Die Memory_Constants.au3 muss ebenfalls ins projekt included werden
Memory_Constants.au3
Global $Basepointer_Player, $Basepointer_Gegner, $Basepointer_Cam,$Basepointer_Goettliche_Energie, $Gegner_Entity ;Globale Variablen
Global Const $Player_ID_Offset = 0x04 ;dword Global Const $Player_Name_Offset = 0x10 ;wchar* Global Const $Player_Name_Len_Offset = 0x20 ;dword Global Const $Player_Gilde_Offset = 0x48 ;wchar* Global Const $Player_Gilde_Len_Offset = 0x58 ;dword
Global Const $Player_Level_Offset_Pattern = "\x83\xB8\x00\x00\x00\x00\x05\x0F\x87\x00\x00\x00\x00\x8B\x0D" Global Const $Player_Level_Offset_Mask = "xx????xxx????xx" Global Const $Player_Level_Offset_Offset = 0x02 Global $Player_Level_Offset ;dword
Global Const $HP_Cur_Offset = 0xA4 ;dword Global Const $MP_Cur_Offset = 0xA8 ;dword Global Const $HP_Max_Offset = 0xB0 ;dword Global Const $MP_Max_Offset = 0xB4 ;dword Global Const $X_Offset = 0x1A4 ;float Global Const $Y_Offset = 0x1A8 ;float Global Const $Z_Offset = 0x1AC ;float Global Const $Target_ID_Offset = 0x390 Global Const $X_Rotation_Offset = 0x3B8;float x-richtung einheitsvektor = laufrichtung Global Const $Z_Rotation_Offset = 0x3BC;float z-richtung Global Const $Player_Status_Offset = 0x43A ;Word Global Const $Ausruh_Status_Offset = 0x420 ;byte
Global Const $Speed_Offset_Pattern = "\xD8\x0D\x00\x00\x00\x00\xD9\x99\x00\x00\x00\x00" Global Const $Speed_Offset_Mask = "xx????xx????" Global Const $Speed_Offset_Offset = 0x08 Global $Speed_Offset ;float
Global Const $Angriffsmodus_Offset = 0x4C8 ;byte
Global Const $Exp_Cur_Offset_Pattern = "\x3B\x4D\x10\x75\x00\x8B\x55\x08\x89\x90" Global Const $Exp_Cur_Offset_Mask = "xxxx?xxxxx" Global Const $Exp_Cur_Offset_Offset = 0x0A
Global $Exp_Cur_Offset Global $Exp_Max_Offset Global $Gold_Offset Global $Deus_P_Offset
Global Const $Player_Vit_Offset_Pattern = "\x83\xFE\x01\x0F\x85\x00\x00\x00\x00\x8B\x97" Global Const $Player_Vit_Offset_Mask = "xxxxx????xx" Global Const $Player_Vit_Offset_Offset = 0x11 Global $Player_Vit_Offset Global $Armor_Vit_Offset Global $Player_Str_Offset Global $Armor_Str_Offset Global $Player_Agi_Offset Global $Armor_Agi_Offset Global $Player_Int_Offset Global $Armor_Int_Offset Global $Player_Wis_Offset Global $Armor_Wis_Offset
Global Const $Status_Laufen = 7 Global Const $Status_Looten = 13 Global Const $Status_Quest_Gebet = 16 Global Const $Status_Stehen = 20 Global Const $Status_Stehen1 = 21 Global Const $Status_Stehen2 = 37 Global Const $Status_Springen = 60 Global Const $Status_Beten = 116 Global Const $Status_Mount = 300 Global Const $Status_Mount_Laufen = 307
Global Const $V_Offset = 0x1EC ;float (-pi/2 bis pi/2 Global Const $H_Offset = 0x1F0; float (0= negative x richtung 2pi=0)
;Gegner Strucs Global Const $Basepointer_Gegner_Pattern = "\x83\xC0\xB0\xA3" Global Const $Basepointer_Gegner_Mask = "xxxx" Global Const $Basepointer_Gegner_Offset = 0x04 Global Const $Gegner_Offset[2] = [0xE4,0x16C]
Global Const $Gegner_Typ_Offset = 0x80 ;byte 1= Krieger ; 2= Magier ; 3= Waldläufer ; 4= Priest ; 255= NPC Global Const $Gegner_Leben_Cur_Offset = 0x84 ;dword (wird nicht upgedated) Global Const $Gegner_Time_Offset = 0xA4 ;float Dauer in Sekunden, monster im Target Global Const $Gegner_Entfernung_Offset = 0xD8 ;float Global Const $Gegner_Anvisiert_Offset = 0xDC ;byte Global Const $Gegner_Target_ID_Offset = 0xE0 ;dword Global Const $Gegner_Aggro_Offset = 0xE4 ;byte 1=aggro
Global Const $Basepointer_Goettliche_Energie_Offset = 0x25C Global Const $Goettliche_Energie_Offset = 0x50 ;float max 100
Global Const $Gegner_Entity_Pattern = "\xA1\x00\x00\x00\x00\x50\xE8\x00\x00\x00\x00\xC3" Global Const $Gegner_Entity_Mask = "x????xx????x" Global Const $Gegner_Entity_Offset = 0x01
;dword Global Const $Player_Offset_Pattern = "\xC7\x45\x00\x00\x00\x00\x00\x8B\xBE\x00\x00\x00\x00\x85\xFF" Global Const $Player_Offset_Mask = "xx?????xx????xx" Global Const $Player_Offset_Offset = 0x09
Global Const $Gegner_Liste = 0xB8 Global Const $Naechstes_Listen_Element = 0x00 Global Const $Vorheriges_Listen_Element = 0x04
Global $Gegner_Object_Offset Global Const $Gegner_Object_Offset_Pattern = "\x89\x8F\x00\x00\x00\x00\x50\x8B\xCF" Global Const $Gegner_Object_Offset_Mask = "xx????xxx" Global Const $Gegner_Object_Offset_Offset = 0x02
um alle memorywerte und offsets zu initalisieren müsst ihr die patterns-scanen, dafür braucht ihr auch eine extra Datei
SearchPattern.au3
Func _MemoryScanEx($ah_Handle, $pattern, $mask, $after = False, $iv_addrStart = 0x00400000, $iv_addrEnd = 0x00FFFFFF, $step = 51200) If Not IsArray($ah_Handle) Then SetError(1) Return -1 EndIf $pattern = StringRegExpReplace($pattern, "[^0123456789ABCDEFabcdef.]", "") If StringLen($pattern) = 0 Then SetError(2) Return -2 EndIf If StringLen($pattern) / 2 <> StringLen($mask) Then SetError(4) Return -4 EndIf Local $formatedpattern = "" Local $BufferPattern Local $BufferMask For $i = 0 To StringLen($mask) - 1 $BufferPattern = StringLeft($pattern, 2) $pattern = StringRight($pattern, StringLen($pattern) - 2) $BufferMask = StringLeft($mask, 1) $mask = StringRight($mask, StringLen($mask) - 1) If $BufferMask = "?" Then $BufferPattern = ".." $formatedpattern = $formatedpattern & $BufferPattern Next $pattern = $formatedpattern For $addr = $iv_addrStart To $iv_addrEnd Step $step - (StringLen($pattern) / 2) StringRegExp(_MemoryRead($addr, $ah_Handle, "byte[" & $step & "]"), $pattern, 1, 2) If Not @error Then If $after Then Return StringFormat("0x%.8X", $addr + ((@extended - 2) / 2)) Else Return StringFormat("0x%.8X", $addr + ((@extended - StringLen($pattern) - 2) / 2)) EndIf EndIf Next SetError(3) Return -3 EndFunc ;==>_MemoryScanEx
Func _find_Offset($hProcess,$sName,$sType = "dword") Local $Address if Not IsDeclared ( $sName&"_Pattern" ) OR Not IsDeclared ( $sName&"_Mask" ) OR Not IsDeclared ( $sName&"_Offset" ) Then MsgBox(0,"Error","Could not find "&$sName&" Error-Code:1") Return SetError(1) EndIf $Address = _MemoryScanEx($hProcess, Eval($sName&"_Pattern"), Eval($sName&"_Mask")) if $Address <= 0 Then MsgBox(0,"Error","Could not find "&$sName&" Error-Code:2") Return SetError(2) EndIf $Address += Eval($sName&"_Offset") $Address = _MemoryRead($Address,$hProcess,$sType) if $Address > 0 Then Return $Address Else MsgBox(0,"Error","Could not find "&$sName&" Error-Code:3") Return SetError(3) EndIf EndFunc
Func _find_Function($hProcess,$sName) Local $Address if Not IsDeclared ( $sName&"_Pattern" ) OR Not IsDeclared ( $sName&"_Mask" ) OR Not IsDeclared ( $sName&"_Offset" ) Then MsgBox(0,"Error","Could not find "&$sName&" Error-Code:1") Return SetError(1) EndIf $Address = _MemoryScanEx($hProcess, Eval($sName&"_Pattern"), Eval($sName&"_Mask")) if $Address <= 0 Then MsgBox(0,"Error","Could not find "&$sName&" Error-Code:2") Return SetError(2) EndIf $Address += Eval($sName&"_Offset") if $Address > 0 Then Return $Address Else MsgBox(0,"Error","Could not find "&$sName&" Error-Code:3") Return SetError(3) EndIf EndFunc
so jetzt aber mal zum essentiellen: Die Memory_Functions.au3
dort werden alle werte gelesen und geschrieben
Memory_Functions.au3
#RequireAdmin ;benötigt um den prozess zu öffnen #include <NomadMemory.au3> ;benötigt um den speicher zu öffnen und auszulesen #include "SearchPattern.au3" ;benötigt um die byte-muster im prozess zu finden #include "Memory_Constants.au3" ;byte-muster + offsets #include "Memory Functions.au3" ;Eigentliche funktion um Werte zu lesen
$Gegner_Object_Offset = _find_Offset($hProcess,"Gegner_Object_Offset") if Not @error Then return True Else _log("Gegner_Object_Offset has not been found. Error: "&@error) Return SetError(2) EndIf Else _log("Basepointer_Enemy has not been found. Error: "&@error) Return SetError(1) EndIf EndFunc
Hi,
erstmal danke für die API, funzt gut
bis auf die Rotation Offsets, musste ich bei mir korrigieren:
Global Const $X_Rotation_Offset = 0x3B8;float x-richtung einheitsvektor = laufrichtung
Global Const $Z_Rotation_Offset = 0x3BC;float z-richtung
Was auch nicht funzt ist das Auslesen der Erleuchtung. Immer 0.0 ...
hab ich noch nicht wiedergefunden ...
Erklär mir kurz wie du den Pointer auf die Erleuchtung findest und ich mach das. Dier Adresse hab ich gefunden, ändert sich aber immer. Finde den Pointer nicht ....
Soooo fit bin ich noch nicht
pmaverick
danke runzel das du es zur Verfügung gestellt hast mit den daten die man da gewinnt lässt sich ne menge mit anfangen aber was ich vermisse und auch schon stunden nach gesucht habe ist die adresse für den damage vielleicht kannst du da helfen
This is the Maestia API that I have written to me in recent years so together.
It provides the ability to read and write values.
The API is written in AutoIt.
It is based on the NomadMemory.au3 because this is used to read the memory and to write.
So before you can use this API you have the NomadMemory.au3 download and including the same.
All values come directly from the store, so can the API to use if window is minimized.
To use the API you need also the Memory_Constants.au3
in her are the Patterns and the offsets for the memory values
The Memory_Constants.au3 must also be included in the project
Memory_Constants.au3
Spoiler
memory values to all and to initialize offsets you have the patterns-Scanning, but you need a separate file
SearchPattern.au3
Spoiler
so now but once the essential: The Memory_Functions.au3
there all be read and written values
Memory_Functions.au3
Spoiler
(The __entity ... functions are not intended for direct use, is only the structure of Maestia empathize)
To use this feature must first all Base pointers and offsets are initialized:
Here is an example script:
Spoiler
With the API you can write without problems your own bots.