mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
Base xor off of inital seed
This commit is contained in:
parent
e0d0a3a74e
commit
8ff62cdc7f
1 changed files with 4 additions and 2 deletions
|
@ -26,6 +26,7 @@
|
||||||
#include "r_things.h" // skins
|
#include "r_things.h" // skins
|
||||||
#include "mserv.h" // ms_RoomId
|
#include "mserv.h" // ms_RoomId
|
||||||
#include "z_zone.h"
|
#include "z_zone.h"
|
||||||
|
#include "m_random.h" // P_GetInitSeed
|
||||||
|
|
||||||
#include "discord.h"
|
#include "discord.h"
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
|
@ -56,11 +57,12 @@ static char self_ip[IP_SIZE];
|
||||||
|
|
||||||
Simple XOR encryption/decryption. Not complex or
|
Simple XOR encryption/decryption. Not complex or
|
||||||
very secretive because we aren't sending anything
|
very secretive because we aren't sending anything
|
||||||
that isn't easily accessible via the Master Server anyway.
|
that isn't easily accessible via our Master Server anyway.
|
||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
static char *DRPC_XORIPString(const char *input)
|
static char *DRPC_XORIPString(const char *input)
|
||||||
{
|
{
|
||||||
const UINT8 xor[IP_SIZE] = {222, 106, 64, 251, 207, 16, 28, 78, 4, 118, 46, 76, 153, 45, 91, 100};
|
const UINT32 is = (P_GetInitSeed() % UINT8_MAX);
|
||||||
|
const UINT8 xor[IP_SIZE] = {is, is+106, is-64, is+251, is-207, is+16, is-28, is+78, is-4, is+118, is-46, is+76, is-153, is+45, is-91, is+100};
|
||||||
char *output = malloc(sizeof(char) * IP_SIZE);
|
char *output = malloc(sizeof(char) * IP_SIZE);
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue