|
You last visited: Today at 06:32
Advertisement
Perfect World Bot PWI-Prophet Bot Recoded
Discussion on Perfect World Bot PWI-Prophet Bot Recoded within the PW Hacks, Bots, Cheats, Exploits forum part of the Perfect World category.
10/19/2010, 10:46
|
#646
|
elite*gold: 0
Join Date: Jun 2008
Posts: 16
Received Thanks: 1
|
Thanks Interest07, I will try it once I got home from work
|
|
|
10/19/2010, 18:20
|
#647
|
elite*gold: 0
Join Date: Sep 2008
Posts: 35
Received Thanks: 0
|
Quote:
Originally Posted by vuduy
What kind of design are you doing? Keep it simple. Here's a simple design using memory mapped files without any synchronization. The layout of the memory map is as follow:
In the DLL, create a memory file mapping of say 64k in size with
Code:
HANDLE hMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 64000, "Name");
unsigned int *data = (unsigned int*) MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, 64000);
*data = command value
*(data+1) = base address
*(data+2) = send function address
*(data+10) = size of byte[] data
(data+11) = the start address of byte[] data
then in your loop
Code:
while (1)
{
if (*data == 99) break; // command 99 = exit thread and unload the DLL
if (*data == 1) // send function command
{
unsigned int base = *(data+1);
unsigned int send = *(data+2);
unsigned int length = *(data+10);
unsigned int *buffer = data+11;
__asm
{
pushad
push length
push buffer
mov eax, base
mov edx, [eax]
mov ecx, [edx + 0x20]
mov esi, send
call esi
popad
ret
}
*data = 0;
}
Sleep(5);
}
From the C#, you create a memory map view:
Code:
IntPtr hMap = OpenFileMapping(FILE_MAP_ALL_ACCESS, false, "Name");
IntPtr pData = MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, 64000);
Then, to setup the base address and send address do:
Code:
Marshal.WriteInt32(pData, 4, baseaddress);
Marshal.WriteInt32(pData, 8, sendaddress);
To send some opcodes, build the opcodes first (example to select target id):
Code:
uint targetid = 0x8000000;
MemoryStream stream = new MemoryStream();
stream.Write(BitConverter.GetBytes(2), 0, 2); // 02 00
stream.Write(BitConverter.GetBytes(targetid), 0, 4);
byte[] data = stream.ToArray();
Marshal.Copy(data, 0, (IntPtr)(pData.ToInt64() + 44), data.Length); // writing the buffer to (data+11) position
Marshal.WriteInt32(pData, 40, data.Length); // writing the buffer size to *(data+10)
Marshal.WriteInt32(pData, 0, 1) // writing command 1
|
As I understand, here is how to do it:
in C++ dll
Code:
#pragma managed(push,off)
void dostuff(){
HANDLE hMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 64000, TEXT("FileMapping"));
unsigned int *data = (unsigned int*) MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, 64000);
while (true)
{
if (*data == 99) break; // command 99 = exit thread and unload the DLL
if (*data == 1) // send function command
{
unsigned int base = *(data+1);
unsigned int send = *(data+2);
unsigned int lengthP = *(data+10);
unsigned int *buffer = data+11;
__asm
{
pushad;
push lengthP;
push buffer;
mov eax, base;
mov edx, [eax];
mov ecx, [edx+0x20];
mov esi, send;
call esi;
popad;
ret;
}
*data = 0;
}
Sleep(5);
}
}
#pragma managed(pop)
Then I need a thread to put these things onto the game
Code:
void FileMappingService::inject(){
// open process
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
// allocate memory for thread
LPVOID ThreadCodeAddr = VirtualAllocEx(hProcess, 0, 68096, MEM_COMMIT, PAGE_READWRITE);
// write the thread function into it
LPVOID Func = dostuff;
WriteProcessMemory(hProcess, ThreadCodeAddr, Func, 68096, 0);
//start thread
HANDLE hThread = CreateRemoteThread(hProcess, 0, 0,(LPTHREAD_START_ROUTINE)ThreadCodeAddr, 0, 0, 0);
//wait for thread to execute
WaitForSingleObject(hThread, INFINITE);
// cleanup
CloseHandle(hThread);
VirtualFreeEx(hProcess, ThreadCodeAddr, 68096, MEM_RELEASE);
CloseHandle(hProcess);
}
and in C# I try to call it to create that thread
Code:
service = new FileMappingService(pID);
service.inject();
Right after I call function inject which will try to allocate the memory and PW crashes. Do I mis-understand your idea ?
|
|
|
10/19/2010, 19:56
|
#648
|
elite*gold: 0
Join Date: Mar 2008
Posts: 109
Received Thanks: 64
|
Umm, how do you get a DLL to inject itself? A DLL is a library - not an application; a library has to be loaded; it cannot be run. If you loaded a library to the process already then what/where are you injecting?
What you want to do is to make the game loads your DLL into its running process, so that the DLL has full access to all the memory/functions, and has its working thread there. To do that, you have to inject code to the gane's process to load the DLL.
Upon loading, your DllMain will spawn a thread that setups IPC and the loop. That's it.
The actual injection is done by your C# program by calling CreateRemoteThread to execute the "LoadLibrary" with the Dll's filename onto the game's process.
|
|
|
10/20/2010, 02:17
|
#649
|
elite*gold: 0
Join Date: Sep 2005
Posts: 61
Received Thanks: 1
|
hmmm y the bot keep searching for target but it wont atk after i set the target mobs already?
|
|
|
10/20/2010, 04:07
|
#650
|
elite*gold: 0
Join Date: Jan 2009
Posts: 16
Received Thanks: 0
|
i have the same issue ? something wrong with mob address
|
|
|
10/20/2010, 07:37
|
#651
|
elite*gold: 0
Join Date: Sep 2010
Posts: 17
Received Thanks: 0
|
Awesome Bot works great...sept when i have pet attack first,.. my veno runs to where the monster is then the pet will attack but means if mon is aggro it hits me a few times before the pet...no biggy i just don't have pet attack first, is there a way to have the pet attack with its others skills like alt 2 3 ? or just the skill i have right clicked. I know you guys are busy and just some ideas....Other then that your work is awesome!!!
|
|
|
10/20/2010, 08:54
|
#652
|
elite*gold: 0
Join Date: Jun 2008
Posts: 16
Received Thanks: 1
|
Hi Interest07, thanks for your help. The auto follow is now working as expected ^_^
|
|
|
10/20/2010, 11:32
|
#653
|
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
|
Quote:
Originally Posted by serpentmind
Hi Interest07, thanks for your help. The auto follow is now working as expected ^_^
|
Happy to hear it
|
|
|
10/24/2010, 00:54
|
#654
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1
Received Thanks: 0
|
Air targetting is somewhat sketchy
|
|
|
10/26/2010, 02:54
|
#655
|
elite*gold: 0
Join Date: Mar 2009
Posts: 99
Received Thanks: 4
|
and the offsets...
Already working in others pw , like MA, etc?
or still limited to pwi?
|
|
|
10/26/2010, 10:14
|
#656
|
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
|
As far as I know this bot will ever only really support PWI, although you are free to edit the source code / offsets of course
|
|
|
10/26/2010, 19:34
|
#657
|
elite*gold: 0
Join Date: Mar 2009
Posts: 99
Received Thanks: 4
|
interest... I tried so many ways to find offsets, the maximum I got is from the pet, X Y I tried search on CE , change cordinates , what point acess etc etc...
Anyway, I dont wana a free fast easy program to get all ofsets, but you can give a tip how I can get the others offsets? xD, program,debugs areas
|
|
|
10/29/2010, 07:25
|
#658
|
elite*gold: 0
Join Date: Sep 2010
Posts: 23
Received Thanks: 2
|
some one can help me with this code, i use for my bot, for targetting using TAB, but its fail, tab not select preffered monster but all monster, can some to help me thx
Func TARGETMOB()
HPMPAUTOPOTCHECK()
HPMPAUTOPOTCHECK1()
HPPETCHECK()
AUTOBUFFSCHECK()
RESETSKILLDELAYS()
CHANGEWEAPONSCHECK()
$TARGET_MOB = PREFERREDMOB(1)
GUICtrlSetData($LABEL_GENERAL_STATUS, "Action: Finding Target")
Do
GUICtrlSetData($LABEL_GENERAL_STATUS, "Action: Trying Mob" & $TARGET_MOB)
$TARGET_STATE = _MEMORYPOINTERREAD($APP_BASE_ADDRESS, $PROCESS_INFORMATION, $OFFSET_AT)
If $TARGET_STATE[1] = 0 Then
$TID = IniRead($SOFTWARE_CONFIG, $CFG_MOBLIST_ROOT_KEY, $CFG_MOBLIST_MONSTER_KEY & $TARGET_MOB, "")
_SendMessage($HANDLE, 256, KEYCODE("{TAB}"))
Sleep(1000)
If Not @error Then
Sleep(200)
$TARGET_STATE = _MEMORYPOINTERREAD($APP_BASE_ADDRESS, $PROCESS_INFORMATION, $OFFSET_AT)
If $TARGET_STATE[1] = 0 Then
$TARGET_MOB = PREFERREDMOB($TARGET_MOB + 1)
EndIf
EndIf
EndIf
$TARGET_STATE = _MEMORYPOINTERREAD($APP_BASE_ADDRESS, $PROCESS_INFORMATION, $OFFSET_AT)
Until $TARGET_STATE[1] <> 0 Or $TARGET_MOB > IniRead($SOFTWARE_CONFIG, $CFG_MOBLIST_ROOT_KEY, $CFG_MOBLIST_UBOUND_KEY, 1)
EndFunc
Func PREFERREDMOB($MOBID)
Local $MOBRET = $MOBID
GUICtrlSetData($LABEL_GENERAL_STATUS, "Action: Trying Mob " & $MOBRET)
If $KILL_STATE <> 0 Then
$TID = IniRead($SOFTWARE_CONFIG, $CFG_MOBLIST_ROOT_KEY, $CFG_MOBLIST_MONSTER_KEY & $MOBRET, "")
If $TID = Hex($KILL_STATE) And TimerDiff($LAST_KILLEDTIME) < 10 * 1000 Then
$MOBRET = $MOBRET + 1
EndIf
EndIf
Return $MOBRET
EndFunc
|
|
|
10/30/2010, 05:21
|
#659
|
elite*gold: 0
Join Date: May 2009
Posts: 26
Received Thanks: 1
|
why sometime my char is not want attack the monsters (silent) ???
|
|
|
10/30/2010, 14:29
|
#660
|
elite*gold: 0
Join Date: Oct 2010
Posts: 44
Received Thanks: 2
|
awesome job
What can i say awesome job 
just some times script stop working and char get killed after while
and one more problem on item pickup if even u set pick 100 item always pick closest item and giveup rest idk why tho any one have any idea about this
|
|
|
All times are GMT +1. The time now is 06:33.
|
|