[Help] XKORE2 Problem [Problem Solved]

Philippines

Moderators: waferbaron, Moderators

Forum rules
This server is currently not maintained and tables folder (including connection info) is outdated. Read the wiki for instructions on how to update those information. Please contribute your updated info. Contact Cozzie to join the team as a regular server supporter.
Post Reply
Message
Author
kccuico
Noob
Noob
Posts: 6
Joined: 17 May 2011, 02:03
Noob?: Yes

[Help] XKORE2 Problem [Problem Solved]

#1 Post by kccuico »

Can someone help me to connect my client to work with xkore2 mode...
I always get this character_info size error...
Can someone please tell me how to fix this...


# Problem Solved....
# I will be monitoring it for a while...

This is How I Fixed it.... *From sofax222's Post
*Thanks to sofax222
Making "Xkore 2" and "Xkore 1" work, you need change the packet file and some programs as followings:

The 006B packet sending back to RO Client.
The 006B packect including the data of characters is sent back from server.
I change some codes in the program, src/Network/XKore2/CharServer.pm

Code: Select all

23 sub getCharacters {
24     my ($self, $session) = @_;
25     my @chars;
26     if (!$session->{dummy} && $char) {
27         push @chars, $char;
28 #       for (my $i = 0; $i < 6; $i++) {
29 #           push @chars, $char;
30 #       }
31     } else {
32         $session->{dummy} = 1;
33         for (my $i = 0; $i < 6; $i++) {
34             push @chars, Base::Ragnarok::CharServer::DUMMY_CHARACTER;
35         }
36     }
37     return @chars;
38 }
The line 28, 29 and 30 are the original codes, I remark them and add the line 27.

I change some codes in the program, src/Base/Ragnarok/CharServer.pm

Code: Select all

72 sub process_0065 {
73     # Character server login.
..............
89         foreach my $char ($self->getCharacters($session)) {
90             $index++;
91             next if (!$char);
92 #           my $charStructure = pack('x' . $self->charBlockSize());
93             my $charStructure = pack('x' . $self->charBlockSize() + 3);
94
95 #           substr($charStructure, 0, 18) = pack('a4 V3 v',
96             substr($charStructure, 0, 21) = pack('C3 a4 V3 v',
97                 0x06, 0x06, 0x06,
98                 $char->{charID},    # character ID
99                 $char->{exp},       # base experience
100                 $char->{zeny},      # zeny
101                 $char->{exp_job},   # job experience
102                 $char->{lv_job}     # job level
103             );
104
105 #           substr($charStructure, 42, 64) = pack('v7 x2 v x2 v x2 v4 Z24 C6 v',
106             substr($charStructure, 43, 72) = pack('v V2 v5 x2 v x2 v x2 v4 Z24 C6 v2',
107                 0,
108                 $char->{hp},
109                 $char->{hp_max},
110                 $char->{sp},
111                 $char->{sp_max},
112                 $char->{walk_speed} * 1000,
113                 $char->{jobID},
114                 $char->{hair_style},
115                 $char->{lv},
116                 $char->{headgear}{low},
117                 $char->{headgear}{top},
118                 $char->{headgear}{mid},
119                 $char->{hair_color},
120                 $char->{clothes_color},
121                 $char->{name},
122                 $char->{str},
123                 $char->{agi},
124                 $char->{vit},
125                 $char->{int},
126                 $char->{dex},
127                 $char->{luk},
128 #               $index
129                 $index,
130                 $index + 1
131             );
132
133             $output .= $charStructure;
134         }
..............
The line 92 is remarked, add the line 93. The length of 006B should be 119 (the charBlockSize sholud be 115).
(PS: I don't know the charBlockSize sholud be change to 115 or not ?!)

The line 95 is remarked, add the line 96 and 97.
(PS: I don't know the 2 0x06 btyes for what, yet ??)

The line 105 is remarked, add the line 106 and 107.
The line 128 is remarked, add the line 129 and 130.

I change some codes in the program, src/Base/Ragnarok/MapServer.pm

Code: Select all

39 sub handleLogin {
40     my ($self, $client, $accountID, $charID, $sessionID, $gender) = @_;
41     my $session = $self->{sessionStore}->get($sessionID);
42 
43     if (!$session || $session->{accountID} ne $accountID || $session->{sessionID} != $sessionID
44       || $session->{sex} != $gender || $session->{charID} ne $charID
45       || $session->{state} ne 'About to load map') {
46         $client->close();
47 
48     } else {
49         $self->{sessionStore}->remove($session);
50         $client->{session} = $session;
51 
52         my $output;
53         $output = pack("C8", 0xFF, 0x07, 0x08, 0x00, 0x03, 0x00, 0x00, 0x00);
54         #Note: in perl 8 == "8_4" == '8_4',  so to separate them you need to use a regular expression
55 #       $output = pack("C2",0x83, 0x02) if ($self->getServerType() =~ m/^8(_[1-5])$/);
56         $output .= pack("C2", 0x83, 0x02) if (($self->getServerType() =~ m/^8(_[1-5])$/) || ($self->getServerType() eq "twRO"));
57         $output .= $accountID;
58 
59         my $charInfo = $self->getCharInfo($session);
60         my $coords = '';
61         shiftPack(\$coords, $charInfo->{x}, 10);
62         shiftPack(\$coords, $charInfo->{y}, 10);
63         shiftPack(\$coords, 0, 4);
64         $output .= pack("C2 V a3 x2",
65             0x73, 0x00,
66             int(time),  # syncMapSync
67             $coords     # character coordinates
68         );
69         $client->send($output);
70     }
71 }
Add the line 53. (Send a 07FF packet to RO client before 0283 packet.)
The line 55 is remarked, add the line 56.

I change some lenght of packets(recvpackets-twRO-free.txt) :
0072 22 -> 0072 19
007E 105 -> 007E 6
0085 10 -> 0085 5
0089 11 -> 0089 7
0094 19 -> 0094 6
and....

Early, the XKore 1 & 2 bith did not work.
So, I decide try to hack the XKore 2 firstly.
(PS: I think the XKore 2 should be more easy).
And then, I hack it step by step with packet analysising.
After the XKore 2 working, the XKore just works, too.
I did nothing change for XKore 1.

But, the changes of packet length may be more than these.
Because, I did not change them in one time.
I did these change with try and error.

Actually, you could add some codes into the subroutine "onClientData" of /src/Base/RagnarokServer.pm.
such as:

Code: Select all

sub onClientData {
    my ($self, $client, $data) = @_;
    $client->{tokenizer}->add($data);
    my $type;
    print "got RO client messages !!!\n";
    bufDump($data);
    while (my $message = $client->{tokenizer}->readNext(\$type)) {
        if ($type == Network::MessageTokenizer::KNOWN_MESSAGE) {
            my $ID = Network::MessageTokenizer::getMessageID($message);
            print "--- $ID\n";
            my $handler = $self->can('process_' . (($ID eq $masterServer->{mast.........
...............
The lines are my adding:
print "got RO client messages !!!\n";
bufDump($data); (This "bufDump" is a subroutine what I add for dumping the packet in hex format.)
print "--- $ID\n";

After the RO client connect to XKore 2.
The XKore 2 shows the hex data sent from RO client.
If it show the "---XXXX", it means the XKore 2 could identify the packet.
If it show ont the hex data, the packet is bypassed with XKore 2.
So, you can count the number of hex codes (the packet length), and compare with the packet.txt file.

The bufDump code such as:

Code: Select all

sub bufDump {
    my $buf = shift;
    my $nn = 0;
    foreach (split(//, $buf)) {
        printf("%02X ", ord($_));
        $nn++;
        print "  " if ($nn == 8);
        if ($nn == 16) {
            print "\n";
            $nn = 0;
        }
    }
    print "\n";
}

*Again, thanks to sofax222 for this...
Last edited by kccuico on 19 May 2011, 08:21, edited 2 times in total.

ChaosOrb
Human
Human
Posts: 22
Joined: 17 May 2011, 05:28
Noob?: No
Location: /root

Re: [Help] XKORE2 Problem

#2 Post by ChaosOrb »

can you post your xkore2 config.

kccuico
Noob
Noob
Posts: 6
Joined: 17 May 2011, 02:03
Noob?: Yes

Re: [Help] XKORE2 Problem

#3 Post by kccuico »

# 1 = hook into RO client, 2 = Act as stand-alone proxy, proxy = act as true proxy
XKore 2
XKore_silent 1
XKore_bypassBotDetection 0
XKore_exeName lokiexe.exe

# XKore 2 / Proxy configuration
XKore_listenIp 127.0.0.1
XKore_ID New Loki(Extreme)
XKore_listenPort 6900
XKore_publicIp 127.0.0.1

# It is not advised to set secureAdminPassword if you're using Xkore 2
secureAdminPassword 0
adminPassword
callSign
commandPrefix ;

pauseCharServer 0
pauseMapServer 0
ignoreInvalidLogin 0
secureLogin_requestCode

message_length_max 80

ChaosOrb
Human
Human
Posts: 22
Joined: 17 May 2011, 05:28
Noob?: No
Location: /root

Re: [Help] XKORE2 Problem

#4 Post by ChaosOrb »

Have you followed the instructions in the links below?

XKore Settings
http://wiki.openkore.com/index.php/XKore

Using Poseidon
http://wiki.openkore.com/index.php/Poseidon
---------------------------------------------------------------------
I'm not sure if XKore/Poseidon works properly with the 'New Loki' client. I have tried using XKore the other and somehow, every time I login, it fails. I don't know if this is because of GG or OpenKore doesn't sync properly with Poseidon.

I'll try to post screenies and codes when I can, I'm currently @work.

kccuico
Noob
Noob
Posts: 6
Joined: 17 May 2011, 02:03
Noob?: Yes

Re: [Help] XKORE2 Problem

#5 Post by kccuico »

I already finished reading the xkore instruction...
I am not using Poseidon because I can run xkore 1 using a hexed lokiexe.exe without problems....
In my knowledge... Poseidon is a must if you don't have a hex client to bypass GameGuard...
So may the problem is in Openkore... or may be on my client....

I always get the character_info size error....
OpenKore's value is 112, so as New Loki....
I have been googling for hours now but still cant find any fix...
I hope some experts can help me... or maybe those who had it working before... :)

ChaosOrb
Human
Human
Posts: 22
Joined: 17 May 2011, 05:28
Noob?: No
Location: /root

Re: [Help] XKORE2 Problem [Problem Solved]

#6 Post by ChaosOrb »

Good job on solving this issue. Since you solved your own problem. You might as well share the solution you have, so that other users will know on how to solve if they encounter the same problem as yours.

Post Reply