Need Help With Perfect World Address

07/25/2008 18:42 someone009#1
dear all,

can anyone help to teach me how to search base address and target address in perfect world..

Thank you
07/26/2008 18:07 Vulcanraven#2
You can try it with the Cheat Engine Tutorial ;)
02/27/2009 18:37 yenleidong#3
:rtfm:try to type "pointer" in searchbox:handsdown:
02/28/2009 14:05 schurke90#4
before you try to search an static pointer base in a game, try it with something easier.

i've added a file for you, try those, solutions are given and a little basic example how to use the adresses ( without virtualqueries ).
03/03/2009 18:24 oggs#5
source code from my bot for PW-International
...dunno if it's still working =) ...some of the pointer adresses never worked -.-
alot of fun with it ;)

[c++]
#include <stdio.h>
#include <string>
#include <windows.h>
#include <stdio.h>
#include <iostream>
#include <conio.h>
#include <ctime>
#include <cstdlib>

#define GetRValue(rgb) ((BYTE)(rgb))
#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
#define GetBValue(rgb) ((BYTE)((rgb)>>16))

//system
void writeMem(DWORD addr,int x,int byte);
int readMem(DWORD addr,int byte);
inline void VirtualKeyPress(BYTE byVirtualKeyCode,HWND wnd);
void setup(HWND *hwnd, HANDLE *handle, HDC *hdc);
inline void Mausklick(int x, int y);


//play
void printPlayerStatus();
void autopot(int percent, BYTE keyHP, BYTE keyMP);
void searchMob();
void pick(BYTE key,int cnt,int delay);
void fight();
void login();



HWND hwnd;
HANDLE handle;
HDC hdc;


DWORD staticAddr = 0x0092EAAC;
DWORD tobase;
DWORD base;


////////////////////////////
DWORD HP = 0x450;
DWORD MP = 0x454;
DWORD HPmax = 0x480;
DWORD MPmax = 0x484;
DWORD vigor = 0x464;
DWORD speed = 0x494;
DWORD charx = 0x60c;
DWORD chary = 0x608;
DWORD lvl = 0x448;
DWORD exp = 0x458;
DWORD jump = 0xB14;
DWORD money = 0xB14;

DWORD petHP = 0x1878839;
DWORD petHPmax;
DWORD petHunger;


DWORD mobPointer = 0xA24;
DWORD mobPointerMouse = 0xA3C;
DWORD mobHP = 0x2A7FC28;
DWORD underAtk = 0xC4EFF4;

int monster;

int HPPotCounter=0;
int MPPotCounter=0;

int prevMoney=0;
int prevXP=0;



void main()
{
printf("****************************************** **********\n");
printf("*******************PerfectAuto v2*******************\n");
printf(">do setup\n");
setup(&hwnd,&handle,&hdc);
//here baseadresse is read
tobase = readMem(staticAddr,4)+0x20; //0x20 nötiges offset !!
base = readMem(tobase,4);
printf("base: %x\n",base);

monster = readMem(base+mobPointer,4);

int status=0;

int mobcountdown=40; //tickt runter solange der selbe mob markiert ist


prevMoney = readMem(base+money,4);
prevXP = readMem(base+exp,4);


//login();
while(1)
{
printPlayerStatus();

if(readMem(base+mobPointer,4) == 0)
{
if(rand()%3==0)
{
VirtualKeyPress(VK_F3,hwnd);
Sleep(500);
VirtualKeyPress(VK_F3,hwnd);
}

pick((WPARAM)(LPCTSTR)VkKeyScan('4'),2,500);
searchMob();
mobcountdown=40;
}
else
{
fight();
mobcountdown--;
printf("countdown: %d\n",mobcountdown);
if(mobcountdown < 0)
{
writeMem(base+mobPointer,0,4);
}
}

autopot(60,VK_F1,VK_F2);



if(rand()%15 == 0)
{
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('5'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('6'),hw nd);
}

system("cls");
}
}

void login()
{
if(readMem(base+HP,4) == 0)
{
//VirtualKeyPress(VK_RETURN,hwnd);
//Sleep(60000);

VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('o'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('g'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('g'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('s'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('9'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('1'),hw nd);

VirtualKeyPress(VK_TAB,hwnd);

VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('o'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('g'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('g'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('s'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('D'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('o'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('m'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('o'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('2'),hw nd);

Mausklick(397,363);

VirtualKeyPress(VK_RETURN,hwnd);
}
}

void fight()
{
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('1'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('2'),hw nd);
VirtualKeyPress((WPARAM)(LPCTSTR)VkKeyScan('3'),hw nd);
}

void pick(BYTE key,int cnt,int delay)
{

for(int i=0;i<cnt;i++)
{
Sleep(delay);
VirtualKeyPress(key,hwnd);
printf("pick...\n");
}
Sleep(delay);
}

void searchMob()
{
int cnt=0;
while(1)
{
writeMem(base+mobPointer,monster+cnt,4);


Sleep(50);

if(readMem(base+mobPointer,4) != 0)
{
printf("counter:\t%d\n",cnt);
monster += cnt;
break;
}

writeMem(base+mobPointer,monster-cnt,4);

Sleep(50);

if(readMem(base+mobPointer,4) != 0)
{
printf("counter:\t%d\n",cnt);
monster -= cnt;
break;
}

cnt++;
}
}

void autopot(int percent, BYTE keyHP, BYTE keyMP)
{
//HP
if(readMem(base+HP,4) < readMem(base+HPmax,4)*percent/100)
{
VirtualKeyPress(keyHP, hwnd);
HPPotCounter++;
}

//MP
if(readMem(base+MP,4) < readMem(base+MPmax,4)*percent/100)
{
VirtualKeyPress(keyMP, hwnd);
MPPotCounter++;
}
}

void printPlayerStatus()
{
printf("****************************************** **********\n");
printf("*******************Player Status********************\n");
printf("base:\t%x\n",base);
printf("****************************************** **********\n");
printf("HP:\t%d/%d\n",readMem(base+HP,4),readMem(base+HPmax,4));
printf("MP:\t%d/%d\n",readMem(base+MP,4),readMem(base+MPmax,4));
printf("HPpot:\t%d\n",HPPotCounter);
printf("MPpot:\t%d\n",MPPotCounter);
printf("moneygot:\t%d\n",readMem(base+money,4)-prevMoney);
printf("expgot:\t%d\n",readMem(base+exp,4)-prevXP);
printf("vigor:\t%d\n",readMem(base+vigor,4));
printf("speed:\t%d\n",readMem(base+speed,4));
printf("charx:\t%d\n",readMem(base+charx,4));
printf("chary:\t%d\n",readMem(base+chary,4));
printf("lvl:\t%d\n",readMem(base+lvl,4));
printf("exp:\t%d\n",readMem(base+exp,4));
printf("pethp:\t%d\n",readMem(base+petHP,4));
printf("mob:\t%x\n",readMem(base+mobPointer,4));
printf("underAtk:\t%x\n",readMem(base+underAtk,4)) ;
printf("mobHP:\t%d\n",readMem(base-mobHP,4));
printf("mob mouse:\t%x\n",readMem(base+mobPointerMouse,4));
printf("****************************************** **********\n");
}

void setup(HWND *hwnd, HANDLE *handle, HDC *hdc)
{
*hwnd = NULL;

*hwnd = FindWindow(NULL, "Element Client");

if(hwnd==0)
{
printf("hwnd error");
}


DWORD process_id = 0L;
GetWindowThreadProcessId (*hwnd, &process_id);

printf (("INFO : Prozess-ID: %d\n"), process_id);


*handle = OpenProcess (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF, false, process_id);
if (handle == NULL)
{
printf (("ERROR: Zugriff auf Prozess nicht möglich.\n"));
}

*hdc = GetDC(FindWindow("Element Client", NULL));

if(hdc==0)
{
printf("hdc error");
}

// COLORREF pixel=GetPixel(*hdc,400,271);
// printf("%d %d %d",GetRValue(pixel),GetGValue(pixel),GetBValue(pi xel));
}

void writeMem(DWORD addr,int x,int byte)
{

std::pair<::DWORD, int> data[] =
{
std::make_pair (addr, x), // Timer
};

int data_size = sizeof (data) / sizeof (data[0]);

for (int i = 0; i < data_size; ++i)
{
// Neuen Wert zuweisen.
if (!::WriteProcessMemory (handle,
reinterpret_cast<void*>(data[i].first),
reinterpret_cast<void*>(&data[i].second),
4,
NULL))
printf (("ERROR: Schreiben in '0x%x' nicht moeglich.\n"), data[i].first);
}
}

int readMem(DWORD addr,int byte)
{
int var=0;
ReadProcessMemory(handle,(LPCVOID)addr, &var, byte,NULL);

return var;
}


inline void VirtualKeyPress(BYTE byVirtualKeyCode,HWND wnd)
{
// keybd_event(byVirtualKeyCode, 0, 0, 0L);
// keybd_event(byVirtualKeyCode, 0, 2, 0L);
// keybd_event(byVirtualKeyCode, 0, 1, 0L);

PostMessage(wnd, WM_KEYDOWN, byVirtualKeyCode, 1);


Sleep(500);
}

inline void VirtualKeyPressHold(BYTE byVirtualKeyCode)
{
keybd_event(byVirtualKeyCode, 0, 0, 0L);

// keybd_event(byVirtualKeyCode, 0, 1, 0L);
Sleep(500);
}


inline void VirtualKeyPressRelease(BYTE byVirtualKeyCode)
{

keybd_event(byVirtualKeyCode, 0, 2, 0L);
// keybd_event(byVirtualKeyCode, 0, 1, 0L);
Sleep(500);
}

inline void Mausklick(int x, int y)
{
SetCursorPos(x,y);
// PostMessage(hwnd, WM_LBUTTONDOWN, 0, 1);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
}
[/c++]