Сначала берем Pointer по адресу BaseAddress. Потом к адресу на который он указывает прибавляем 32 и снова считываем указатель. К результирующему указателю нужно добавить N байт и считать Single для получения координаты. 代码: if (Base=134) then B:=$00925484; //1.3.4 if (Base=140) then B:=$0095baa4; //1.4.0 if (Base=141) then B:=$009771bc; //1.4.1 代码: readprocessmemory(hProcess,ptr(adr+$5FC),__GETCOORDS_CX,4,temp); readprocessmemory(hProcess,ptr(adr+$600),__GETCOORDS_CY,4,temp); readprocessmemory(hProcess,ptr(adr+$604),__GETCOORDS_CZ,4,temp);
Я сейчас его кстати и делаю И не только NPCGen. Вот моя крайне оптимизированая процедура тягания координат: 代码: var __GETCOORDS_CX: PSingle = nil; __GETCOORDS_CY: PSingle = nil; __GETCOORDS_CZ: PSingle = nil; __GETCOORDS_BUF: PDWord = nil; __GETCOORDS_PROC: DWord = 0; __GETCOORDS_BASE: DWord = 0; __GETCOORDS_ADR: DWord = 0; function GetCoords(Base: DWord; out X: Single; out Y: Single; out Z: Single): Word; var B: DWord; hProcess, HandleWindow: THandle; ProcessID, temp: Cardinal; adr: DWord; begin B:=Base; if (Base=0) then B:=$00925484; //Assuming 1.3.4 if (Base=134) then B:=$00925484; //1.3.4 if (Base=140) then B:=$0095baa4; //1.4.0 if (Base=141) then B:=$009771bc; //1.4.1 Result:=65535; X:=0; Y:=0; Z:=0; HandleWindow :=FindWindow(nil,'Element Client'); if (HandleWindow=0) then Exit; GetWindowThreadProcessId(HandleWindow,@ProcessID); if (ProcessId=0) then Exit; Result:=0; adr:=0; if ((__GETCOORDS_PROC<>ProcessID) or (__GETCOORDS_BASE<>B)) or (__GETCOORDS_ADR=0) then begin hProcess := OpenProcess(PROCESS_ALL_ACCESS,FALSE,ProcessID); if (__GETCOORDS_BUF=nil) then getmem(__GETCOORDS_BUF,4); if (__GETCOORDS_CX=nil) then getmem(__GETCOORDS_CX,4); if (__GETCOORDS_CY=nil) then getmem(__GETCOORDS_CY,4); if (__GETCOORDS_CZ=nil) then getmem(__GETCOORDS_CZ,4); if (hProcess>0) then begin __GETCOORDS_BASE:=B; __GETCOORDS_PROC:=ProcessID; adr:=B; readprocessmemory(hProcess,ptr(adr),__GETCOORDS_BUF,4,temp); if (temp<4) then Result:=Result+temp*10000; adr:=__GETCOORDS_BUF^; readprocessmemory(hProcess,ptr(adr+$20),__GETCOORDS_BUF,4,temp); if (temp<4) then Result:=Result+temp*1000; adr:=__GETCOORDS_BUF^; __GETCOORDS_ADR:=adr; end; end else begin hProcess := OpenProcess(PROCESS_ALL_ACCESS,FALSE,__GETCOORDS_PROC); adr:=__GETCOORDS_ADR; end; if (hProcess>0) then begin readprocessmemory(hProcess,ptr(adr+$5FC),__GETCOORDS_CX,4,temp); if (temp<4) then Result:=Result+temp*100; readprocessmemory(hProcess,ptr(adr+$600),__GETCOORDS_CY,4,temp); if (temp<4) then Result:=Result+temp*10; readprocessmemory(hProcess,ptr(adr+$604),__GETCOORDS_CZ,4,temp); if (temp<4) then Result:=Result+temp*1; X:=__GETCOORDS_CX^; Y:=__GETCOORDS_CY^; Z:=__GETCOORDS_CZ^; end else begin X:=0; Y:=0; Z:=0; end; if hProcess <> 0 then CloseHandle(hProcess); end; Правда хендли не оптимизировал. Да и ладно.