- Du solltest prüfen ob die Handles auch alle korrekt sind
- Die Positionen sind Float Werte (Single in Delphi).
Führst du deine Anwendung außerhalb der Delphi IDE aus wirst du bei WoW SeDebugPrivilege() einsetzen müssen. Google nach einer fertigen Funktion und führe sie einmalig z.B. beim FormCreate aus. Ansonsten wirst du schon bei OpenProcess() scheitern.
Um Werte zurückzugeben musst du außerdem result := ... verwenden.
Code:
function GetCoords(adresse, size: integer): Single;
var
h: hwnd;
hProc: THandle;
fTemp: Single;
dwRead, dwpId, dwTemp: Cardinal;
const
dwBase = $00CD87A8;
dwBaseOffset1 = $34;
dwBaseOffset2 = $24;
begin
result := 0.0;
h := FindWindow(nil, 'World of Warcraft');
if (h <> 0) then
begin
GetWindowThreadProcessId(h, @dwpId);
hProc := OpenProcess(PROCESS_ALL_ACCESS, false, dwpId);
if (hProc <> 0) then
begin
ReadProcessMemory(hProc, ptr(dwBase), @dwTemp, size, dwRead);
ReadProcessMemory(hProc, ptr(dwTemp + dwBaseOffset1), @dwTemp, size, dwRead);
ReadProcessMemory(hProc, ptr(dwTemp + dwBaseOffset2), @dwTemp, size, dwRead);
ReadProcessMemory(hProc, ptr(dwTemp + adresse), @fTemp, size, dwRead);
CloseHandle(hProc);
result := fTemp;
end;
end;
end;
Das X Offset für Units ist 0x798, ein Aufruf deiner Funktion könnte also so aussehen:
hab in der zwischenzeit so einiges geändert und es läuft soweit ziemlich gut.
auf SetDebugPrivilege() konnte ich verzichten, läuft auch so alles gut
nur hab ich nen problem beim auslesen der playernamen, einheiten also gegner klappen schon.
ersteinmal kann ich die aktuelle adresse (3.3.5) für den player name ptr nicht finden, hab hier schon alle threads durchgewälzt
[EDIT] hab ihn: 0xC5D938 das andere problem besteht allerdings noch [/EDIT]
ich versuche, die bestehende c++ function "PlayerNameFromGuid" in delphi umzustricken:
Code:
public string PlayerNameFromGuid(ulong guid)
{
const ulong nameStorePtr = 0x1137CE0 + 0x8; // Player name database
const ulong nameMaskOffset = 0x024; // Offset for the mask used with GUID to select a linked list
const ulong nameBaseOffset = 0x01c; // Offset for the start of the name linked list
const ulong nameStringOffset = 0x020; // Offset to the C string in a name structure
ulong mask, base_, offset, current, shortGUID, testGUID;
mask = WowReader.ReadUInt32((IntPtr)(nameStorePtr + nameMaskOffset));
base_ = WowReader.ReadUInt32((IntPtr)(nameStorePtr + nameBaseOffset));
shortGUID = guid & 0xffffffff; // Only half the guid is used to check for a hit
offset = 12 * (mask & shortGUID);
current = WowReader.ReadUInt32((IntPtr)(base_ + offset + 8));
offset = WowReader.ReadUInt32((IntPtr)(base_ + offset));
//current == 0 || (current & 0x1)
if ((current & 0x1) == 0x1) { return ""; }
testGUID = WowReader.ReadUInt32((IntPtr)(current));
while (testGUID != shortGUID)
{
current = WowReader.ReadUInt32((IntPtr)(current + offset + 4));
if ((current & 0x1) == 0x1) { return ""; }
testGUID = WowReader.ReadUInt32((IntPtr)(current));
}
// Found the guid in the name list...
//ReadBytesIntoBuffer(current + nameStringOffset, numBytes, name);
return WowReader.ReadString((IntPtr)(current + nameStringOffset));
}
dabei bereitet mir:
Code:
shortGUID = guid & 0xffffffff; // Only half the guid is used to check
kopfzerbrechen.
ich verstehe nicht, was dort mit meiner guid (bsp. 12345) passiert
wird diese halbiert oder ein teil abgeschnitten?
mein code sieht momentan so aus:
Code:
function PlayerFromGUID(GUID:UInt64): String;
var
mask, base, shortGUID, testGUID, offset, current: Integer;
begin
mask := MemRInteger(nameStorePtr + nameMaskOffset);
base := MemRInteger(nameStorePtr + nameBaseOffset);
shortGUID := GUID + $ffffffff;
if mask = $FFFFFFFF
then Result := '';
offset := 12 * (mask + shortGUID);
current := MemRInteger(base + offset + $8);
offset := MemRInteger(base + offset);
if (current = 0) or ((current + $1) = $1)
then Result := '';
testGUID := MemRInteger(current);
while testGUID <> current do begin
current := MemRInteger(current + offset + $4);
if (current = 0) or ((current + $1) = $1)
then Result := '';
testGUID := MemRInteger(current);
end;
Result := MemRString(current + nameStringOffset);
end;
wobei du dwtemp als PChar dekladieren musst.
Zum speichern aus ReadProcessMemory muss ein speicherbereich(GetMem) angefordert werden, und dieser geht nur mit Pointer und PChar.
& ist der bitwise and Operator, es werden also die einzelnen Bits der GUID mit den Bits von 0xffffffff mit einem logischen Und verknüpft.
0xffffffff sind 32 Bit die auf 1 gesetzt sind, also bleiben die ersten 32 Bit der GUID erhalten und die restlichen 32 Bit werden auf 0 gesetzt.
Übrigens, dieser Code wahrscheinlich kein C++, ich vermute stark das es sich um CSharp handelt.
function PlayerFromGUID(GUID:UInt64): String;
var
nameMask, nameBase, testGUID, offset, current: Integer;
shortGUID: UInt64;
begin
nameMask := MemRInteger(nameStorePtr + nameMaskOffset);
nameBase := MemRInteger(nameStorePtr + nameBaseOffset);
shortGUID := GUID and $FFFFFFFF; // Only half the guid is used to check for a hit
if nameMask = $FFFFFFFF then
begin
Result := 'Fehler1';
Exit;
end;
offset := 12 * (nameMask and shortGUID); // select the appropriate linked list
current := MemRInteger(nameBase + offset + 8);
offset := MemRInteger(nameBase + offset);
if (current = (current and $1)) or (current = 0) then
begin
Result := 'Fehler2';
Exit;
end;
testGUID := MemRInteger(current);
while testGUID <> current do begin
current := MemRInteger(current + offset + 4);
if (current = (current and $1)) or (current = 0) then
begin
Result := 'Fehler3';
Exit;
end;
testGUID := MemRInteger(current);
end;
Result := MemRString(current + nameStringOffset);
end;
Nein muss es nicht, allerdings kann ich auch nicht Prüfen in wie weit der Code den du gepostet hast korrekt ist, geschweigeden ob die Offsets noch alle stimmen.
Ein Mögliches Problem ist das in WoW Strings in Unicode vorliegen, wenn du versuchst einen String aus WoW als ANSI String zu interpretieren kommt dann Kauderwelsch heraus.
Edit:
Speicher Adressen in WoW sind 32bit lang, da WoW soweit mir bekannt ist nur als 32bit executable vorliegt, darum macht es wenig sind offset und die anderen Adressvariablen als UInt64 zu definieren, allerdings tut der Code den du hier gepasted hast genau das, ein ulong ist in C# nämlich 8byte lang und ein Bezeichner für System.UInt64 .
[CE] All Offsets for 2.4.3: MC, Flymode,Speed,coords,Tracking.. 09/22/2013 - WoW PServer Exploits, Hacks & Tools - 13 Replies here are the XYZ coordinates for 2.4.3 and all known speed values
To use these simply open up CE, click the add address manually button, select pointer and use the base address (which i posted at the top) as the address and these number/letter combo's (such as C6C for walk speed) to get the actual value.
00E29D28 is the base address
008C8398 MC angle default value 0.6427 (float)
Most movement related offsets *grey ones have a decent use*
C00 points to vertical orientation, no...
player offsets US 04/01/2010 - Last Chaos - 0 Replies this is old offstes :
AttackSpeed=107710
MovingSpeed=107708
Range=10770C
CastingSkill=10779C
LifeSearcher=1072E9
SP=1076F8
US player offsets 03/10/2010 - Last Chaos - 0 Replies some help how to find new player offsets for US server ???
anyone know please post
ty
[AutoIt3] Mob-Player-NPC list names and coords (direct translation from high6's c# 1) 05/17/2009 - CO2 Programming - 19 Replies Hey pplz,
I saw a thread form someone askin' how to get the player names & coordinates.
high6 has already shown us how to do this
http://www.elitepvpers.com/forum/co2-programming/2 46709-c-accessing-player-mob-list.html
I've tested it out in AutoIt and it works fine.