mirror of
https://github.com/diamante0018/MW3ServerFreezer.git
synced 2025-06-30 00:01:55 +00:00
maint: major write up improvement. No functional changes
This commit is contained in:
@ -20,28 +20,52 @@ game::dvar_t* cl_exploit;
|
||||
* https://stackoverflow.com/questions/58981714/how-do-i-change-the-value-of-a-single-byte-in-a-uint32-t-variable
|
||||
*/
|
||||
|
||||
/*
|
||||
* On the server side the msg_t structure processed as follows:
|
||||
* The first 4 bytes are read but not processed (offset 0)
|
||||
* The following 2 bytes are read but not processed (offset 4)
|
||||
* The following 1 byte is read and corresponds to the client_t.serverId (offset
|
||||
* 6) The following 4 bytes are read and corresponds to the
|
||||
* client_t.>messageAcknowledge (offset 7) The following 4 bytes are read and
|
||||
* corresponds to the client_t.reliableAcknowledge (offset 11)
|
||||
*/
|
||||
|
||||
/**
|
||||
* MSG_WriteLong stub which writes clc.serverMessageSequence.
|
||||
* Tekno gods will check in their Netchan_Process stub this byte is 0. If it is
|
||||
* not 0 it will trigger their patch.
|
||||
* @param[out] msg The message to write to.
|
||||
* @param[in] data The data to modify
|
||||
*/
|
||||
void write_message_sequence(game::msg_t* msg, int data) {
|
||||
if (msg->maxsize - static_cast<unsigned int>(msg->cursize) < sizeof(int)) {
|
||||
msg->overflowed = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (cl_exploit->current.enabled)
|
||||
if (cl_exploit->current.enabled) {
|
||||
data = (data & 0xFFFFFF00) | 0xAAu;
|
||||
}
|
||||
|
||||
auto* dest = reinterpret_cast<int*>(&msg->data[msg->cursize]);
|
||||
*dest = data;
|
||||
msg->cursize += sizeof(int);
|
||||
}
|
||||
|
||||
/**
|
||||
* MSG_WriteLong stub which writes clc.serverCommandSequence
|
||||
* @param[out] msg The message to write to.
|
||||
* @param[in] data The data to modify
|
||||
*/
|
||||
void write_command_sequence(game::msg_t* msg, int data) {
|
||||
if (msg->maxsize - static_cast<unsigned int>(msg->cursize) < sizeof(int)) {
|
||||
msg->overflowed = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (cl_exploit->current.enabled)
|
||||
if (cl_exploit->current.enabled) {
|
||||
data = (data & 0x00FFFFFF) | (0x80u << 24);
|
||||
}
|
||||
|
||||
auto* dest = reinterpret_cast<int*>(&msg->data[msg->cursize]);
|
||||
*dest = data;
|
||||
|
@ -30,7 +30,10 @@ void info_string::parse(std::string buffer) {
|
||||
i += 2) {
|
||||
const auto& key = key_values[i];
|
||||
const auto& value = key_values[i + 1];
|
||||
this->key_value_pairs_[key] = value;
|
||||
|
||||
if (!this->key_value_pairs_.contains(key)) {
|
||||
this->key_value_pairs_[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user