Documentation

Documentation

Table of Contents

Packages

Application

Namespaces

Eolib
Protocol

Functions

interleave()  : void
Interleaves a sequence of bytes. When encrypting EO data, bytes are "woven" into each other.
deinterleave()  : void
Deinterleaves a sequence of bytes. This is the reverse of interleave.
flipMsb()  : void
Flips the most significant bits of each byte in a sequence of bytes.
swapMultiples()  : void
Swaps the order of contiguous bytes in a sequence that are divisible by a given multiple value.
serverVerificationHash()  : int
This hash function is used by the game client to verify communication with a genuine server during connection initialization.
_mod()  : int
Performs a modulus operation, considering negative adjustments.

Functions

interleave()

Interleaves a sequence of bytes. When encrypting EO data, bytes are "woven" into each other.

interleave(array<string|int, int> &$data) : void

This is an in-place operation.

Parameters
$data : array<string|int, int>

Reference to the data to interleave.

deinterleave()

Deinterleaves a sequence of bytes. This is the reverse of interleave.

deinterleave(array<string|int, int> &$data) : void

This is an in-place operation.

Parameters
$data : array<string|int, int>

Reference to the data to deinterleave.

flipMsb()

Flips the most significant bits of each byte in a sequence of bytes.

flipMsb(array<string|int, int> &$data) : void

Values 0 and 128 are not flipped.

Parameters
$data : array<string|int, int>

Reference to the data to flip MSB on.

swapMultiples()

Swaps the order of contiguous bytes in a sequence that are divisible by a given multiple value.

swapMultiples(array<string|int, int> &$data, int $multiple) : void
Parameters
$data : array<string|int, int>

Reference to the data to swap bytes in.

$multiple : int

The multiple value.

serverVerificationHash()

This hash function is used by the game client to verify communication with a genuine server during connection initialization.

serverVerificationHash(int $challenge) : int
Parameters
$challenge : int

The challenge value sent by the client. Should be no larger than 11,092,110.

Tags
remarks

The client sends an integer value to the server in the INIT_INIT client packet, where it is referred to as the challenge. The server hashes the value and sends the hash back in the INIT_INIT server packet. The client hashes the value and compares it to the hash sent by the server. If the hashes don't match, the client drops the connection.

warning

Oversized challenges may result in negative hash values, which cannot be represented properly in the EO protocol.

Return values
int

The hashed challenge value.

_mod()

Performs a modulus operation, considering negative adjustments.

_mod(int $a, int $b) : int
Parameters
$a : int

The dividend.

$b : int

The divisor.

Return values
int

The result of the modulus operation.

Search results