unknown packet 09A0

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

Moderator: Moderators

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: unknown packet 09A0

#21 Post by kLabMouse »

Packet: 08AF
ID: PACKET_HC_WAITING_LOGIN
Struct:

Code: Select all

struct PACKET_HC_WAITING_LOGIN {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long AID
  /* this+0x6 */ int CurWaitingNum
}
Packet: 08B0
ID: PACKET_CH_WAITING_LOGIN
Struct:

Code: Select all

struct PACKET_CH_WAITING_LOGIN {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long AID
  /* this+0x6 */ int AuthCode
  /* this+0xa */ unsigned long userLevel
  /* this+0xe */ unsigned short clientType
  /* this+0x10 */ unsigned char Sex
}
Packet: 08B2
ID: PACKET_AC_REALNAME_AUTH
Struct:

Code: Select all

// TODO. No Inner Struct
struct PACKET_AC_REALNAME_AUTH {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ short PacketLength
  /* this+0x4 */ unsigned short AccountArea
}
Packet: 08B7
ID: PACKET_HC_SECOND_PASSWD_REQ
Struct: [Can't find struct]

Packet: 08B8
ID: PACKET_CH_SECOND_PASSWD_ACK
Struct:

Code: Select all

struct PACKET_CH_SECOND_PASSWD_ACK {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long AID
  /* this+0x6 */ char[0x4] SecondPWIdx
}
Packet: 08B9
ID: PACKET_HC_SECOND_PASSWD_LOGIN
Struct:

Code: Select all

struct PACKET_HC_SECOND_PASSWD_LOGIN {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long Seed
  /* this+0x6 */ unsigned long AID
  /* this+0xa */ unsigned short Result
}
Packet: 08BA
ID: PACKET_CH_MAKE_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_CH_MAKE_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long AID
  /* this+0x6 */ char[0x4] SecondPWIdx
}
Packet: 08BB
ID: PACKET_HC_MAKE_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_HC_MAKE_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned short Result
  /* this+0x4 */ unsigned long Seed
}
Packet: 08BC
ID: PACKET_CH_DELETE_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_CH_DELETE_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long AID
  /* this+0x6 */ char[0x4] SecondPWIdx
}
Packet: 08BD
ID: PACKET_HC_DELETE_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_HC_DELETE_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned short Result
  /* this+0x4 */ unsigned long Seed
}
Packet: 08BE
ID: PACKET_CH_EDIT_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_CH_EDIT_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long AID
  /* this+0x6 */ char[0x4] oldSecondPWIdx
  /* this+0xa */ char[0x4] newSecondPWIdx
}
Packet: 08BF
ID: PACKET_HC_EDIT_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_HC_EDIT_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned short Result
  /* this+0x4 */ unsigned long Seed
}
Packet: 08C3
ID: PACKET_CH_NOT_AVAILABLE_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_CH_NOT_AVAILABLE_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long AID
  /* this+0x6 */ char[0x4] SecondPWIdx
}
Packet: 08C4
ID: PACKET_HC_NOT_AVAILABLE_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_HC_NOT_AVAILABLE_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned short Result
  /* this+0x4 */ unsigned long Seed
}
Packet: 08C5
ID: PACKET_CH_AVAILABLE_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_CH_AVAILABLE_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long AID
}
Packet: 08C6
ID: PACKET_HC_AVAILABLE_SECOND_PASSWD
Struct:

Code: Select all

struct PACKET_HC_AVAILABLE_SECOND_PASSWD {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned short Result
}
Packet: 08CC
ID: PACKET_CA_LOGIN5
Struct:

Code: Select all

struct PACKET_CA_LOGIN5 {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long Version
  /* this+0x6 */ unsigned char[0x33] ID
  /* this+0x39 */ unsigned char[0x33] Passwd
  /* this+0x6c */ unsigned char clienttype
}
Packet: 08D4
ID: PACKET_CH_REQ_CHANGE_CHARACTER_SLOT
Struct:

Code: Select all

struct PACKET_CH_REQ_CHANGE_CHARACTER_SLOT {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ short beforeCharNum
  /* this+0x4 */ short AfterCharNum
  /* this+0x6 */ short CurChrSlotCnt
}
Packet: 08D5
ID: PACKET_HC_ACK_CHANGE_CHARACTER_SLOT
Struct:

Code: Select all

// TODO. No Inner Struct
struct PACKET_HC_ACK_CHANGE_CHARACTER_SLOT {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ short PacketLength
  /* this+0x4 */ short Reason
  /* this+0x6 */ short AfterChrSlotCnt
}
Packet: 08E3
ID: PACKET_HC_UPDATE_CHARINFO
Struct:

Code: Select all

struct PACKET_HC_UPDATE_CHARINFO {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ struct CHARACTER_INFO charinfo

}
Packet: 08E4
ID: PACKET_AC_SHUTDOWN_INFO
Struct:

Code: Select all

struct PACKET_AC_SHUTDOWN_INFO {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ long Time
}
Packet: 08FC
ID: PACKET_CH_REQ_CHANGE_CHARACTERNAME
Struct:

Code: Select all

struct PACKET_CH_REQ_CHANGE_CHARACTERNAME {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long dwGID
  /* this+0x6 */ char[0x18] szCharName
}
Packet: 08FD
ID: PACKET_CH_ACK_CHANGE_CHARACTERNAME
Struct: [Can't find struct]

Packet: 0970
ID: PACKET_CH_MAKE_CHAR_NOT_STATS
Struct:

Code: Select all

struct PACKET_CH_MAKE_CHAR_NOT_STATS {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned char[0x18] name
  /* this+0x1a */ unsigned char CharNum
  /* this+0x1b */ short headPal
  /* this+0x1d */ short head
}
Packet: 0987
ID: PACKET_CA_LOGIN6
Struct:

Code: Select all

struct PACKET_CA_LOGIN6 {
  short PacketType
  unsigned long Version
  unsigned char[0x18] ID
  unsigned char[0x20] PasswdMD5
  unsigned char clienttype
}
Packet: 0987
ID: PACKET_CA_LOGIN_CHN
Struct:

Code: Select all

// TODO. Capture packet, find inner struct.
struct PACKET_CA_LOGIN_CHN {
  short PacketType
  short PacketLength
  unsigned long Version
  unsigned char[0x20] PasswdMD5
  unsigned char clienttype
}
Packet: 098B
ID: PACKET_AC_REQ_NEW_USER
Struct:

Code: Select all

struct PACKET_AC_REQ_NEW_USER {
  /* this+0x0 */ short PacketType
}
Packet: 098C
ID: PACKET_CA_ACK_NEW_USER
Struct:

Code: Select all

struct PACKET_CA_ACK_NEW_USER {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ short Sex
}
Packet: 098F
ID: PACKET_CH_DELETE_CHAR3_EXT
Struct:

Code: Select all

// TODO. No Inner Struct
struct PACKET_CH_DELETE_CHAR3_EXT {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ short PacketLength
  /* this+0x4 */ unsigned long GID
}
Packet: 099C
ID: PACKET_CH_REQ_CHARINFO_PER_PAGE
Struct:

Code: Select all

struct PACKET_CH_REQ_CHARINFO_PER_PAGE {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ unsigned long SeqNum
}
Packet: 099D
ID: PACKET_HC_ACK_CHARINFO_PER_PAGE
Struct:

Code: Select all

struct PACKET_HC_ACK_CHARINFO_PER_PAGE {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ short PacketLength
  /* this+0x4 */ struct CHARACTER_INFO charinfo[...]
}
Packet: 09A0
ID: PACKET_HC_CHARLIST_NOTIFY
Struct:

Code: Select all

struct PACKET_HC_CHARLIST_NOTIFY {
  /* this+0x0 */ short PacketType
  /* this+0x2 */ int TotalCnt
}
Packet: 09A1
ID: PACKET_CH_CHARLIST_REQ
Struct:

Code: Select all

struct PACKET_CH_CHARLIST_REQ {
  /* this+0x0 */ short PacketType
}
===============
Packet: Unknown
ID: PACKET_HC_QUEUE_ORDER
Struct:

Code: Select all

struct PACKET_HC_QUEUE_ORDER {
  short PacketType
  unsigned short PacketLength
  unsigned long m_AID
  unsigned long m_QueueOrder
}
================
Additional structs:

Code: Select all

struct CHARACTER_INFO {
  /* this+0x0 */ unsigned long GID
  /* this+0x4 */ int exp
  /* this+0x8 */ int money
  /* this+0xc */ int jobexp
  /* this+0x10 */ int joblevel
  /* this+0x14 */ int bodystate
  /* this+0x18 */ int healthstate
  /* this+0x1c */ int effectstate
  /* this+0x20 */ int virtue
  /* this+0x24 */ int honor
  /* this+0x28 */ short jobpoint
  /* this+0x2a */ int hp
  /* this+0x2e */ int maxhp
  /* this+0x32 */ short sp
  /* this+0x34 */ short maxsp
  /* this+0x36 */ short speed
  /* this+0x38 */ short job
  /* this+0x3a */ short head
  /* this+0x3c */ short weapon
  /* this+0x3e */ short level
  /* this+0x40 */ short sppoint
  /* this+0x42 */ short accessory
  /* this+0x44 */ short shield
  /* this+0x46 */ short accessory2
  /* this+0x48 */ short accessory3
  /* this+0x4a */ short headpalette
  /* this+0x4c */ short bodypalette
  /* this+0x4e */ unsigned char[0x18] name
  /* this+0x66 */ unsigned char Str
  /* this+0x67 */ unsigned char Agi
  /* this+0x68 */ unsigned char Vit
  /* this+0x69 */ unsigned char Int
  /* this+0x6a */ unsigned char Dex
  /* this+0x6b */ unsigned char Luk
  /* this+0x6c */ unsigned char CharNum
  /* this+0x6d */ unsigned char haircolor
  /* this+0x6e */ short bIsChangedCharName
  /* this+0x70 */ int nRobe
}

struct CHARACTER_INFO_NEO {
  /* this+0x0 */ unsigned long GID
  /* this+0x4 */ int exp
  /* this+0x8 */ int money
  /* this+0xc */ int jobexp
  /* this+0x10 */ int joblevel
  /* this+0x14 */ int bodystate
  /* this+0x18 */ int healthstate
  /* this+0x1c */ int effectstate
  /* this+0x20 */ int virtue
  /* this+0x24 */ int honor
  /* this+0x28 */ short jobpoint
  /* this+0x2a */ int hp
  /* this+0x2e */ int maxhp
  /* this+0x32 */ short sp
  /* this+0x34 */ short maxsp
  /* this+0x36 */ short speed
  /* this+0x38 */ short job
  /* this+0x3a */ short head
  /* this+0x3c */ short weapon
  /* this+0x3e */ short level
  /* this+0x40 */ short sppoint
  /* this+0x42 */ short accessory
  /* this+0x44 */ short shield
  /* this+0x46 */ short accessory2
  /* this+0x48 */ short accessory3
  /* this+0x4a */ short headpalette
  /* this+0x4c */ short bodypalette
  /* this+0x4e */ unsigned char[0x18] name
  /* this+0x66 */ unsigned char Str
  /* this+0x67 */ unsigned char Agi
  /* this+0x68 */ unsigned char Vit
  /* this+0x69 */ unsigned char Int
  /* this+0x6a */ unsigned char Dex
  /* this+0x6b */ unsigned char Luk
  /* this+0x6c */ unsigned char CharNum
  /* this+0x6d */ unsigned char haircolor
  /* this+0x6e */ int nRobe
}

struct CHARACTER_INFO_NEO_UNION {
  CHARACTER_INFO_NEO, offset = 0x0
  /* this+0x72 */ short bIsChangedCharName
}

struct CHARACTER_INFO_UNION {
  CHARACTER_INFO, offset = 0x0
  /* this+0x74 */ short bIsChangedCharName
}
Raider
The Kore Devil
The Kore Devil
Posts: 672
Joined: 22 Feb 2013, 03:40
Noob?: No
Location: The Netherlands

Re: unknown packet 09A0

#22 Post by Raider »

This is interesting! @klabMouse, could you explain what this is?
Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: unknown packet 09A0

#23 Post by Kaspy »

Raider wrote:This is interesting! @klabMouse, could you explain what this is?
It is the source of Aegis (emulator official Ragnarok).
These parts he reported that topical shows the structure of packets.

For example...
struct PACKET_CH_WAITING_LOGIN { -> Name of packet
/* this+0x0 */ short PacketType -> 2 bytes reserved for packet type and packed in a short
/* this+0x2 */ unsigned long AID -> 4 bytes reserved for AID and packed in a unsigned long
/* this+0x6 */ int AuthCode -> 4 bytes reserved for AuthCode and packed in a int
/* this+0xa */ unsigned long userLevel -> 4 bytes reserved for userLevel and packed in a unsigned long
/* this+0xe */ unsigned short clientType -> 4 bytes reserved for clientType and packed in a unsigned short
/* this+0x10 */ unsigned char Sex -> 4 bytes reserved for sex and packed in a unsigned char
}
Package names in Aegis has an interesting feature:
  • A -> Account
  • H -> Character
  • Z -> Zone (mapserver)
  • C -> Client.
In the example...
struct PACKET_CH_WAITING_LOGIN {
struct PACKET_Client Character_WAITING_LOGIN {
struct PACKET_Client -> Character_WAITING_LOGIN {
struct PACKET_Client send packet to Character Server_WAITING_LOGIN {
Get the idea?

You can also see examples of packet structure in open source emulators, as rAthena. Particularly, do it a lot and it helped a lot.



I recommend you read this:
http://perldoc.perl.org/functions/pack.html
http://perldoc.perl.org/functions/unpack.html
Image
Raider
The Kore Devil
The Kore Devil
Posts: 672
Joined: 22 Feb 2013, 03:40
Noob?: No
Location: The Netherlands

Re: unknown packet 09A0

#24 Post by Raider »

KeplerBR wrote:
Raider wrote:This is interesting! @klabMouse, could you explain what this is?
I recommend you read this:
http://perldoc.perl.org/functions/pack.html
http://perldoc.perl.org/functions/unpack.html
Thanks for the interesting information! I will take a look at the perldoc links you attached.
inv
Plain Yogurt
Plain Yogurt
Posts: 58
Joined: 18 Sep 2009, 01:28
Noob?: Yes

Re: unknown packet 09A0

#25 Post by inv »

heero wrote:I did a recheck of packet 09A0 and it seems like its a counter for sending packet 09A1 to the server. I can't be certain but can anyone who has access to iRO post packet 09A0 hex dump here.

here is my updated code for iRO.pm

Code: Select all

#########################################################################
#  OpenKore - Network subsystem
#  Copyright (c) 2006 OpenKore Team
#
#  This software is open source, licensed under the GNU General Public
#  License, version 2.
#  Basically, this means that you're allowed to modify and distribute
#  this software. However, if you distribute modified versions, you MUST
#  also distribute the source code.
#  See http://www.gnu.org/licenses/gpl.html for the full license.
#########################################################################
# iRO (International)
# Servertype overview: http://wiki.openkore.com/index.php/ServerType
package Network::Receive::iRO;

use strict;
use base qw(Network::Receive::ServerType0);

use Globals qw($messageSender %timeout);
use Log qw(debug);
use Misc qw(monsterName);
use Utils qw(timeOut);

use Time::HiRes qw(time);

sub new {
	my ($class) = @_;
	my $self = $class->SUPER::new(@_);
	my %packets = (
		'006D' => ['character_creation_successful', 'a4 V9 v V2 v14 Z24 C6 v2', [qw(charID exp zeny exp_job lv_job opt1 opt2 option stance manner points_free hp hp_max sp sp_max walk_speed type hair_style weapon lv points_skill lowhead shield tophead midhead hair_color clothes_color name str agi vit int dex luk slot renameflag)]],
		'0097' => ['private_message', 'v Z24 V Z*', [qw(len privMsgUser flag privMsg)]], # -1
		'082D' => ['received_characters_info', 'x2 C5 x20', [qw(normal_slot premium_slot billing_slot producible_slot valid_slot)]],
		'09A0' => ['unknown_09A0', 'V', [qw(count)]],
		'099D' => ['received_characters', 'x2 a*', [qw(charInfo)]],
	);

	foreach my $switch (keys %packets) {
		$self->{packet_list}{$switch} = $packets{$switch};
	}

	my %handlers = qw(
		received_characters 099D
		actor_exists 0856
		actor_connected 0857
		actor_moved 0858
		account_id 0283
	);
	$self->{packet_lut}{$_} = $handlers{$_} for keys %handlers;
	
	return $self;
}

sub received_characters_info {
	my ($self, $args) = @_;

	Scalar::Util::weaken(my $weak = $self);
	my $timeout = {timeout => 6, time => time};

	$self->{charSelectTimeoutHook} = Plugins::addHook('Network::serverConnect/special' => sub {
		if ($weak && timeOut($timeout)) {
			$weak->received_characters({charInfo => '', RAW_MSG_SIZE => 4});
		}
	});

	$self->{charSelectHook} = Plugins::addHook(charSelectScreen => sub {
		if ($weak) {
			Plugins::delHook(delete $weak->{charSelectTimeoutHook}) if $weak->{charSelectTimeoutHook};
		}
	});

	$timeout{charlogin}{time} = time;

	$self->received_characters($args);
}

sub unknown_09A0 {
	my ($self, $args) = @_;
	for (my $count = $args->{count}; $count >= 1; $count--) {
		$messageSender->sendToServer($messageSender->reconstruct({switch => 'unknown_09A1'}));
	} 
}

*parse_quest_update_mission_hunt = *Network::Receive::ServerType0::parse_quest_update_mission_hunt_v2;
*reconstruct_quest_update_mission_hunt = *Network::Receive::ServerType0::reconstruct_quest_update_mission_hunt_v2;

1;
can anyone test this and see if it works for iRO?

It's not working for iro