habe mal wieder lust etwas zu releasen
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
PHP Code:
#include-once
Global Const $PI = 3.1415
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
;Cam Strucs
;Gegner BasePointer + ...
Global Const $Cam_Offset[2] = [0x98,8]
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
PHP Code:
#include-once
#include <NomadMemory.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
PHP Code:
#include-once
#include <NomadMemory.au3>
#include "Memory_Constants.au3"
#region Entity
Func __Entity_ID($hProcess, $Pointer)
Return _MemoryRead($Pointer + $Player_ID_Offset, $hProcess, 'dword')
EndFunc
Func __Entity_Name($hProcess, $Pointer)
Local $aString
Local $iLen = _MemoryRead($Pointer +$Player_Name_Len_Offset, $hProcess, 'dword')
If $iLen > 7 Then
$Pointer = _MemoryRead($Pointer +$Player_Name_Offset, $hProcess, 'dword')
$aString = _MemoryRead($Pointer, $hProcess, 'wchar['&$iLen&']')
Else
$aString = _MemoryRead($Pointer +$Player_Name_Offset, $hProcess, 'wchar['&$iLen&']')
EndIf
Return $aString
EndFunc
Func __Entity_Guild($hProcess, $Pointer)
Local $aString
Local $iLen = _MemoryRead($Pointer +$Player_Gilde_Len_Offset, $hProcess, 'dword')
If $iLen > 7 Then
$Pointer = _MemoryRead($Pointer +$Player_Gilde_Offset, $hProcess, 'dword')
$aString = _MemoryRead($Pointer, $hProcess, 'wchar['&$iLen&']')
Else
$aString = _MemoryRead($Pointer +$Player_Gilde_Offset, $hProcess,'wchar['&$iLen&']')
EndIf
Return $aString
EndFunc
Func __Entity_Level($hProcess, $Pointer)
Return _MemoryRead($Pointer + $Player_Level_Offset, $hProcess, 'dword')
EndFunc
Func __Entity_HP_Max($hProcess, $Pointer)
Return _MemoryRead($Pointer + $HP_Max_Offset, $hProcess, 'dword')
EndFunc
Func __Entity_HP_Cur($hProcess, $Pointer)
Return _MemoryRead($Pointer + $HP_Cur_Offset, $hProcess, 'dword')
EndFunc
Func __Entity_MP_Max($hProcess, $Pointer)
Return _MemoryRead($Pointer + $MP_Max_Offset, $hProcess, 'dword')
EndFunc
Func __Entity_MP_Cur($hProcess, $Pointer)
Return _MemoryRead($Pointer + $MP_Cur_Offset, $hProcess, 'dword')
EndFunc
Func __Entity_Coord($hProcess, $Pointer)
Local $aCoords[3]
$aCoords[0] = __Entity_Coord_X($hProcess,$Pointer)
$aCoords[1] = __Entity_Coord_Y($hProcess,$Pointer)
$aCoords[2] = __Entity_Coord_Z($hProcess,$Pointer)
Return $aCoords
EndFunc
Func __Entity_Coord_X($hProcess, $Pointer)
Return _MemoryRead($Pointer + $X_Offset, $hProcess, 'float')
EndFunc
Func __Entity_Coord_Y($hProcess, $Pointer)
Return _MemoryRead($Pointer + $Y_Offset, $hProcess, 'float')
EndFunc
Func __Entity_Coord_Z($hProcess, $Pointer)
Return _MemoryRead($Pointer + $Z_Offset, $hProcess, 'float')
EndFunc
Func __Entity_Target_ID($hProcess, $Pointer)
Return _MemoryRead($Pointer + $Target_ID_Offset, $hProcess, 'dword')
EndFunc
Func __Entity_Rotation_X($hProcess, $Pointer)
Return _MemoryRead($Pointer + $X_Rotation_Offset, $hProcess, 'float')
EndFunc
Func __Entity_Set_Rotation_X($hProcess, $Pointer, $Wert)
Return _MemoryWrite($Pointer + $X_Rotation_Offset, $hProcess, $Wert, 'float')
EndFunc
Func __Entity_Rotation_Z($hProcess, $Pointer)
Return _MemoryRead($Pointer + $Z_Rotation_Offset, $hProcess, 'float')
EndFunc
Func __Entity_Set_Rotation_Z($hProcess, $Pointer, $Wert)
Return _MemoryWrite($Pointer + $Z_Rotation_Offset, $hProcess, $Wert, 'float')
EndFunc
Func __Entity_Status($hProcess, $Pointer)
Return _MemoryRead($Pointer + $Player_Status_Offset, $hProcess, 'word')
EndFunc
#endregion
#region player
Func _Player_ID($hProcess)
Return __Entity_ID($hProcess, $Basepointer_Player)
EndFunc
Func _Player_Name($hProcess)
Return __Entity_Name($hProcess, $Basepointer_Player)
EndFunc
Func _Player_Guild($hProcess)
Return __Entity_Guild($hProcess, $Basepointer_Player)
EndFunc
Func _Player_Level($hProcess)
Return __Entity_Level($hProcess, $Basepointer_Player)
EndFunc ;==>_Player_Level
Func _Player_Coord($hProcess)
Return __Entity_Coord($hProcess, $Basepointer_Player)
EndFunc
Func _Player_Target_ID($hProcess)
Return __Entity_Target_ID($hProcess, $Basepointer_Player)
EndFunc
Func _Player_Rotation_X($hProcess)
Return __Entity_Rotation_X($hProcess, $Basepointer_Player)
EndFunc ;==>_Player_Rotation_X
Func _Player_Set_Rotation_X($hProcess, $Wert)
Return __Entity_Set_Rotation_X($hProcess, $Basepointer_Player, $Wert)
EndFunc ;==>_Player_Set_Rotation_X
Func _Player_Rotation_Z($hProcess)
Return __Entity_Rotation_Z($hProcess, $Basepointer_Player)
EndFunc ;==>_Player_Rotation_Z
Func _Player_Set_Rotation_Z($hProcess, $Wert)
Return __Entity_Set_Rotation_Z($hProcess, $Basepointer_Player, $Wert)
EndFunc ;==>_Player_Set_Rotation_Z
Func _Player_HP_Max($hProcess)
Return __Entity_HP_Max($hProcess, $Basepointer_Player)
EndFunc ;==>_Player_HP_Max
Func _Player_HP_Cur($hProcess)
Return __Entity_HP_Cur($hProcess, $Basepointer_Player)
EndFunc ;==>_Player_HP_Cur
Func _Player_MP_Max($hProcess)
Return __Entity_MP_Max($hProcess, $Basepointer_Player)
EndFunc ;==>_Player_MP_Max
Func _Player_MP_Cur($hProcess)
Return __Entity_MP_Cur($hProcess, $Basepointer_Player)
EndFunc ;==>_Player_MP_Cur
Func _Player_Status($hProcess)
Return __Entity_Status($hProcess, $Basepointer_Player)
EndFunc
Func _Player_Exp_Cur($hProcess)
Return _MemoryRead($Basepointer_Player + $Exp_Cur_Offset, $hProcess, 'dword')
EndFunc ;==>_Player_Exp_Cur
Func _Player_Exp_Max($hProcess)
Return _MemoryRead($Basepointer_Player + $Exp_Max_Offset, $hProcess, 'dword')
EndFunc ;==>_Player_Exp_Max
Func _Player_Gold($hProcess)
Return _MemoryRead($Basepointer_Player + $Gold_Offset, $hProcess, 'dword')
EndFunc ;==>_Player_Gold
Func _Player_Deus($hProcess)
Return _MemoryRead($Basepointer_Player + $Deus_P_Offset, $hProcess, 'dword')
EndFunc ;==>_Player_Deus
Func _Player_Erleuchtung($hProcess)
Return _MemoryRead($Basepointer_Goettliche_Energie + $Goettliche_Energie_Offset, $hProcess, 'float')
EndFunc ;==>_Player_Erleuchtung
Func _Player_Speed($hProcess)
Return _MemoryRead($Basepointer_Player + $Speed_Offset, $hProcess, 'float')
EndFunc ;==>_Player_Speed
Func _Player_Set_Speed($hProcess,$Wert)
_MemoryWrite($Basepointer_Player + $Speed_Offset, $hProcess, $Wert, 'float')
EndFunc ;==>_Player_Set_Speed
Func _Angriffsmodus($hProcess) ;nicht mehr nutzen -> _Player_Status()
Return _MemoryRead($Basepointer_Player + $Angriffsmodus_Offset, $hProcess, 'byte')
EndFunc ;==>_Angriffsmodus
Func _Player_Player_Vit($hProcess)
Return _MemoryRead($Basepointer_Player + $Player_Vit_Offset, $hProcess, 'dword')
EndFunc
Func _Player_Armor_Vit($hProcess)
Return _MemoryRead($Basepointer_Player + $Armor_Vit_Offset, $hProcess, 'dword')
EndFunc
Func _Player_Player_Str($hProcess)
Return _MemoryRead($Basepointer_Player + $Player_Str_Offset, $hProcess, 'dword')
EndFunc
Func _Player_Armor_Str($hProcess)
Return _MemoryRead($Basepointer_Player + $Armor_Str_Offset, $hProcess, 'dword')
EndFunc
Func _Player_Player_Agi($hProcess)
Return _MemoryRead($Basepointer_Player + $Player_Agi_Offset, $hProcess, 'dword')
EndFunc
Func _Player_Armor_Agi($hProcess)
Return _MemoryRead($Basepointer_Player + $Armor_Agi_Offset, $hProcess, 'dword')
EndFunc
Func _Player_Player_Int($hProcess)
Return _MemoryRead($Basepointer_Player + $Player_int_Offset, $hProcess, 'dword')
EndFunc
Func _Player_Armor_Int($hProcess)
Return _MemoryRead($Basepointer_Player + $Armor_Int_Offset, $hProcess, 'dword')
EndFunc
Func _Player_Player_Wis($hProcess)
Return _MemoryRead($Basepointer_Player + $Player_Wis_Offset, $hProcess, 'dword')
EndFunc
Func _Player_Armor_Wis($hProcess)
Return _MemoryRead($Basepointer_Player + $Armor_Wis_Offset, $hProcess, 'dword')
EndFunc
#endregion
;------------------------- GEGNER -------------------------------------
Func _Gegner_Pointer($hProcess)
Return _MemoryRead($Gegner_Entity + $Gegner_Object_Offset, $hProcess, 'dword')
EndFunc
Func _Gegner_Coord($hProcess)
Local $Pointer
Local $aCoords[3]
$Pointer = _Gegner_Pointer($hProcess)
$aCoords[0] = __Entity_Coord_X($hProcess, $Pointer)
$aCoords[1] = __Entity_Coord_Y($hProcess, $Pointer)
$aCoords[2] = __Entity_Coord_Z($hProcess, $Pointer)
Return $aCoords
EndFunc
Func _Gegner_Name($hProcess)
Local $Pointer
$Pointer = _Gegner_Pointer($hProcess)
Return __Entity_Name($hProcess, $Pointer)
EndFunc
Func _Gegner_Level($hProcess)
Local $Pointer
$Pointer = _Gegner_Pointer($hProcess)
Return __Entity_Level($hProcess, $Pointer)
EndFunc ;==>_Gegner_Level
Func _Gegner_ID($hProcess)
Local $Pointer
$Pointer = _Gegner_Pointer($hProcess)
Return __Entity_ID($hProcess, $Pointer)
EndFunc
Func _Gegner_HP_Max($hProcess)
Local $Pointer
$Pointer = _Gegner_Pointer($hProcess)
Return __Entity_HP_Max($hProcess, $Pointer)
EndFunc
Func _Gegner_MP_Max($hProcess)
Local $Pointer
$Pointer = _Gegner_Pointer($hProcess)
Return __Entity_MP_Max($hProcess, $Pointer)
EndFunc
Func _Gegner_HP_Cur($hProcess)
Local $Pointer
$Pointer = _Gegner_Pointer($hProcess)
Return __Entity_HP_Cur($hProcess, $Pointer)
EndFunc ;==>_Gegner_Leben
Func _Gegner_MP_Cur($hProcess)
Local $Pointer
$Pointer = _Gegner_Pointer($hProcess)
Return __Entity_MP_Cur($hProcess, $Pointer)
EndFunc ;==>_Gegner_Leben
Func _Gegner_Target_ID($hProcess)
Local $Pointer
$Pointer = _Gegner_Pointer($hProcess)
Return __Entity_Target_ID($hProcess, $Pointer)
EndFunc
Func _Gegner_Typ($hProcess)
Return _MemoryRead($Basepointer_Gegner + $Gegner_Typ_Offset, $hProcess, 'byte')
EndFunc ;==>_Gegner_Typ
Func _Gegner_Typ_S($hProcess)
$Typ = _Gegner_Typ($hProcess)
;byte 1= Krieger ; 2= Magier ; 3= Waldläufer ; 4= Priest ; 255= NPC
Switch $Typ
Case 1
Return "Warrior"
Case 2
Return "Mage"
Case 3
Return "Ranger"
Case 4
Return "Priest"
Case 255
Return "NPC"
EndSwitch
EndFunc
Func _Gegner_Anvisiert($hProcess)
Return _MemoryRead($Basepointer_Gegner + $Gegner_Anvisiert_Offset, $hProcess, 'byte')
EndFunc ;==>_Gegner_Anvisiert
Func _Gegner_Entfernung($hProcess)
Return _MemoryRead($Basepointer_Gegner + $Gegner_Entfernung_Offset, $hProcess, 'float')
EndFunc ;==>_Gegner_Entfernung
Func _Cam_H($hProcess)
Return _MemoryRead($Basepointer_Cam + $H_Offset, $hProcess, 'float')
EndFunc ;==>_Cam_H
Func _Cam_Set_H($hProcess,$value)
_MemoryWrite($Basepointer_Cam + $H_Offset, $hProcess, $value, 'float')
EndFunc
Func _Cam_V($hProcess)
Return _MemoryRead($Basepointer_Cam + $V_Offset, $hProcess, 'float')
EndFunc ;==>_Cam_V
um diese funktionen nutzen zu können müssen vorher alle Basepointer und Offsets initialisiert werden:
Hier ein Beispielskript:
PHP Code:
#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
$PID = ProcessExists("maestia.exe") ;ProzessID von Maestia
Global $hProcess = _MemoryOpen($PID) ;Prozess öffnen
Global $Gegner_Entity = _initGegner_Entity($hProcess) ;gamepointer suchen
_initPlayer($hProcess) ;player pointer initialisieren
_initGegner($hProcess) ;gegner pointer initialisieren
_initCam($hProcess) ;Kamera initialisieren
_initGoetlicheEnergie($hProcess) ;Erleuchtung initialisieren
;Player auslesen
_log("Basepointer_Player points at: %X", True, $Basepointer_Player)
_log("Player ID: %i",True, _Player_ID($hProcess))
_log("Player Name: %s", True, _Player_Name($hProcess))
_log("Player Guild: %s", True, _Player_Guild($hProcess))
_log("Current Level: %i", True, _Player_Level($hProcess))
_log("Current HP: %i", True, _Player_HP_Cur($hProcess))
_log("Maximal HP: %i", True, _Player_HP_Max($hProcess))
_log("Current MP: %i", True, _Player_MP_Cur($hProcess))
_log("Maximal MP: %i", True, _Player_MP_Max($hProcess))
$aCoord = _Player_Coord($hProcess)
_log("X-Coord: %.1f", True, $aCoord[0])
_log("Y-Coord: %.1f", True, $aCoord[1])
_log("Z-Coord: %.1f", True, $aCoord[2])
_log("Target ID: %i", True, _Player_Target_ID($hProcess))
_log("Current Speed: %f", True, _Player_Speed($hProcess))
_log("Current Speed: %X", True, $Basepointer_Player + $Speed_Offset)
_log("Current Status %i",True,_Player_Status($hProcess))
_log("Attack State %i",True,_Angriffsmodus($hProcess))
_log("Player Vit: %i", True, _Player_Player_Vit($hProcess))
_log("Armor Vit: %i", True, _Player_Armor_Vit($hProcess))
_log("Player Str: %i", True, _Player_Player_Str($hProcess))
_log("Armor Str: %i", True, _Player_Armor_Str($hProcess))
_log("Player Agi: %i", True, _Player_Player_Agi($hProcess))
_log("Armor Agi: %i", True, _Player_Armor_Agi($hProcess))
_log("Player Int: %i", True, _Player_Player_Int($hProcess))
_log("Armor Int: %i", True, _Player_Armor_Int($hProcess))
_log("Player Wis: %i", True, _Player_Player_Wis($hProcess))
_log("Armor Wis: %i", True, _Player_Armor_Wis($hProcess))
_log("Maximal Exp: %i", True, _Player_Exp_Max($hProcess))
_log("Current Exp: %i", True, _Player_Exp_Cur($hProcess))
_log("Gold: %i", True, _Player_Gold($hProcess))
_log("Deus Points: %i", True, _Player_Deus($hProcess), 2)
;Gegner auslesen
_log("Enemy Name: %s", True, _Gegner_Name($hProcess))
_log("Enemy Level: %i", True, _Gegner_Level($hProcess))
_log("Enemy Type: %i", True, _Gegner_Typ($hProcess))
_log("Enemy ID %i",True,_Gegner_ID($hProcess))
_log("Enemy Life Max: %i", True, _Gegner_HP_Max($hProcess))
_log("Enemy Mana Max: %i", True, _Gegner_MP_Max($hProcess))
_log("Enemy Life: %i", True, _Gegner_HP_Cur($hProcess))
_log("Enemy Mana: %i", True, _Gegner_MP_Cur($hProcess))
_log("Enemy in Focus: %i", True, _Gegner_Anvisiert($hProcess))
$aCoord = _Gegner_Coord($hProcess)
_log("Enemy X-Coord %.1f", True, $aCoord[0])
_log("Enemy Y-Coord %.1f", True, $aCoord[1])
_log("Enemy Z-Coord %.1f", True, $aCoord[2])
_log("Distantce to Enemy %.1f", True, _Gegner_Entfernung($hProcess))
_log("Enemy Target ID %i",True,_Gegner_Target_ID($hProcess),2)
;Kamera auslesen
_log("V-Rotation: %.1f", True, _Cam_V($hProcess))
_log("H-Rotation: %.1f", True, _Cam_H($hProcess), 2)
;Göttliche energie auslesen
_log("Holy Energy: %.1f", True, _Player_Erleuchtung($hProcess), 2)
Func _log($string, $format = False, $Wert = 0, $CRLF = 1)
Local $sRet
If $format = True Then $string = StringFormat($string, $Wert)
For $i = 0 To $CRLF - 1
$string = $string & @CRLF
Next
$string = StringFormat("[%02i:%02i:%02i]: %s", @HOUR, @MIN, @SEC, $string)
ConsoleWrite($string)
EndFunc ;==>_log
Func _initGegner_Entity($hProcess)
Local $Gegner_Entity = _MemoryScanEx($hProcess, $Gegner_Entity_Pattern, $Gegner_Entity_Mask)
If $Gegner_Entity > 0 Then
$Gegner_Entity = _MemoryRead($Gegner_Entity+$Gegner_Entity_Offset,$hProcess,'dword')
$Gegner_Entity = _MemoryRead($Gegner_Entity,$hProcess,'dword')
Return $Gegner_Entity
Else
Return SetError(1)
EndIf
EndFunc
Func _initPlayer($hProcess)
Local $aCoord
$Basepointer_Player = $Gegner_Entity+_find_Offset($hProcess,"Player_Offset")
$Basepointer_Player = _MemoryRead($Basepointer_Player, $hProcess, 'dword')
$Player_Level_Offset = _find_Offset($hProcess,"Player_Level_Offset")
$Speed_Offset = _find_Offset($hProcess,"Speed_Offset")
$Player_Vit_Offset = _find_Offset($hProcess,"Player_Vit_Offset")
$Armor_Vit_Offset = $Player_Vit_Offset+0x04
$Player_Str_Offset = $Player_Vit_Offset+0x08
$Armor_Str_Offset = $Player_Vit_Offset+0x0C
$Player_Agi_Offset = $Player_Vit_Offset+0x10
$Armor_Agi_Offset = $Player_Vit_Offset+0x14
$Player_Int_Offset = $Player_Vit_Offset+0x18
$Armor_Int_Offset = $Player_Vit_Offset+0x1C
$Player_Wis_Offset = $Player_Vit_Offset+0x20
$Armor_Wis_Offset = $Player_Vit_Offset+0x24
$Exp_Cur_Offset = _find_Offset($hProcess,"Exp_Cur_Offset")
;_log($Exp_Cur_Offset)
$Exp_Max_Offset = $Exp_Cur_Offset - 0x04 ;dword
$Gold_Offset = $Exp_Cur_Offset + 0x08 ;dword
$Deus_P_Offset = $Gold_Offset + 0x50 ;dword
EndFunc
Func _initGegner($hProcess)
Local $aCoord
$Basepointer_Gegner = _MemoryRead(_MemoryScanEx($hProcess, $Basepointer_Gegner_Pattern, $Basepointer_Gegner_Mask) + $Basepointer_Gegner_Offset, $hProcess, 'dword')
If $Basepointer_Gegner > 0 Then
$Basepointer_Gegner = _MemoryRead($Basepointer_Gegner, $hProcess, 'dword')
$Basepointer_Cam = $Basepointer_Gegner
$Basepointer_Gegner = _MemoryRead($Basepointer_Gegner + $Gegner_Offset[0], $hProcess, 'dword')
$Basepointer_Goettliche_Energie = $Basepointer_Gegner
$Basepointer_Player_Count = $Basepointer_Gegner
$Basepointer_Gegner = _MemoryRead($Basepointer_Gegner + $Gegner_Offset[1], $hProcess, 'dword')
$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
Func _initCam($hProcess)
$Basepointer_Cam = _MemoryRead($Basepointer_Cam + $Cam_Offset[0], $hProcess, 'dword')
$Basepointer_Cam = _MemoryRead($Basepointer_Cam + $Cam_Offset[1], $hProcess, 'dword')
EndFunc
Func _initGoetlicheEnergie($hProcess)
$Basepointer_Goettliche_Energie = _MemoryRead($Basepointer_Goettliche_Energie+$Basepointer_Goettliche_Energie_Offset,$hProcess,'dword')
EndFunc
Mit der API könnt ihr ohne probleme eure eigenen Bots schreiben.
Also viel Spaß beim tüfteln,
Runzel