Java Packet routines

08/17/2006 04:16 ChaoTao#1
I have tried to decypher the cryptic routines of QOproxy, but I just cant figure out how the encryption/decryption works. Can anyone help me on this subject?
[img]text2schild.php?smilienummer=1&text=Thanks in advance' border='0' alt='Thanks in advance' />
08/17/2006 04:45 shadowxx#2
wasn't the source code given :rolleyes:
08/17/2006 14:58 ChaoTao#3
Yes, it was, but i cant figure out what on earth this is doing:
Code:
public boolean processLogin(int cs)
  {
    int ss=tcp.connectToHost(remoteLoginIP,remoteLoginPort);
    if(ss==-1) return false;
    logFS1=0;
    logFS2=0;
    logFC1=0;
    logFC2=0;
    logTS1=0;
    logTS2=0;
    logTC1=0;
    logTC2=0;
    byte[] b;
    b=getLoginPacketFromClient(cs);
    if(b==null) return false;
    sendLoginPacketToServer(ss,b);
    b=getLoginPacketFromServer(ss);
    if(b==null) return false;
    String ip="";
 String proxip=new String(lip);
 if(tcp.getIPAddress(cs).equals("127.0.0.1"))
 	proxip="127.0.0.1\0\0\0\0\0\0\0";
    try
    {
      if(b[2]==0x1f && b[3]==0x04)
      {
        for(int i=12; i<28; i++)
        {
          if(b[i]>0)
            ip+=(char)b[i];
          b[i]=proxip.getBytes()[i-12];
        }
      }
    }
    catch(Exception ee) { return false; }
    remoteMapIP=ip;

    try
    {
      p1=(b[4]&0xFF)|((b[5]&0xFF)<<8)|((b[6]&0xFF)<<16)|((b[7]&0xFF)<<24);
      p2=(b[8]&0xFF)|((b[9]&0xFF)<<8)|((b[10]&0xFF)<<16)|((b[11]&0xFF)<<24);
      remoteMapPort=(b[28]&0xFF)|((b[29]&0xFF)<<8)|((b[30]&0xFF)<<16)|((b[31]&0xFF)<<24);
      b[28]=(byte)(localMapPort&0xFF);
      b[29]=(byte)((localMapPort&0xFF00)>>8);
      b[30]=(byte)((localMapPort&0xFF0000)>>16);
      b[31]=(byte)((localMapPort&0xFF000000)>>24);
    }
    catch(Exception ee) { return false; }
    sendLoginPacketToClient(cs,b);
    b=getLoginPacketFromClient(cs);
    if(b==null) return false;
    sendLoginPacketToServer(ss,b);
    return true;
  }
all i want is a simple login teh char decrypt, encrypt routine, or atlease some help in creating one.
08/17/2006 15:25 WaRpEd#4
wtf thats not encryption/decryption
thats writing to the log file

and its catching game server packet and switching IP to local IP o.o

See the "if(b[2]==0x1f && b[3]==0x04)"

byte 2 and 3 always hold the packet ID,

so if packet ID = 0x41f (gameserver login packet)
then... blah blah switch ip to 127.0.0.1

>.>
08/17/2006 16:16 ChaoTao#5
Code:
  	//get some byte
    int l1=tcp.getByte(s);
    if(l1==-1) return null;
    //get some byte
    int l2=tcp.getByte(s);
    if(l2==-1) return null;
    
    l1^=0xAB;
can anyone help decrypt the above?
l1^=0xAB;
l1 to the power of 0xAB? (its hex i know but why?)