I know this is an other of these "help me with realm relay!" threads. But help me out plz. I try to find out almost everything by searching these forums. I updated the packets.xml and now I want to update the HelloPacket.java
I found this hello packet in the swf file:
Code:
}//package _-0zw
//------------------------------------------------------------
//_-0zw._-0W6
package _-0zw{
import flash.utils.ByteArray;
import flash.util*****ataOutput;
public class _-0W6 extends _-0lF {
public var buildVersion_:String;
public var gameId_:int = 0;
public var guid_:String;
public var password_:String;
public var secret_:String;
public var keyTime_:int = 0;
public var key_:ByteArray;
public var _-29:String;
public var _-rb:String = "";
public var _-80:String = "";
public var _-1CX:String = "";
public var _-5a:String = "";
public var _-0Z1:String = "";
public function _-0W6(_arg1:uint, _arg2:Function){
this.buildVersion_ = new String();
this.guid_ = new String();
this.password_ = new String();
this.secret_ = new String();
this.key_ = new ByteArray();
this._-29 = new String();
super(_arg1, _arg2);
}
override public function writeToOutput(_arg1:IDataOutput):void{
_arg1.writeUTF(this.buildVersion_);
_arg1.writeInt(this.gameId_);
_arg1.writeUTF(this.guid_);
_arg1.writeInt(int(Math.floor((Math.random() * 0x3B9ACA00))));
_arg1.writeUTF(this.password_);
_arg1.writeInt(int(Math.floor((Math.random() * 0x3B9ACA00))));
_arg1.writeUTF(this.secret_);
_arg1.writeInt(this.keyTime_);
_arg1.writeShort(this.key_.length);
_arg1.writeBytes(this.key_);
_arg1.writeInt(this._-29.length);
_arg1.writeUTFBytes(this._-29);
_arg1.writeUTF(this._-rb);
_arg1.writeUTF(this._-80);
_arg1.writeUTF(this._-1CX);
_arg1.writeUTF(this._-5a);
_arg1.writeUTF(this._-0Z1);
}
override public function toString():String{
return (formatToString("HELLO", "buildVersion_", "gameId_", "guid_", "password_", "secret_"));
}
}
And updated HelloPacket.java like this:
Code:
package realmrelay.packets.client;
import java****.DataInput;
import java****.DataOutput;
import java********Exception;
import realmrelay.packets.Packet;
public class HelloPacket extends Packet {
public String buildVersion;
public int gameId;
public String guid;
public int randomInt1;
public String password;
public int randomInt2;
public String secret;
public int keyTime;
public byte[] key = new byte[0];
public byte[] obf1 = new byte[0];
public String obf2;
public String obf3;
public String obf4;
public String obf5;
public String obf6;
@override
public void parseFromInput(DataInput in) throws IOException {
this.buildVersion = in.readUTF();
this.gameId = in.readInt();
this.guid = in.readUTF();
this.randomInt1 = in.readInt();
this.password = in.readUTF();
this.randomInt2 = in.readInt();
this.secret = in.readUTF();
this.keyTime = in.readInt();
this.key = new byte[in.readShort()];
in.readFully(this.key);
this.obf1 = new byte[in.readInt()];
in.readFully(this.obf1);
this.obf2 = in.readUTF();
this.obf3 = in.readUTF();
this.obf4 = in.readUTF();
this.obf5 = in.readUTF();
this.obf6 = in.readUTF();
}
@override
public void writeToOutput(DataOutput out) throws IOException {
out.writeUTF(this.buildVersion);
out.writeInt(this.gameId);
out.writeUTF(this.guid);
out.writeInt(randomInt1);
out.writeUTF(this.password);
out.writeInt(randomInt2);
out.writeUTF(this.secret);
out.writeInt(this.keyTime);
out.writeShort(this.key.length);
out.write(this.key);
out.writeInt(this.obf1.length);
out.write(this.obf1);
out.writeUTF(this.obf2);
out.writeUTF(this.obf3);
out.writeUTF(this.obf4);
out.writeUTF(this.obf5);
out.writeUTF(this.obf6);
}
}
This doesn't work. Can someone help me out and also explain what I did wrong?
It's all right. Should work. + update account list packet and private keys.
Originally Posted by cookiezeater
It's all right. Should work. + update account list packet and private keys.
So I've done the account list packet but where do I find the private keys?
I've found this in ROTMGRelay.java:
Code:
public String key0 = "311F80691451C71B09A13A2A6E";
public String key1 = "72C5583CAFB6818995CBD74B80";
are that the keys I need to edit? and where do I find the new ones? in the decompiled swf?
Okay, here
311F80691451C71D09A13A2A6E
72C5583CAFB6818995CDD74B80
its almost like the old ones
I think there is a mistake in my HelloPacket.java still. I get this error:
GUWy0Ml.png
Hey, can one of you guys post the code for the updated account list packet? I have tried searching these forums for instructions/guides on how to update it myself, but only found only some clues and generic information. I decompressed the SWF, extracted it using rabcasm and searched using astrogrep for the word "accountlist" and came up with a few results. Some of the results were AccountList.class.asasm, AccountList.script.asasm, _-0QG.class.asasm and _-MW.class.asasm. I am not sure which of these files contains the new data I need to put in AccountListPacket.java in Eclipse. Below is what I have currently for AccountListPacket.java, if someone wants to provide the code for the updated one, I would appreciate it.
Code:
package realmrelay.packets.server;
import java****.DataInput;
import java****.DataOutput;
import java********Exception;
import realmrelay.packets.Packet;
public class AccountListPacket extends Packet {
public int accountListId;
public String[] accountIds = new String[0];
@override
public void parseFromInput(DataInput in) throws IOException {
this.accountListId = in.readInt();
this.accountIds = new String[in.readShort()];
for (int i = 0; i < this.accountIds.length; i++) {
this.accountIds[i] = in.readUTF();
}
}
@override
public void writeToOutput(DataOutput out) throws IOException {
out.writeInt(this.accountListId);
out.writeShort(this.accountIds.length);
for (String accountId: this.accountIds) {
out.writeUTF(accountId);
}
}
}
Originally Posted by excitedguy
Hey, can one of you guys post the code for the updated account list packet?
Hey this is the class of the ACCOUNTLIST packet:
Code:
}//package _-02l
//------------------------------------------------------------
//_-02l.AccountList
package _-02l{
import __AS3__.vec.Vector;
import flash.util*****ataInput;
import __AS3__.vec.*;
public class AccountList extends _-1ST {
public var accountListId_:int;
public var accountIds_:Vector.<String>;
public var lockAction_:int = -1;
public function AccountList(_arg1:uint, _arg2:Function){
this.accountIds_ = new Vector.<String>();
super(_arg1, _arg2);
}
override public function parseFromInput(_arg1:IDataInput):void{
var _local2:int;
this.accountListId_ = _arg1.readInt();
this.accountIds_.length = 0;
var _local3:int = _arg1.readShort();
_local2 = 0;
while (_local2 < _local3)
{
this.accountIds_.push(_arg1.readUTF());
_local2++;
};
this.lockAction_ = _arg1.readInt();
}
override public function toString():String{
return (formatToString("ACCOUNTLIST", "accountListId_", "accountIds_", "lockAction_"));
}
}
}//package _-02l
and I made this java class from that (don't know if it's ok):
Code:
package realmrelay.packets.server;
import java****.DataInput;
import java****.DataOutput;
import java********Exception;
import realmrelay.packets.Packet;
public class AccountListPacket extends Packet {
public int accountListId;
public String[] accountIds = new String[0];
public int lockAction;
@override
public void parseFromInput(DataInput in) throws IOException {
this.accountListId = in.readInt();
this.accountIds = new String[in.readShort()];
for (int i = 0; i < this.accountIds.length; i++) {
this.accountIds[i] = in.readUTF();
}
this.lockAction = in.readInt();
}
@override
public void writeToOutput(DataOutput out) throws IOException {
out.writeInt(this.accountListId);
out.writeShort(this.accountIds.length);
for (String accountId: this.accountIds) {
out.writeUTF(accountId);
}
out.writeInt(this.lockAction);
}
}
If you get it working help me out
I got it to work I think, although for some reason I see this in the logs when zoning to a new zone...
Code:
02:13:17 sun.org.mozilla.javascript.internal.EvaluatorException: Cannot convert
undefined to int (<Unknown source>#131) in <Unknown source> at line number 131
02:13:17 sun.org.mozilla.javascript.internal.EvaluatorException: Cannot convert
undefined to int (<Unknown source>#229) in <Unknown source> at line number 229
Not sure if thats important to fix or not, or where to even fix it, but everything seems to be working fine regardless.
EDIT: Deleted attachment as requested. I will post pastebin of the HELLO packet instead since posting it on here seems to screw it up...
Attached is the source I compiled that seems to work, let me know if you somehow improve it to get rid of those error messages in the log as I stated above.
Not 100% positive, but I'm pretty sure all attachments require 2 virus scans, or is that only for releases?
Please don't start throwing around updated RRs... Just help each other
I found my mistake. the settings.properties file had the wrong keys in them. RR works now.