Taking coordinates & Target Npc in delphi

06/12/2012 13:29 marcelo380#1
I would like to get the coordinates but I'm doing something wrong:
My Code:

Code:
var
H, TI, PI, W, rw, GameHandle: DWORD;
eax, written, Base: cardinal;
CoordinatesX, CoordinatesZ, CoordinatesY: DWORD;
ProcessId: Integer;
begin
H := FindWindow(nil, 'Element Client');
GetWindowThreadProcessId(H, @ProcessId);
GameHandle := OpenProcess(PROCESS_VM_READ, False, ProcessId);
if (H <= 0) then
exit;
try
ReadProcessMemory(GameHandle, ptr($00B3B24C), @eax, 4, written); //BASE
ReadProcessMemory(GameHandle, ptr(eax + $1C), @eax, 4, written);
ReadProcessMemory(GameHandle, ptr(eax + $34), @Base, 4, written);
// ################################   Coordinates Pointer   ############################
ReadProcessMemory(GameHandle, ptr(Base + $003C), @CoordinatesX, 4, written); //pointer X
ReadProcessMemory(GameHandle, ptr(Base + $0044), @CoordinatesY, 4, written); //pointer Y
//######################################################################################
label7.Caption := 'Coordinates: '+IntToStr(CoordinatesX)+'/'+IntToStr(CoordinatesY);


finally
end;
How can I get the name of the target?
My Code:

Code:
var
  H, TI, PI, W, rw: DWORD;
  Pointer, PointerName: DWORD;
 Name: Array [0 .. 100] of Char;
  
begin
  
  H := FindWindow(nil, 'Element Client');
  if (H <= 0) then
    exit;
  try
    TI := GetWindowThreadProcessId(H, @PI);
    W := OpenProcess(PROCESS_ALL_ACCESS, False, PI);
    ReadProcessMemory(W, ptr($00B3B24C), @Pointer, 4, rw);
    ReadProcessMemory(W, ptr(Pointer + $0034), @Pointer, 4, rw);
    ReadProcessMemory(W, ptr(Pointer + $0260), @PointerName, 4, rw);
    ReadProcessMemory(W, ptr(PointerName), @Name, SizeOf(Name), rw);
   
          LABEL1.Caption:='Target: '+ name;

          finally
    end;



thanks
06/12/2012 14:01 Sᴡoosh#2
I think before you do anything more you should learn some basics about datatypes. And why didn't you ask all your questions in one topic - not spam forum full of 2 liners.

You need Single.

I'll leave it to others to spoon feed ya - I don't need another bot on these forums ;)
06/12/2012 15:04 marcelo380#3
I just want to learn, to be able to help. I do not want to create a bot paid as yours! For all that I can put the code in order to help others!


Pesso apologize for creating two topics.:D