Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 21:12

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Question about sending packets with usigned variables

Discussion on Question about sending packets with usigned variables within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
tkblackbelt's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 266
Received Thanks: 85
Question about sending packets with usigned variables

Ok so I started making a proxy in java and Have got up to receiving the password seed. But I've run into a problem java doesn't have unsigned variables so I had to edit the auth cryption to use short values. I can get the password seed perfectly its just forwarding it to the client I'm not sure how to do because the socket doesn't send a short array. I try sending the origional byte array but got no response from the client. If anyone can give me some pointers on how to do this I would appreciate it thanks.

when the byte is over 128 it wraps around to negative numbers

the byte array look like -59 72 105 18 32 -47 47 -103
the short array looks like 197 72 105 18 41 163 18 61
tkblackbelt is offline  
Old 12/28/2010, 09:14   #2
 
elite*gold: 0
Join Date: Feb 2006
Posts: 550
Received Thanks: 81
thats why you go byte & 0xff

take a look through here:
ChingChong23 is offline  
Thanks
1 User
Old 12/28/2010, 09:50   #3
 
tkblackbelt's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 266
Received Thanks: 85
Quote:
Originally Posted by ChingChong23 View Post
thats why you go byte & 0xff

take a look through here:
Thanks I will definetly take a look through that source. I'n my auth cryption file I changed everything to use short variables as shown below

public void DecryptBackwards(short[] buffer)
{
for (int i = 0; i < buffer.length; i++)
{

buffer[i] ^= (short)(_cryptKey2[_decryptCounter.getKey2()] ^ _cryptKey1[_decryptCounter.getKey1()]) & 0xff;
buffer[i] = (short) ((short)(buffer[i] >> 4 | buffer[i] << 4) & 0xff);
buffer[i] ^= (short)0xAB;
_decryptCounter.Increment();
}
}

And this is what I used to convert bytearray to short array
public static short[] byteArrayToShortArray(byte[] buffer){

short[] array = new short[buffer.length];
for(short i = 0; i < buffer.length;i++){
array[i] = (short) (buffer[i] & 0xff);
}
return array;
}

This works perfectly to get the value of the auth packet, but I'm woundering how to forward the short array to the client, if I send the signed byte array with the negative values and such will the client still be able to use the bytes or do they have to be in the unsigned form?
tkblackbelt is offline  
Old 12/28/2010, 14:58   #4
 
elite*gold: 20
Join Date: Aug 2007
Posts: 1,749
Received Thanks: 2,198
It shouldn't really matter in hexadecimal, unless of course you're using these values for something. And really, Java doesn't have unsigned variables? That sucks
IAmHawtness is offline  
Old 12/28/2010, 18:19   #5
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Another reason why Java is a horrible language :P


You can take a look at this:

.Kinshi is offline  
Old 12/28/2010, 21:33   #6
 
elite*gold: 20
Join Date: Aug 2007
Posts: 1,749
Received Thanks: 2,198
Quote:
Originally Posted by .Kinshi View Post
Edit: Sorry for double post, stupid internet >.<
Edit -> press "Delete" -> tick "Delete Message" -> press "Delete this Message"
IAmHawtness is offline  
Old 12/28/2010, 23:05   #7
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
You dont really need to change the type from byte to short (though i have made the same mistake before). Seeing a different decimal or hexadecimal value does not matter much. What it REALLY matters is that what represents the data in bits.
Java does not have unsigned. therefore the largest positive number you can go is 127, while in other languages that supports signed byte, the largest you see is 255.

127 (java) in bits is 1111 1111 (leading bit is interpreted as sign bit)
255(c++) in bits is also 1111 1111

Since encryption and decryption takes place on a bit level, all you need to care about is that, the bits are the same. You can care less about how your programming language interprets these bits.

good luck
shitboi is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Sending Packets
03/26/2019 - PW Hacks, Bots, Cheats, Exploits - 432 Replies
As per Smurfin's request: reposting of what I posted in the Prophet's bot thread. some example of functions you could use with sending packets (AutoIt code, see link below for C#): ;////Code for sending packets.
[Question]Sending packets
10/28/2010 - RF Online - 3 Replies
I'm working on a hack involving sending packets back to the server, but every time i try and set a packet back, it cuts me of. I get disconnected when I try to send a packet. Can someone enlighten me to why is this happening and how can I avoid it? Thanks. P.S. Don't go posting in my thread saying im a noob and shit. I ask cos I wanna learn. At least I do it on my own and not beg for hacks and cheats.
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...
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 +2. The time now is 21:12.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.