Oldschool Packet Protocols

packet protocol documentation

Learning and documenting the OSRS packet protocols became somewhat of a hobby of mine in the past few years. With there being 100 client to server packets and 85 server to client packets, it was not something I was able to do overnight. Through many trials and errors, I was able to identify all of the packets in both directions, and document a majority of them. The latest round of packets that I have identified and documented were from revision 184.

Some were easier than others, such as using a spell/component on a ground item:

{

message: "OpObjT",

type: "FIXED",

opcode: 26,

length: 13,

structure: {[

{

name: "movement_type",

type: "BYTE",

transform: "NEGATE",

},

{

name: "item_id",

sign: "UNSIGNED",

type: "SHORT",

transform: "LITTLE",

},

{

name: "component_slot",

type: "SHORT",

order: "LITTLE",

transform: "ADD",

},

{

name: "y",

{

name: "component_hash",

type: "INT",

},

{

name: "z",

type: "SHORT",

order: "LITTLE",

transform: "ADD",

},

]},

},

Others were more difficult to understand, such as the player & npc updating protocols.

The tricky part about keeping up with these between revisions is that the packet id's & structure are scrambled from one revision to the next. Not only is the order of the packet structure scrambled, but the endianness and data transformation(Add, Subtract, Negate) were also scrambled for each variable of the packet structure.