|
You last visited: Today at 14:39
Advertisement
Sending Packets
Discussion on Sending Packets within the PW Hacks, Bots, Cheats, Exploits forum part of the Perfect World category.
12/05/2010, 03:40
|
#136
|
elite*gold: 0
Join Date: Mar 2008
Posts: 109
Received Thanks: 64
|
Looks fine to me. It might be better to wait until the targetID is registered before executing the skills; you can also measure the server's latency while waiting as well. Example:
Code:
public long DoSetTarget(uint targetID)
{
var stream = new MemoryStream();
stream.Write(BitConverter.GetBytes(0x2), 0, 2);
stream.Write(BitConverter.GetBytes(targetID), 0, 4);
byte[] data = stream.ToArray();
SendPackage(data);
Stopwatch timer = Stopwatch.StartNew();
while (timer.ElapsedMilliseconds < 5000)
{
// Check for TargetID to show up
if (Self.TargetId == targetID) break;
Thread.Sleep(10);
}
return timer.ElapsedMilliseconds / 2;
}
|
|
|
12/05/2010, 05:35
|
#137
|
elite*gold: 0
Join Date: Sep 2008
Posts: 35
Received Thanks: 0
|
All the functions are fine and the problem is when I do casting spell but I am too far from the mob. The character does not automatically run to mob. Is there any to let the game-client handle that for us or we have to handle that ourselves?
|
|
|
12/05/2010, 08:06
|
#138
|
elite*gold: 0
Join Date: Mar 2008
Posts: 109
Received Thanks: 64
|
Use Action structures for that; it simplifies everything.
|
|
|
12/05/2010, 09:09
|
#139
|
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
|
Just in case you don't have the action structs...
Follow:
Code:
public void follow(int playerId)
{
int actionStruct = values.actionStructPointer;
int actionList = MemFunctions.MemReadInt(pr_processHandle, actionStruct + 0x30);
int followAction = MemFunctions.MemReadInt(pr_processHandle, actionList + 0x1C);
MemFunctions.MemWriteInt(pr_processHandle, followAction + 0x8, 0); //Set error = 0
MemFunctions.MemWriteInt(pr_processHandle, followAction + 0x20, playerId); //Set playerId to follow
//MemFunctions.MemWriteInt(pr_processHandle, followAction + 0x48, 0); //Set stopped following = 0
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0xC, followAction); //Set new action at position 1
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x18, 1); //Set next action position to 1
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x14, followAction); //Set new action type follow as next action
}
Interaction struct (regular attack, pickup item, initiate dialogue with npc, use skill or harvest resource):
Code:
private void interactWith(int objectId, int interactionType, int skillPointer)
{
int actionStruct = values.actionStructPointer;
int actionList = MemFunctions.MemReadInt(pr_processHandle, actionStruct + 0x30);
int interactWithAction = MemFunctions.MemReadInt(pr_processHandle, actionList + 0x8);
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x8, 0); //action finished = 0
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x14, 1); //Action start = 1
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x24, 0); // Action not start = 0
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x20, objectId); // Set object id to interact with
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x38, interactionType); // Set the type of interaction, 0 = regAtk, 1 = pick item, 2 = talk to NPC,3 = useSkill, 4 = gatherResources
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x34, 0); // Set error = 0
MemFunctions.MemWriteInt(pr_processHandle, interactWithAction + 0x50, skillPointer); // Set skillPointer
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0xC, interactWithAction); // Set new actionType
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x18, 1); // Set next action position to 1
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x14, interactWithAction); // Set new actionType
}
Move struct:
Code:
public void moveTo(float X, float Y, float Z, float height)
{
int actionStruct = values.actionStructPointer;
int actionList = MemFunctions.MemReadInt(pr_processHandle, actionStruct + 0x30);
int moveAction = MemFunctions.MemReadInt(pr_processHandle, actionList + 0x4);
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x8, 0); //action finished = 0
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x14, 1); //Action start = 1
MemFunctions.MemWriteFloat(pr_processHandle, moveAction + 0x20, X); // Set X coord
MemFunctions.MemWriteFloat(pr_processHandle, moveAction + 0x24, Y); // Set Y coord
MemFunctions.MemWriteFloat(pr_processHandle, moveAction + 0x28, Z); // Set Z coord
MemFunctions.MemWriteFloat(pr_processHandle, moveAction + 0x68, height); // Set height
if (height >= 0.0)
{
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x64, 26625); //Set 1st var for flying up
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x6C, 256); // Set 2nd var for flying up
}
else
{
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x64, 26624); //Set 1st var for not flying up
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x6C, 65536); // Set 2nd var for not flying up
}
MemFunctions.MemWriteInt(pr_processHandle, moveAction + 0x2C, 0); // Set moveType
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0xC, moveAction); // Set new moveAction
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x18, 1); // Set next action position to 1
MemFunctions.MemWriteInt(pr_processHandle, actionStruct + 0x14, moveAction); // Set new moveAction
}
|
|
|
12/05/2010, 16:07
|
#140
|
elite*gold: 0
Join Date: Sep 2008
Posts: 35
Received Thanks: 0
|
what is the pointer to the Action struct from the base address?
For interaction struct, there is "skillPointer", how we construct this pointer?
Thank you so much for your help,, vuduy and Interest ^^
|
|
|
12/06/2010, 00:08
|
#141
|
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
|
the actionstruct pointer is an offset from player, so for pwi for example:
Code:
baseAddress = [0xA5B90C]
structureAddress = [baseAddress + 0x1C]
playerAddress = [structureAddress + 0x20]
actionStructAddress = [playerAddress + 0xFF4]
The offset finder that comes with my WQ bot should get you your actionStruct offset.
you can find skillPointer in the skillList, not sure what the offset is for that for PWI atm. BUt you basically browse through the skillList as follows:
Code:
skillListAddress = [playerAddress + skillListOffset]
for(int i = 0; i < nSkills; i++)
{
skillPointer = [skillListAddres + i * 0x4]
if([skillPointer + 0x8] == skillIdYouWantTouse)
{
break;
}
}
|
|
|
12/06/2010, 03:06
|
#142
|
elite*gold: 0
Join Date: Sep 2008
Posts: 35
Received Thanks: 0
|
Thank you so much for that. I will try them after work 
For other actions like regular attack, gather resources or pickup, I do not need the skill pointer, so just leave it as an empty pointer, right?
|
|
|
12/06/2010, 09:58
|
#143
|
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
|
Quote:
Originally Posted by SunB
Thank you so much for that. I will try them after work 
For other actions like regular attack, gather resources or pickup, I do not need the skill pointer, so just leave it as an empty pointer, right? 
|
yup, 0 will work
|
|
|
12/07/2010, 07:17
|
#144
|
elite*gold: 0
Join Date: May 2009
Posts: 26
Received Thanks: 1
|
how to find other player id ??
|
|
|
12/07/2010, 07:32
|
#145
|
elite*gold: 0
Join Date: Sep 2008
Posts: 35
Received Thanks: 0
|
There is a list of player around your character.
[base address + 0x1C + 0x8 + 0x20] (for PW vietnam). It may different from your client.
|
|
|
12/08/2010, 14:38
|
#146
|
elite*gold: 0
Join Date: Jun 2008
Posts: 142
Received Thanks: 13
|
hey interest did you ever wonder to make some base of all known packet data formats? I'd like to join but I suppose it needs some fancy thing to keep all data in convenient form and don't have any idea about it right now.
|
|
|
12/08/2010, 14:51
|
#147
|
elite*gold: 0
Join Date: Mar 2010
Posts: 862
Received Thanks: 576
|
Hmmm, yeah I suppose it would be nice to have a file with a neat syntax describing all packets, so every programmer regardless of language can use them easily. There is still the danger of different versions of PW using different packets though. I'll put some thought into it
|
|
|
12/08/2010, 14:58
|
#148
|
elite*gold: 0
Join Date: Jun 2008
Posts: 142
Received Thanks: 13
|
yep that fancy thing should also support packet versioning  a sort of wiki but with tables, probably comments :р first thought about google docs but it could be a pain..
|
|
|
12/08/2010, 16:15
|
#149
|
elite*gold: 0
Join Date: Jan 2009
Posts: 175
Received Thanks: 162
|
maybe you/we can create a SQL database with packets/description and that stuff...
and then show it in on a webpage (php) in a table... this way you/we can create a page for every pw version (int/rus/br/my ...) with own tables ^^
or something else (^_^)
|
|
|
12/08/2010, 16:18
|
#150
|
elite*gold: 0
Join Date: Sep 2008
Posts: 35
Received Thanks: 0
|
Yeah, it would be cool, a free WordPress page or as No0oB said a free hosting website and setting things up
|
|
|
 |
|
Similar Threads
|
Help with sending packets in autoit
08/16/2010 - AutoIt - 1 Replies
ive been lookin around different sites for ways to send packets to the game server. the only examples i see is to create a server and a client which i dont need, i think. well to the point now, can someone lead me in a direction or tell me how to send packets to a game? also if i send packets then that means i dont need the game to be active, correct? Because in autoit when u use keys u need to have the game active, and control send does not work. ty
|
Sending Packets !!!
09/07/2008 - Kal Online - 14 Replies
now i know how to sniff / analyse packets ... but what then ? :)
how can i send packets ?? to pimp or mix weapon for example
i just need the way to send , and then i can depend on myself :D
|
Sending Packets (need advice)
03/20/2008 - Conquer Online 2 - 7 Replies
OK well im finaly trying to stop leaching off of everybodys work its been great n all download n play :D But im tired of being a begger n the past couple months ive been learning as much as i can about macros memery add blah blah you know ...
After playing around with ce and ahk the past couple months i stumbled across wpe pro, theres not alot of tuturals and its hard to find good help.
Well heres what ive been doing so far, open my CO then i attach it to my sniffer.
I change my...
|
Scamming by sending packets???
04/15/2006 - Conquer Online 2 - 1 Replies
Well my friend and i came up with the idea to send packets to the server to show a certain item in the trade window. We want to use this as a type of scam. I didnt see this in any other threads and was wondering if anyone knew if this is possible and if they could point use in the right direction. My friend was pretty good with packets in CO 1.0 but we arent really sure to go about doing it. If anyone one could please lend a helping hand?
P.S.- Before I get flamed for this because i know i...
|
Sending packets
10/12/2005 - Conquer Online 2 - 10 Replies
I've a question. Is it possible to send 1 packet multiple times at the exact same time?
|
All times are GMT +1. The time now is 14:40.
|
|