Advertisement
Guest User

Untitled

a guest
Aug 5th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 KB | None | 0 0
  1. Credits for who deserves them, the author of those modifications is Sugoi.
  2.  
  3. src\network\send\ServerType0.pm
  4. Remark:
  5. =pod
  6. sub sendMasterLogin {
  7. my ($self, $username, $password, $master_version, $version) = @_;
  8. my $msg;
  9.  
  10. if ($self->{serverType} == 4) {
  11. # This is used on the RuRO private server.
  12. # A lot of packets are different so I gave up,
  13. # but I'll keep this code around in case anyone ever needs it.
  14.  
  15. # I'm not sure if serverType 4 actually needs this whacko login
  16.  
  17. $username = substr($username, 0, 23) if (length($username) > 23);
  18. $password = substr($password, 0, 23) if (length($password) > 23);
  19.  
  20. my $tmp = pack("C*", 0x0D, 0xF0, 0xAD, 0xBA) x 6;
  21. substr($tmp, 0, length($username) + 1, $username . chr(0));
  22. $username = $tmp;
  23.  
  24. $tmp = (pack("C*", 0x0D, 0xF0, 0xAD, 0xBA) x 3) .
  25. pack("C*", 0x00, 0xD0, 0xC2, 0xCF, 0xA2, 0xF9, 0xCA, 0xDF, 0x0E, 0xA6, 0xF1, 0x41);
  26. substr($tmp, 0, length($password) + 1, $password . chr(0));
  27. $password = $tmp;
  28.  
  29. $msg = pack("v1 V", hex($masterServer->{masterLogin_packet}) || 0x64, $version) .
  30. $username . $password .
  31. pack("C*", $master_version);
  32.  
  33. } else {
  34. $msg = pack("v1 V", hex($masterServer->{masterLogin_packet}) || 0x64, $version) .
  35. pack("a24", $username) .
  36. pack("a24", $password) .
  37. pack("C*", $master_version);
  38. }
  39. $self->sendToServer($msg);
  40. }
  41. =cut
  42.  
  43. From src\network\send\bRO.pm add to src\network\send\ServerType0.pm
  44.  
  45. sub version {
  46. return $masterServer->{version} || 1;
  47. }
  48.  
  49. # 0x0204,18
  50. sub sendClientMD5Hash {
  51. my ($self) = @_;
  52. my $msg = pack('v H32', 0x0204, $masterServer->{clientHash});
  53. $self->sendToServer($msg);
  54. }
  55.  
  56. # 0x02b0,85
  57. sub sendMasterLogin {
  58. my ($self, $username, $password, $master_version, $version) = @_;
  59. # Little Hack by 'Technology'
  60. $self->sendClientMD5Hash() if ($masterServer->{clientHash} != '');
  61. my $key = pack('C24', (6, 169, 33, 64, 54, 184, 161, 91, 81, 46, 3, 213, 52, 18, 0, 6, 61, 175, 186, 66, 157, 158, 180, 48));
  62. my $chain = pack('C24', (61, 175, 186, 66, 157, 158, 180, 48, 180, 34, 218, 128, 44, 159, 172, 65, 1, 2, 4, 8, 16, 32, 128));
  63. my $in = pack('a24', $password);
  64. my $rijndael = Utils::Rijndael->new();
  65. $rijndael->MakeKey($key, $chain, 24, 24);
  66. $password = $rijndael->Encrypt($in, undef, 24, 0);
  67. # To get out local IP of our connection we need: $self->{net}->{remote_socket}->sockhost();
  68. my $ip = "3139322e3136382e322e3400685f4c40";
  69. # To get the MAC we need to use Net::ARPing or Net::Address::Ethernet or even Net::Ifconfig::Wrapper, that are not bundeled in Win Distro.
  70. my $mac = "31313131313131313131313100"; # May-be Get it from Network Connection?
  71. my $isGravityID = 0;
  72. my $msg = pack('v V a24 a24 C H32 H26 C', 0x02B0, version(), $username, $password, $master_version, $ip, $mac, $isGravityID);
  73. $self->sendToServer($msg);
  74. }
  75.  
  76. src\network\receive\bRO.pm add from src\network\receive\bRO\Thor.pm
  77.  
  78. sub new {
  79. my ($class) = @_;
  80. my $self = $class->SUPER::new(@_);
  81. my %packets = (
  82. '0078' => ['actor_display', 'C a4 v14 a4 a2 v2 C2 a3 C3 v',
  83. [qw(object_type ID walk_speed opt1 opt2 option type hair_style weapon lowhead shield tophead midhead hair_color clothes_color head_dir guildID emblemID manner opt3 karma sex coords unknown1 unknown2 act lv)]], # 55 # standing
  84. '007C' => ['actor_display', 'C a4 v14 C2 a3 C2', [qw(object_type ID walk_speed opt1 opt2 option hair_style weapon lowhead type shield tophead midhead hair_color clothes_color head_dir karma sex coords unknown1 unknown2)]], # 42 # spawning
  85. '022C' => ['actor_display', 'C a4 v3 V v5 V v5 a4 a2 v V C2 a6 C2 v', [qw(object_type ID walk_speed opt1 opt2 option type hair_style weapon shield lowhead tick tophead midhead hair_color clothes_color head_dir guildID emblemID manner opt3 karma sex coords unknown1 unknown2 lv)]], # 65 # walking
  86. );
  87.  
  88. foreach my $switch (keys %packets) {
  89. $self->{packet_list}{$switch} = $packets{$switch};
  90. }
  91.  
  92. return $self;
  93. }
  94.  
  95. tables\servers.txt - the IP and the secureLogin had changed
  96.  
  97. [Brazil - bRO: Odin]
  98. ip 200.229.49.10
  99. port 6900
  100. master_version 22
  101. version 1
  102. serverType bRO
  103. secureLogin 0
  104. secureLogin_type 0
  105. secureLogin_requestCode
  106. secureLogin_account 0
  107. serverEncoding Western
  108. gameGuard 2
  109. storageEncryptKey 0x050B6F79, 0x0202C179, 0x0E20120, 0x04FA43E3, 0x0179B6C8, 0x05973DF2, 0x07D8D6B, 0x08CB9ED9
  110. addTableFolders bRO
  111.  
  112. [Brazil - bRO: Thor]
  113. ip 200.229.50.3
  114. port 6900
  115. master_version 22
  116. version 1
  117. serverType bRO_Thor
  118. secureLogin 0
  119. secureLogin_type 0
  120. secureLogin_requestCode
  121. secureLogin_account 0
  122. serverEncoding Western
  123. gameGuard 2
  124. storageEncryptKey 0x050B6F79, 0x0202C179, 0x0E20120, 0x04FA43E3, 0x0179B6C8, 0x05973DF2, 0x07D8D6B, 0x08CB9ED9
  125. addTableFolders bRO
  126.  
  127. tables\bRO\recvpackets.txt - from renew (credits for kLabMouse for v3)
  128. attached
  129.  
  130. The new Poseidon code has no conpatibility with bRO, so the old one with some fixes is been used
  131.  
  132. src\Poseidon\ - attached
  133. src\IPC\ - attached
  134.  
  135. Best regards.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement