adding a rpackets

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

Message
Author
GitzJoey
Noob
Noob
Posts: 5
Joined: 10 Feb 2017, 11:22
Noob?: Yes

adding a rpackets

#1 Post by GitzJoey »

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

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: adding a rpackets

#2 Post by Mortimal »

Yep u right in function.pl we got:

Code: Select all

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: Select all

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: Select all

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

Code: Select all

$rpackets->{08AF}{length} = 4;
Please use pin function for uploading your file contents!

GitzJoey
Noob
Noob
Posts: 5
Joined: 10 Feb 2017, 11:22
Noob?: Yes

Re: adding a rpackets

#3 Post by GitzJoey »

it works thanks

GitzJoey
Noob
Noob
Posts: 5
Joined: 10 Feb 2017, 11:22
Noob?: Yes

Re: adding a rpackets

#4 Post by GitzJoey »

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

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: adding a rpackets

#5 Post by Mortimal »

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!

GitzJoey
Noob
Noob
Posts: 5
Joined: 10 Feb 2017, 11:22
Noob?: Yes

Re: adding a rpackets

#6 Post by GitzJoey »

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

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: adding a rpackets

#7 Post by Mortimal »

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: Select all

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!

GitzJoey
Noob
Noob
Posts: 5
Joined: 10 Feb 2017, 11:22
Noob?: Yes

Re: adding a rpackets

#8 Post by GitzJoey »

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

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: adding a rpackets

#9 Post by Mortimal »

no prob good luck)
Please use pin function for uploading your file contents!

Post Reply