bRO's client asking for PIN Code on log in
Moderator: Moderators
-
- Moderators
- Posts: 208
- Joined: 01 Feb 2010, 17:37
- Noob?: No
- Location: Brazil - MG
Re: bRO's client asking for PIN Code on log in
raw packet size - 29. Just add some null data at the end of it's unpack string.
-
- Developers
- Posts: 308
- Joined: 06 Jul 2012, 13:44
- Noob?: No
Re: bRO's client asking for PIN Code on log in
using 'a', right?iMikeLance wrote:add some null data
I added this to Receive.pm:
Code: Select all
return 'a4 V9 v V2 v14 Z24 C6 v2 x4 a4' if $_ == 124;
edit:
this also works, with the same results:
Code: Select all
return 'a4 V9 v V2 v14 Z24 C6 v2 x4' if $_ == 124;
-
- Developers
- Posts: 308
- Joined: 06 Jul 2012, 13:44
- Noob?: No
Re: bRO's client asking for PIN Code on log in
there are these 'sendLoginPinCode' and 'login_pin_code_request' in ServerType0.pm.
since bRO.pm uses ServerType0 as 'base', it will get these subs from ServerType0?
since bRO.pm uses ServerType0 as 'base', it will get these subs from ServerType0?
-
- Halfway to Eternity
- Posts: 398
- Joined: 08 Jun 2012, 15:42
- Noob?: No
- Location: Brazil
Re: bRO's client asking for PIN Code on log in
You need to find the last 4 bytes, they must be important.ever_boy_ wrote:Code: Select all
return 'a4 V9 v V2 v14 Z24 C6 v2 x4' if $_ == 124;
Yesever_boy_ wrote:there are these 'sendLoginPinCode' and 'login_pin_code_request' in ServerType0.pm.
since bRO.pm uses ServerType0 as 'base', it will get these subs from ServerType0?
-
- Developers
- Posts: 308
- Joined: 06 Jul 2012, 13:44
- Noob?: No
Re: bRO's client asking for PIN Code on log in
If kore is able to properly load the char list, why would the remaining bytes be of any importance (I really don't know that)?KeplerBR wrote:You need to find the last 4 bytes, they must be important.ever_boy_ wrote:Code: Select all
return 'a4 V9 v V2 v14 Z24 C6 v2 x4' if $_ == 124;
I sniffed the packets using wireshark, and I noticed that, when inserting your Pin Code in the regular client, you send '08B8' packet to the server.
But when you choose your char using openkore, it doesn't send this packet, thus getting the error message "invalid specified character".
In this case, why isn't kore using these subs? You see, there's this in ServerType0.pm:KeplerBR wrote:Yesever_boy_ wrote:there are these 'sendLoginPinCode' and 'login_pin_code_request' in ServerType0.pm.
since bRO.pm uses ServerType0 as 'base', it will get these subs from ServerType0?
Code: Select all
sub login_pin_code_request {
my ($self, $args) = @_;
my $done;
if ($args->{flag} == 0) {
# PIN code has never been set before, so set it.
return if ($config{loginPinCode} eq '' && !($self->queryAndSaveLoginPinCode()));
my @key = split /[, ]+/, $masterServer->{PINEncryptKey};
-
- Developers
- Posts: 308
- Joined: 06 Jul 2012, 13:44
- Noob?: No
Re: bRO's client asking for PIN Code on log in
This is what I added to receive\bRO.pm:
edit: changed the handler from account_id to login_pin_code_request. still got the same error, but I think it makes much more sense, as seen in ServerType0:
Code: Select all
sub new {
my ($class) = @_;
my $self = $class->SUPER::new(@_);
my %packets = (
+ '08B9' => ['login_pin_code_request', 'v V', [qw(flag key)]], #8
'0097' => ['private_message', 'v Z24 V Z*', [qw(len privMsgUser flag privMsg)]], # -1
[tons of packets here]
);
foreach my $switch (keys %packets) {
$self->{packet_list}{$switch} = $packets{$switch};
}
+ my %handlers = qw(
+ login_pin_code_request 08B9
+ );
+ $self->{packet_lut}{$_} = $handlers{$_} for keys %handlers;
return $self;
}
Code: Select all
# mRO PIN code Check
'02AD' => ['login_pin_code_request', 'v V', [qw(flag key)]],
-
- Moderators
- Posts: 208
- Joined: 01 Feb 2010, 17:37
- Noob?: No
- Location: Brazil - MG
Re: bRO's client asking for PIN Code on log in
You shouldn't do this as 02AD length is 8b and 08B9 is 12b. Also 08B9 is received AFTER inputing pin code and selecting your char.ever_boy_ wrote:edit: changed the handler from account_id to login_pin_code_request. still got the same error, but I think it makes much more sense, as seen in ServerType0:Code: Select all
# mRO PIN code Check '02AD' => ['login_pin_code_request', 'v V', [qw(flag key)]],
-
- Developers
- Posts: 308
- Joined: 06 Jul 2012, 13:44
- Noob?: No
Re: bRO's client asking for PIN Code on log in
It's a bit confusing here. BEFORE entering the pin, I get the 08B9 packet together with the char list info. At this point, it contains my account ID:iMikeLance wrote:Also 08B9 is received AFTER inputing pin code and selecting your char.
b9 08 45 4e 7e 05 XX XX XX XX 01 00
exactly 12 bytes (from the regular client).
But AFTER inputing the pin code, the 08B9 shows up again (not with char list info this time), the same 12 bytes, but they're all null (00) except for the packet's ID.
So, since this is received after the pin code is inserted, it can't be login_pin_code_request... is it account_id then?
'08B9' => ['account_id', 'x4 a4 x2', [qw(accountID)]], # 12
edit: now I see it fits: 4 null bytes, 4 bytes for account ID, 2 null bytes.
And the reason why kore is not asking for the Pin Code, is it because the packet handler for the pin code is not set in receive\bRO.pm?
But... if kore is not inserting the pin, how come it gets an unknown switch from a packet which shouldn't be received yet (08B9)?
-
- Developers
- Posts: 308
- Joined: 06 Jul 2012, 13:44
- Noob?: No
Re: bRO's client asking for PIN Code on log in
Main thing now is: how do we tell kore to send the pin code before sending char_login?
I ran some tests and I came up with this about packet 08B9:
AA AA BB BB BB BB CC CC CC CC DD XX
A = Packet's ID
B = random number
C = Account ID
D = Flag which indicates whether the Pin has been set or not (02 if never set before, 01 if already set)
X = null byte (maybe part of the flag)
This only shows at the end of 082D packet, before entering the pin code. Once you enter your Pin Code, the packet shows up again, but only null bytes.
I ran some tests and I came up with this about packet 08B9:
AA AA BB BB BB BB CC CC CC CC DD XX
A = Packet's ID
B = random number
C = Account ID
D = Flag which indicates whether the Pin has been set or not (02 if never set before, 01 if already set)
X = null byte (maybe part of the flag)
This only shows at the end of 082D packet, before entering the pin code. Once you enter your Pin Code, the packet shows up again, but only null bytes.
-
- Developers
- Posts: 1798
- Joined: 05 Dec 2008, 05:42
- Noob?: Yes
Re: bRO's client asking for PIN Code on log in
rRO currently supported only with XKore 1 (due to complicated malware bundled with the client), so this packet may have more important stuff for other modes.KeplerBR wrote:I realized that this package has already cataloged in rRO.pm ... I believe that, at least in this regard, has already been implemented in the rRO. If that's right, just take what you have and include the rRO in the archives of bRO.
There may be something important, but as well there may be just some additional information about your characters.ever_boy_ wrote:If kore is able to properly load the char list, why would the remaining bytes be of any importance (I really don't know that)?KeplerBR wrote:You need to find the last 4 bytes, they must be important.
Strange.ever_boy_ wrote:meaning that, if this sub was being used, it should at least ask for a Pin Code, but that's not happening.
No, that's not the reason. All handlers from Receive.pm and ServerType0.pm should be inherited.ever_boy_ wrote:And the reason why kore is not asking for the Pin Code, is it because the packet handler for the pin code is not set in receive\bRO.pm?
"DD XX" is just a two-byte 'v' for unpack, probably.ever_boy_ wrote:AA AA BB BB BB BB CC CC CC CC DD XX
If so, values for "flag" are different from what is currently in login_pin_code_request handler, and it won't work as is. We would need to redefine flag values for bRO, or maybe it's something completely different from what was on mRO (or wherever login_pin_code_request was used) so you'll need your own handler. By the way, does mRO still use that pin code thing?ever_boy_ wrote: D = Flag which indicates whether the Pin has been set or not (02 if never set before, 01 if already set)
When you're receiving that packet for the second time, it probably just means (by this fact alone, or by contents if that's the only case when flag=0) that client should go on with connecting. That's not hard to implement.
It can help to understand what needs to be done if more complete log of whatever packet switches and lengths (and contents, if you're brave) are sent and received by the client in which sequence. Also, are you using XKore 1? If not, have you tried?
Maybe kLabMouse can tell something about that, after all, he added login_pin_code_request back then.