Openkore.com

OpenKore Forums
It is currently 27 May 2018, 13:35

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: adding a rpackets
PostPosted: 12 Mar 2017, 14:26 
Offline
Noob
Noob

Joined: 10 Feb 2017, 11:22
Posts: 5
hi,

sorry if i noob in perl, but i need info on how to add/push $rpackets in MessageTokenizer.pm (line 125)

im guessing that $rpackets are in some kind of (key, value) array form, which generated frm recvpacket.txt

i just need to push a new token,

thanks


Top
 Profile  
 
 Post subject: Re: adding a rpackets
PostPosted: 12 Mar 2017, 16:15 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
Yep u right in function.pl we got:
Code:
Settings::addTableFile(Settings::getRecvPacketsFilename(),
      loader => [\&parseRecvpackets, \%rpackets]);


This means %rpackets contains all packets from recvpacket file. So we need to look in FileParser.pm and find it structure:

Code:
my ($packetID, $length, $minLength, $repeat, $function) = split /\s+/, $line, 5;
$packetID =~ s/^(0x[0-9a-f]+)$/hex $1/e;
$r_hash->{$packetID}{length} = $length;
$r_hash->{$packetID}{minLength} = $minLength;
$r_hash->{$packetID}{repeat} = $repeat;
$r_hash->{$packetID}{function} = $function;


Boom here it is.

And u no need to push in hash.... it is hash :) If u need only packet and size do this:

Code:
$rpackets->{your_packet_here}{length} = your_length_here;


example:

Code:
$rpackets->{08AF}{length} = 4;

_________________
Please use pin function for uploading your file contents!


Top
 Profile  
 
 Post subject: Re: adding a rpackets
PostPosted: 12 Mar 2017, 16:47 
Offline
Noob
Noob

Joined: 10 Feb 2017, 11:22
Posts: 5
it works thanks


Top
 Profile  
 
 Post subject: Re: adding a rpackets
PostPosted: 12 Mar 2017, 17:26 
Offline
Noob
Noob

Joined: 10 Feb 2017, 11:22
Posts: 5
thanks again


Last edited by GitzJoey on 12 Mar 2017, 17:50, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: adding a rpackets
PostPosted: 12 Mar 2017, 17:35 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
Duno what u wrote? :) Receive or Send? U want to edit packet content lengths on the go, while Kore working? Because if not this can be put in your serverType file.

_________________
Please use pin function for uploading your file contents!


Top
 Profile  
 
 Post subject: Re: adding a rpackets
PostPosted: 12 Mar 2017, 17:52 
Offline
Noob
Noob

Joined: 10 Feb 2017, 11:22
Posts: 5
yes, what im facing in my country is randomize token (specially for login)
i'm guessing i need to rebuilding on the fly specially for revpacket and receive


Top
 Profile  
 
 Post subject: Re: adding a rpackets
PostPosted: 12 Mar 2017, 18:10 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
if all packets working correct except this why u no set exception for all packets not set in recvpackets.txt?

it is in parse function in src\Network\PacketParser.pm just consider all unset packets is your packet....

Code:
unless ($handler) {
      warning "Packet Parser: Unknown switch: $lastSwitch\n";#
      return undef;#delete this
      $handler = ['bla_bla', 'bla bla bla', [qw(bla bla)]];
   }


of course this is extreme but u can try :)

_________________
Please use pin function for uploading your file contents!


Top
 Profile  
 
 Post subject: Re: adding a rpackets
PostPosted: 12 Mar 2017, 18:19 
Offline
Noob
Noob

Joined: 10 Feb 2017, 11:22
Posts: 5
yes tq for the tip

i just $self->{packet_list}{$lastSwitch} = ['secure_login_key', 'x2 a*', [qw(secure_key)] ];
before my $handler

anyway its already fixed, but having a different error now lol

tq anyway


Top
 Profile  
 
 Post subject: Re: adding a rpackets
PostPosted: 12 Mar 2017, 18:21 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
no prob good luck)

_________________
Please use pin function for uploading your file contents!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group