|
You last visited: Today at 17:11
Advertisement
Programing Proxy problem.
Discussion on Programing Proxy problem. within the Conquer Online 2 forum part of the MMORPGs category.
11/20/2007, 01:42
|
#16
|
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
|
Quote:
Originally Posted by toreddo
Dont think you can make a standalone client if you know all the packets.
There comes alot more hacking with it. Make it and your in botjail in couple of minutes.
Just preparing you.
Goodluck.
Toreddo
|
I'm not saying that I will make it but I will keep trying  Its a good practice and a new field in which I haven't programed before. Anyway thats why I'm starting with a proxy first
Quote:
Originally Posted by XtremeX-CO
You forgot character ID.
3f4 is the check. 3f2 is just basically a general packet, used for lots of things, including jumping,sitting, exp etc..
assuming u start with the first byte being 0
byte 8-11 are char id.
byte 12-15 are the action.
byte 16,17 are your location (x)
byte 18,19 are your location (y)
byte 20,21 are your direction
byte 22 is the identifier 0x51
|
I have the ID mate. Actually I have all the info in now and I understand the structure. of that packet. If you see the  you will see that the packet that I have send looks just like the packet which was send by the game client just few seconds before (except the xored time with id bites afcourse).
Thats why I'm lost, everything seems perfectly right but it won't work.
|
|
|
11/20/2007, 02:42
|
#17
|
elite*gold: 20
Join Date: Mar 2005
Posts: 1,248
Received Thanks: 2,252
|
b[8]=(byte)(id&0xff);
b[9]=(byte)((id&0xff00)>>8);
b[10]=(byte)((id&0xff0000)>>16);
b[11]=(byte)((id&0xff000000)>>24);
b[12]=(byte)(action&0xff);
b[13]=(byte)((action&0xff00)>>8);
b[14]=(byte)((action&0xff0000)>>16);
b[15]=(byte)((action&0xff000000)>>24);
b[16]=(byte)(x&0xFF);
b[17]=(byte)((x&0xFF00)>>8);
b[18]=(byte)(y&0xFF);
b[19]=(byte)((y&0xFF00)>>8);
b[20]=(byte)(dir&0xff);
b[21]=(byte)((dir&0xff00)>>8);
b[22]=(byte)(int)0x51;
hope that helps, aside from the timestamp,size,and id
those empty spots you have should be the action, and like i said, byte 16-19 are coords, and 20+21 are direction
|
|
|
11/20/2007, 05:38
|
#18
|
elite*gold: 20
Join Date: Mar 2006
Posts: 1,491
Received Thanks: 536
|
Quote:
Originally Posted by XtremeX-CO
b[8]=(byte)(id&0xff);
b[9]=(byte)((id&0xff00)>>8);
b[10]=(byte)((id&0xff0000)>>16);
b[11]=(byte)((id&0xff000000)>>24);
b[12]=(byte)(action&0xff);
b[13]=(byte)((action&0xff00)>>8);
b[14]=(byte)((action&0xff0000)>>16);
b[15]=(byte)((action&0xff000000)>>24);
b[16]=(byte)(x&0xFF);
b[17]=(byte)((x&0xFF00)>>8);
b[18]=(byte)(y&0xFF);
b[19]=(byte)((y&0xFF00)>>8);
b[20]=(byte)(dir&0xff);
b[21]=(byte)((dir&0xff00)>>8);
b[22]=(byte)(int)0x51;
hope that helps, aside from the timestamp,size,and id
those empty spots you have should be the action, and like i said, byte 16-19 are coords, and 20+21 are direction
|
That way of setting an array is messy x.x
|
|
|
11/20/2007, 12:59
|
#19
|
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
|
I don't think my problem is building the packet.
As I said before, I made a test. I have send a sit command using the Conquer2 client and I have capture the packet (I left spaces between the areas of the packet for easier reading):
Quote:
|
1800 F203 9A7A9522 269C1100 FA000000 D501F200 04005100
|
A few seconds later I have send my packet, same coordinates and everything.
Quote:
|
1800 F203 07E28422 269C1100 FA000000 D501F200 00005100
|
If you see the packets you'll see that they are identical, as they should be (except for the time stamp.) The packet that the Client have send normaly works. But the packet that I have send, which is identical, doesn't work and make Conquer crush after about 10 sec.
So, I've got every aspect of the building the sit packet and I'm 100% sure I'm doing it right. I don't need the sit packet structure or a function how to build it. I need to understand why a perfectly correct packet (I can say that because it looks just like a sit packet send from the Client at same coordinates few seconds earlier) doesn't work when I send it to the server directly throe my proxy.
I hope you understand now what my problem is
|
|
|
11/20/2007, 15:15
|
#20
|
elite*gold: 0
Join Date: Aug 2007
Posts: 49
Received Thanks: 12
|
After you inject the packet do you re-encode all following packets? Cause the encryption uses counters which will be incremented for the injected packet.
And Zero, the way you're setting the array is also messy... 
t_packet_3f2 *p = (t_packet_3f2 *)buf;
p->id = 0x3f2;
p->player_id = pid;
p->x = x;
...
Likewise for parsing the packet. And when TQ updates structures you just have to update a header.
|
|
|
11/20/2007, 16:12
|
#21
|
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
|
Quote:
Originally Posted by flowerpot!
After you inject the packet do you re-encode all following packets? Cause the encryption uses counters which will be incremented for the injected packet.
And Zero, the way you're setting the array is also messy... 
t_packet_3f2 *p = (t_packet_3f2 *)buf;
p->id = 0x3f2;
p->player_id = pid;
p->x = x;
...
Likewise for parsing the packet. And when TQ updates structures you just have to update a header.
|
Yes, after I send the packet I decrypt and re-encrypt every packet with the new encryption counters.
Maybe I'm doing some basic thing wrong... What do you mean by "inject the packet"?
I just encrypt the prepared packet with the current encryption counters and send it to the server from my proxy connection to the game server.
I'll try to explain what I do.
The connections are:
S01 (connection to Conquer client) <> my proxy program <> S02 (connection to game server)
Now, what I simply do is:
Quote:
PreparePacket = "1800F203" & TimeXOR(timeGetTime, MyID) & MyID & "FA000000" & MakeXbt(xcord) & MakeYbt(ycord) & "00005100"
PreparePacket = EncryptSend(PreparePacket)
S02.SendData PreparePacket
|
1. The "PreparePacket" is correct and matches with the packet that is send by the Conquer Client, so I assembled it correctly.
2. The Encryption functions good, I can see that from my log that I've posted in the 1st post. (packets communication between the Client and server is decrypted/encrypted correctly until I get disconnected. Also the packet that I send is encrypted correctly, I can see that because the server returns the same packet that I have send to the Game Client right after I send it.)
3. Is this the way packets should be send? Directly to the connection to the game server? Is there a way to give the packet to the Game Client so that it sends it himself?
|
|
|
11/20/2007, 17:22
|
#22
|
elite*gold: 0
Join Date: Aug 2007
Posts: 49
Received Thanks: 12
|
Quote:
Originally Posted by inSertCoiN
Yes, after I send the packet I decrypt and re-encrypt every packet with the new encryption counters.
Maybe I'm doing some basic thing wrong... What do you mean by "inject the packet"?
I just encrypt the prepared packet with the current encryption counters and send it to the server from my proxy connection to the game server.
I'll try to explain what I do.
The connections are:
S01 (connection to Conquer client) <> my proxy program <> S02 (connection to game server)
Now, what I simply do is:
1. The "PreparePacket" is correct and matches with the packet that is send by the Conquer Client, so I assembled it correctly.
2. The Encryption functions good, I can see that from my log that I've posted in the 1st post. (packets communication between the Client and server is decrypted/encrypted correctly until I get disconnected. Also the packet that I send is encrypted correctly, I can see that because the server returns the same packet that I have send to the Game Client right after I send it.)
3. Is this the way packets should be send? Directly to the connection to the game server? Is there a way to give the packet to the Game Client so that it sends it himself?
|
There are some remote command packets that you can send to client to make it do stuff, but probably not enough of them to do everything you want. The only other way to have client do the encryption and sending is by hooking the send function in the client. Not robust cause you'd have to find it each time the binary is updated.
From a proxy perspective, sending to the game server directly here is right. To help debug the problem you could try altering a packet instead of injecting a new one first. e.g. if you get a "wave" packet from client change it to "sit". Or when client sits call your function to make your sit packet and diff it to the one that the client generated.
|
|
|
11/21/2007, 17:26
|
#23
|
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
|
Quote:
Originally Posted by flowerpot!
From a proxy perspective, sending to the game server directly here is right. To help debug the problem you could try altering a packet instead of injecting a new one first. e.g. if you get a "wave" packet from client change it to "sit". Or when client sits call your function to make your sit packet and diff it to the one that the client generated.
|
Ok, I used your debugging technique. I made a progress and I'm relay grateful for that. I actually made him sit few times  , but I still get disconnected.
Here is what I got:
Quote:
("I've separated the bytes for easier reading")
The package that the game client have send:
1800F203 F63F8606 269C1100 FA000000 D701 F300 0200 5100
The package that I would have send at the exact same time:
1800F203 E9DC9706 269C1100 FA000000 D701 F300 0200 5100
|
By analyzing this you can see that the only thing that does not match exactly is the time stamp.
I assume thats because I'm using my SystemTime to create the time stamp and the client/server are using the server time to create it??? How do you create the time stamp??
|
|
|
11/21/2007, 20:48
|
#24
|
elite*gold: 20
Join Date: Mar 2005
Posts: 1,248
Received Thanks: 2,252
|
onTimer(byte b[]) {
if(b[12]==0x1b) ttime=(new Date()).getTime();
}
First you get the timestamp from the timer packet (0x3f1)
Then simply
int timer=(int)((new Date()).getTime()-ttime);
Just convert that to vb, and it should work
|
|
|
11/22/2007, 03:38
|
#25
|
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
|
Quote:
Originally Posted by XtremeX-CO
onTimer(byte b[]) {
if(b[12]==0x1b) ttime=(new Date()).getTime();
}
First you get the timestamp from the timer packet (0x3f1)
Then simply
int timer=(int)((new Date()).getTime()-ttime);
Just convert that to vb, and it should work
|
Correct me if I'm wrong but in words it should be something like this:
1.when receiving a time packet, you get the timestamp and write down current system time.
2. When you wanna send packet, to create the timestamp, you just add the (current system time - the system time when you got the time packet) to the (+) timestamp from the time packet.
|
|
|
11/22/2007, 06:57
|
#26
|
elite*gold: 20
Join Date: Mar 2005
Posts: 1,248
Received Thanks: 2,252
|
Quote:
Originally Posted by inSertCoiN
Correct me if I'm wrong but in words it should be something like this:
1.when receiving a time packet, you get the timestamp and write down current system time.
2. When you wanna send packet, to create the timestamp, you just add the (current system time - the system time when you got the time packet) to the (+) timestamp from the time packet.
|
Yeah basically, you get the timestamp from the timer packet (0x3f1). Then, create a NEW timestamp, based on th current time, and substract the value you got from the timer packet,so you get the DIFFERENCE in the timestamp. Sorry if i confuse you, let me try and reword it.
Basically
0x3f1 Gives you timestamp - OLDTIME
You create a new timestamp - TIME
Then when you want to send a packet, you do TIMESTAMP=TIME-OLDTIME, so you get the difference between those 2 packets, which will be used in the packet.
once again, sorry Im awful at explaining things
|
|
|
11/22/2007, 08:11
|
#27
|
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
|
Ty mate I finally made it !!!  Thanks to all who helped me.
OK 1 more final thing and I think I can go on from there...
When I send the "sit" packet, you can see the character siting from other clients, but not from the one on which I forced the packet. How to make my client (the original on which proxy works) get the current character state, so I can see that hes actually seating?
|
|
|
11/22/2007, 09:27
|
#28
|
elite*gold: 20
Join Date: Mar 2005
Posts: 1,248
Received Thanks: 2,252
|
Hmm, honestly, I never tried lol... didnt need to... but pretty simple... capture the client on another client, then build that packet and send it to client, instead of server... Too lazy to open my iDE, but the packets should be the same, weather you send them to client or server... but theres the other thing, where, just like jump, if you senda packet to client, with your OWN char id, it doesnt do the jump (therefore the need for a refresh packet)
|
|
|
11/22/2007, 14:07
|
#29
|
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
|
Quote:
Originally Posted by XtremeX-CO
Hmm, honestly, I never tried lol... didnt need to... but pretty simple... capture the client on another client, then build that packet and send it to client, instead of server... Too lazy to open my iDE, but the packets should be the same, weather you send them to client or server... but theres the other thing, where, just like jump, if you senda packet to client, with your OWN char id, it doesnt do the jump (therefore the need for a refresh packet)
|
Well basically the server does that on hes own. If I send him sit packet, he sends the same sit packet back to the client. The problem is nothing happens then. I mean I actually did sit but I can't see that on my client.
|
|
|
11/22/2007, 15:34
|
#30
|
elite*gold: 0
Join Date: Oct 2006
Posts: 595
Received Thanks: 443
|
Quote:
Originally Posted by inSertCoiN
Well basically the server does that on hes own. If I send him sit packet, he sends the same sit packet back to the client. The problem is nothing happens then. I mean I actually did sit but I can't see that on my client.
|
Cant you send a packet from the Proxy to the CO client Manuelly?  Not that I could see why you would want to see yourself autosit,,, except for pleasure sake, Even Net and Caff didnt finish that ^^ Nice to see your getting there though
|
|
|
 |
|
Similar Threads
|
[HELP]how to start programing ?
06/28/2009 - CO2 Programming - 30 Replies
i just finished my final exams today
if i want to start learning programing ..
what u should i start with ,, i mean what language to start
where is the best to learn it ., if any one wants to help just say it
|
new to programing
12/20/2008 - Cabal Hacks, Bots, Cheats, Exploits & Macros - 0 Replies
first of all, i want to thank you all for the help you got me from other threads.
now i would like to ask something... no i don't want bots or hacks made from anyone... i just want a little advice in something.
to know about programing a bypass for gameguard or to make a bot which programs, coder or programing books i should look to??
i mean, should i look for auto it to make a bot?
should i try c++ programing?
if theres someone who could help me with knowing more about programing...
|
Help for Programing a bot
04/01/2008 - Conquer Online 2 - 0 Replies
Well, i want to make a bot for CO, but i need some help. I don't know if it's better to take the packets that send conquer server, and manipulate it; or find the memory address and change the values when i need it.
Well, in addition, i have a question. Always the system assigned the same memory address for the game? For example, if i use the "odbg", and i find that the memory address for the player name is "x", always "x" have the player name?
Well, i need some help. I don't need that...
|
Request for programing help
05/30/2006 - Conquer Online 2 - 2 Replies
Well ass all of we know the auto lvl doent work i use to lvl whit COPartner but now its freez.
Ill try to crack it but i need some help hehe if anyone can give me and idea of how to do it
or any source ty hope elitepvpers ll join togetter to do this crack lol
by the way im not good programer so i need so much help
|
Request for programing help
05/30/2006 - Conquer Online 2 - 1 Replies
Well ass all of we know the auto lvl doent work i use to lvl whit COPartner but now its freez.
Ill try to crack it but i need some help hehe if anyone can give me and idea of how to do it
or any source ty hope elitepvpers ll join togetter to do this crack lol
by the way im not good programer so i need so much help
|
All times are GMT +1. The time now is 17:11.
|
|