steam and demonware stuff

This commit is contained in:
quaK 2022-09-19 20:03:51 +03:00
parent ac1ac5f5bf
commit 5de758268a
95 changed files with 3155 additions and 627 deletions

View File

@ -5,15 +5,12 @@
#include <utils/thread.hpp>
#include "game/game.hpp"
#include <game/dvars.hpp>
#include "game/demonware/servers/lobby_server.hpp"
#include "game/demonware/servers/auth3_server.hpp"
#include "game/demonware/servers/stun_server.hpp"
#include "game/demonware/servers/umbrella_server.hpp"
#include "game/demonware/server_registry.hpp"
#include "console.hpp"
#define TCP_BLOCKING true
#define UDP_BLOCKING false
@ -21,7 +18,7 @@ namespace demonware
{
namespace
{
volatile bool exit_server;
std::atomic_bool exit_server;
std::thread server_thread;
utils::concurrency::container<std::unordered_map<SOCKET, bool>> blocking_sockets;
utils::concurrency::container<std::unordered_map<SOCKET, tcp_server*>> socket_map;
@ -121,7 +118,7 @@ namespace demonware
int getaddrinfo_stub(const char* name, const char* service,
const addrinfo* hints, addrinfo** res)
{
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[ network ]: [getaddrinfo]: \"%s\" \"%s\"\n", name, service);
#endif
@ -172,8 +169,6 @@ namespace demonware
{
auto* server = find_server(s);
printf("getpeername\n");
if (server)
{
auto in_addr = reinterpret_cast<sockaddr_in*>(addr);
@ -206,7 +201,7 @@ namespace demonware
hostent* gethostbyname_stub(const char* name)
{
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[ network ]: [gethostbyname]: \"%s\"\n", name);
#endif
@ -264,8 +259,6 @@ namespace demonware
{
auto* server = find_server(s);
printf("send: %s\n", buf);
if (server)
{
server->handle_input(buf, len);
@ -279,8 +272,6 @@ namespace demonware
{
auto* server = find_server(s);
printf("recv: %s\n", buf);
if (server)
{
if (server->pending_data())
@ -303,8 +294,6 @@ namespace demonware
const auto* in_addr = reinterpret_cast<const sockaddr_in*>(to);
auto* server = udp_servers.find(in_addr->sin_addr.s_addr);
printf("sendto: %s\n", buf);
if (server)
{
server->handle_input(buf, len, { s, to, tolen });
@ -317,8 +306,6 @@ namespace demonware
int recvfrom_stub(const SOCKET s, char* buf, const int len, const int flags, struct sockaddr* from,
int* fromlen)
{
//printf("recvfrom: %s\n", buf);
// Not supported yet
if (is_socket_blocking(s, UDP_BLOCKING))
{
@ -437,7 +424,7 @@ namespace demonware
}
}
void bd_logger_stub(int type, const char* const /*channelName*/, const char* /*fileLoc*/, const char* const /*file*/,
void bd_logger_stub(int /*type*/, const char* const /*channelName*/, const char* /*fileLoc*/, const char* const /*file*/,
const char* const function, const unsigned int /*line*/, const char* const msg, ...)
{
char buffer[2048];
@ -446,78 +433,16 @@ namespace demonware
va_start(ap, msg);
vsnprintf_s(buffer, sizeof(buffer), _TRUNCATE, msg, ap);
console::print(type, "%s: %s\n", function, buffer);
#ifdef DW_DEBUG
printf("%s: %s\n", function, buffer);
#endif
va_end(ap);
}
/*#ifdef DEBUG
void a(unsigned int n)
bool return_true()
{
printf("bdAuth: Auth task failed with HTTP code [%u]\n", n);
}
void b(unsigned int n)
{
printf("bdAuth: Decoded client ticket of unexpected size [%u]\n", n);
}
void c(unsigned int n)
{
printf("bdAuth: Decoded server ticket of unexpected size [%u]\n", n);
}
void d()
{
printf("bdAuth: Auth ticket magic number mismatch\n");
}
void e()
{
printf("bdAuth: Cross Authentication completed\n");
}
void f()
{
printf("bdAuth: Auth task reply contains invalid data / format\n");
}
void g(unsigned int n)
{
printf("bdAuth: Auth task returned with error code [%u]\n", n);
}
void h(unsigned int n)
{
printf("bdAuth: Invalid or No Task ID [%u] in Auth reply\n", n);
}
void i()
{
printf("bdAuth: Received reply from DemonWare Auth server\n");
}
void l()
{
printf("bdAuth: Unknown error\n");
}
#endif*/
utils::hook::detour handle_auth_reply_hook;
bool handle_auth_reply_stub(void* a1, void* a2, void* a3)
{
// Skip bdAuth::validateResponseSignature
//utils::hook::set(0x7D4AB0_b, 0xC301B0);
// Skip bdAuth::processPlatformData
//utils::hook::set(0x7D55C0_b, 0xC301B0);
//return handle_auth_reply_hook.invoke<bool>(a1, a2, a3);
}
void request_start_match_stub()
{
//const auto* args = "StartServer";
//utils::hook::invoke<void>(0x1E35B0_b, 0, &args);
return true;
}
}
@ -576,7 +501,7 @@ namespace demonware
void post_unpack() override
{
#ifdef DEBUG
#if defined(DEBUG) and defined(DW_DEBUG)
utils::hook::jump(0x1285040_b, bd_logger_stub, true);
#endif
@ -584,67 +509,19 @@ namespace demonware
utils::hook::set<uint8_t>(0xB7C6CB1_b, 0xAF); // CURLOPT_SSL_VERIFYHOST
utils::hook::set<uint8_t>(0x15E4650_b, 0x0); // HTTPS -> HTTP
// umbrella dev
const char* umbrella_dev = "http://dev.umbrella.demonware.net";
std::memset(reinterpret_cast<void*>(0x15E8010_b), 0, strlen(umbrella_dev) + 1);
std::memcpy(reinterpret_cast<void*>(0x15E8010_b),
umbrella_dev, strlen(umbrella_dev));
utils::hook::copy_string(0x15E8010_b, "http://dev.umbrella.demonware.net");
utils::hook::copy_string(0x15E8038_b, "http://cert.umbrella.demonware.net");
utils::hook::copy_string(0x15E8060_b, "http://prod.umbrella.demonware.net");
utils::hook::copy_string(0x15E8418_b, "http://dev.uno.demonware.net/v1.0");
utils::hook::copy_string(0x15E8440_b, "http://cert.uno.demonware.net/v1.0");
utils::hook::copy_string(0x15E8468_b, "http://prod.uno.demonware.net/v1.0");
utils::hook::copy_string(0x15E3600_b, "http://%s:%d/auth/");
// umbrella cert
const char* umbrella_cert = "http://cert.umbrella.demonware.net";
std::memset(reinterpret_cast<void*>(0x15E8038_b), 0, strlen(umbrella_cert) + 1);
std::memcpy(reinterpret_cast<void*>(0x15E8038_b),
umbrella_cert, strlen(umbrella_cert));
// umbrella prod
const char* umbrella_prod = "http://prod.umbrella.demonware.net";
std::memset(reinterpret_cast<void*>(0x15E8060_b), 0, strlen(umbrella_prod) + 1);
std::memcpy(reinterpret_cast<void*>(0x15E8060_b),
umbrella_prod, strlen(umbrella_prod));
// uno dev
const char* uno_dev = "http://dev.uno.demonware.net/v1.0";
std::memset(reinterpret_cast<void*>(0x15E8418_b), 0, strlen(uno_dev) + 1);
std::memcpy(reinterpret_cast<void*>(0x15E8418_b),
uno_dev, strlen(uno_dev));
// uno cert
const char* uno_cert = "http://cert.uno.demonware.net/v1.0";
std::memset(reinterpret_cast<void*>(0x15E8440_b), 0, strlen(uno_cert) + 1);
std::memcpy(reinterpret_cast<void*>(0x15E8440_b),
uno_cert, strlen(uno_cert));
// uno prod
const char* uno = "http://prod.uno.demonware.net/v1.0";
std::memset(reinterpret_cast<void*>(0x15E8468_b), 0, strlen(uno) + 1);
std::memcpy(reinterpret_cast<void*>(0x15E8468_b),
uno, strlen(uno));
// auth
const char* auth = "http://%s:%d/auth/";
std::memset(reinterpret_cast<void*>(0x15E3600_b), 0, strlen(auth) + 1);
std::memcpy(reinterpret_cast<void*>(0x15E3600_b), auth, strlen(auth));
// utils::hook::set<uint8_t>(0x19F8C0_b, 0xC3); // SV_SendMatchData, not sure
//utils::hook::nop(0x19BB67_b, 5); // LiveStorage_SendMatchDataComplete
//utils::hook::set<uint8_t>(0x1A3340_b, 0xC3); // Live_CheckForFullDisconnect
// Remove some while loop that freezes the rendering for a few secs while connecting
//utils::hook::nop(0x625555_b, 5);
//handle_auth_reply_hook.create(0x7AC600_b, handle_auth_reply_stub);
// Skip update check in Live_SyncOnlineDataFlags
//utils::hook::set(0x47A6D0_b, 0xC301B0);
// Remove update failed popup
//utils::hook::set(0x47B2B0_b, 0xC301B0);
// xpartygo -> just start the match
//utils::hook::jump(0x355B80_b, request_start_match_stub, true);
//utils::hook::set(0x396AD0_b, 0xC301B0); // DB_IsZoneLoaded("ffotd")
//utils::hook::set(0x4DD600_b, 0xC300B0); // dont use ffotd
//utils::hook::set(0x4DD5B0_b, 0xC300B0); // dont dl ffotd
// Skip bdAuth::validateResponseSignature
utils::hook::call(0x1245440_b, return_true); // bdRSAKey::importKey
utils::hook::call(0x1245472_b, return_true); // bdRSAKey::verifySignatureSHA256
// Skip bdAuth::processPlatformData
utils::hook::call(0x124863A_b, return_true); // bdExtendedAuthInfo::setData
}
void pre_destroy() override
@ -658,4 +535,4 @@ namespace demonware
};
}
//REGISTER_COMPONENT(demonware::component)
//REGISTER_COMPONENT(demonware::component)

View File

@ -3,18 +3,24 @@
namespace demonware
{
bool byte_buffer::read_byte(unsigned char* output)
{
if (!this->read_data_type(3)) return false;
return this->read(1, output);
}
bool byte_buffer::read_bool(bool* output)
{
if (!this->read_data_type(1)) return false;
return this->read(1, output);
}
bool byte_buffer::read_byte(char* output)
{
if (!this->read_data_type(2)) return false;
return this->read(1, output);
}
bool byte_buffer::read_ubyte(unsigned char* output)
{
if (!this->read_data_type(3)) return false;
return this->read(1, output);
}
bool byte_buffer::read_int16(short* output)
{
if (!this->read_data_type(5)) return false;
@ -152,18 +158,24 @@ namespace demonware
return true;
}
bool byte_buffer::write_byte(char data)
{
this->write_data_type(3);
return this->write(1, &data);
}
bool byte_buffer::write_bool(bool data)
{
this->write_data_type(1);
return this->write(1, &data);
}
bool byte_buffer::write_byte(char data)
{
this->write_data_type(2);
return this->write(1, &data);
}
bool byte_buffer::write_ubyte(unsigned char data)
{
this->write_data_type(3);
return this->write(1, &data);
}
bool byte_buffer::write_int16(short data)
{
this->write_data_type(5);
@ -242,7 +254,7 @@ namespace demonware
const auto using_types = this->is_using_data_types();
this->set_use_data_types(false);
auto result = this->write_byte(type + 100);
auto result = this->write_ubyte(type + 100);
this->set_use_data_types(true);
result &= this->write_uint32(element_count * element_size);

View File

@ -11,8 +11,9 @@ namespace demonware
{
}
bool read_byte(unsigned char* output);
bool read_bool(bool* output);
bool read_byte(char* output);
bool read_ubyte(unsigned char* output);
bool read_int16(short* output);
bool read_uint16(unsigned short* output);
bool read_int32(int* output);
@ -30,8 +31,9 @@ namespace demonware
bool read_array_header(unsigned char expected, unsigned int* element_count,
unsigned int* element_size = nullptr);
bool write_byte(char data);
bool write_bool(bool data);
bool write_byte(char data);
bool write_ubyte(unsigned char data);
bool write_int16(short data);
bool write_uint16(unsigned short data);
bool write_int32(int data);

View File

@ -89,7 +89,7 @@ namespace demonware
std::memcpy(data.m_dec_key, &out_3[40], 16);
std::memcpy(data.m_enc_key, &out_3[56], 16);
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW] Response id: %s\n", utils::string::dump_hex(std::string(&out_2[8], 8)).data());
printf("[DW] Hash verify: %s\n", utils::string::dump_hex(std::string(&out_3[20], 20)).data());
printf("[DW] AES dec key: %s\n", utils::string::dump_hex(std::string(&out_3[40], 16)).data());

View File

@ -14,7 +14,7 @@ namespace demonware
result.write_int32(static_cast<int>(this->buffer_.size()) + 2);
result.write_bool(false);
result.write_byte(this->type());
result.write_ubyte(this->type());
result.write(this->buffer_);
return result.get_buffer();
@ -29,7 +29,7 @@ namespace demonware
enc_buffer.set_use_data_types(false);
enc_buffer.write_uint32(static_cast<unsigned int>(this->buffer_.size())); // service data size CHECKTHIS!!
enc_buffer.write_byte(this->type()); // TASK_REPLY type
enc_buffer.write_ubyte(this->type()); // TASK_REPLY type
enc_buffer.write(this->buffer_); // service data
auto aligned_data = enc_buffer.get_buffer();
@ -51,8 +51,8 @@ namespace demonware
response.set_use_data_types(false);
response.write_int32(30 + static_cast<int>(enc_data.size()));
response.write_byte(static_cast<char>(0xAB));
response.write_byte(static_cast<char>(0x85));
response.write_ubyte(static_cast<unsigned char>(0xAB));
response.write_ubyte(static_cast<unsigned char>(0x85));
response.write_int32(msg_count);
response.write(16, seed.data());
response.write(enc_data);

View File

@ -119,7 +119,7 @@ namespace demonware
byte_buffer buffer;
buffer.write_uint64(transaction_id);
buffer.write_uint32(this->error_);
buffer.write_byte(this->type_);
buffer.write_ubyte(this->type_);
if (!this->error_)
{

View File

@ -38,7 +38,7 @@ namespace demonware
{
if (packet.starts_with("POST /auth/"))
{
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [auth]: user requested authentication.\n");
#endif
return;
@ -81,7 +81,7 @@ namespace demonware
}
}
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [auth]: authenticating user %s\n", token.data() + 64);
#endif
@ -138,22 +138,32 @@ namespace demonware
doc.AddMember("client_id", "", doc.GetAllocator());
doc.AddMember("account_type", "steam", doc.GetAllocator());
doc.AddMember("crossplay_enabled", false, doc.GetAllocator());
doc.AddMember("loginqueue_eanbled", false, doc.GetAllocator());
doc.AddMember("loginqueue_enabled", false, doc.GetAllocator());
rapidjson::Value value{};
doc.AddMember("lsg_endpoint", value, doc.GetAllocator());
std::string extended_data = ""; // maybe figure out what this is supposed to be
std::string extra_data = utils::string::va("{\"extended_data\": \"%s\"}", extended_data.data());
// extra data
doc.AddMember("extra_data", rapidjson::StringRef(extra_data.data(), extra_data.size()), doc.GetAllocator());
doc.AddMember("identity", rapidjson::StringRef(identity.data(), identity.size()), doc.GetAllocator());
rapidjson::StringBuffer buffer{};
rapidjson::Writer<rapidjson::StringBuffer, rapidjson::Document::EncodingType, rapidjson::ASCII<>>
writer(buffer);
doc.Accept(writer);
std::string x_signature = "1337"; // maybe figure out how to compute this (patched in demonware.cpp)
// http stuff
std::string result;
result.append("HTTP/1.1 200 OK\r\n");
result.append("Server: TornadoServer/4.5.3\r\n");
result.append("Server: TornadoServer/6.0.3\r\n");
result.append("Content-Type: application/json\r\n");
result.append(utils::string::va("Date: %s GMT\r\n", date));
result.append(utils::string::va("X-Signature: %s\r\n", x_signature.data()));
result.append(utils::string::va("Content-Length: %d\r\n\r\n", buffer.GetLength()));
result.append(buffer.GetString(), buffer.GetLength());
@ -161,7 +171,7 @@ namespace demonware
this->send_reply(&reply);
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [auth]: user successfully authenticated.\n");
#endif
}

View File

@ -13,22 +13,29 @@ namespace demonware
this->register_service<bdAnticheat>();
this->register_service<bdBandwidthTest>();
this->register_service<bdContentStreaming>();
this->register_service<bdCounter>();
this->register_service<bdDML>();
this->register_service<bdEventLog>();
this->register_service<bdGroups>();
this->register_service<bdGroup>();
this->register_service<bdTeams>();
this->register_service<bdStats>();
this->register_service<bdStats2>();
this->register_service<bdStats3>();
this->register_service<bdStorage>();
this->register_service<bdTitleUtilities>();
this->register_service<bdProfiles>();
this->register_service<bdRichPresence>();
this->register_service<bdFacebook>();
this->register_service<bdUNK63>();
this->register_service<bdUNK80>();
this->register_service<bdUNK95>();
this->register_service<bdUserGroups>();
this->register_service<bdMarketplace>();
this->register_service<bdLeague>();
this->register_service<bdLeague2>();
this->register_service<bdPublisherVariables>();
this->register_service<bdPresence>();
this->register_service<bdMarketingComms>();
this->register_service<bdMatchMaking2>();
this->register_service<bdMarketing>();
this->register_service<bdMatchMaking>();
this->register_service<bdReward>();
};
void lobby_server::send_reply(reply* data)
@ -58,7 +65,7 @@ namespace demonware
}
else if (size == 0xC8)
{
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [lobby]: received client_header_ack.\n");
#endif
@ -74,7 +81,7 @@ namespace demonware
raw_reply reply(packet_2);
this->send_reply(&reply);
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [lobby]: sending server_header_ack.\n");
#endif
return;
@ -83,15 +90,15 @@ namespace demonware
if (buffer.size() < size_t(size)) return;
uint8_t check_ab;
buffer.read_byte(&check_ab);
buffer.read_ubyte(&check_ab);
if (check_ab == 0xAB)
{
uint8_t type;
buffer.read_byte(&type);
buffer.read_ubyte(&type);
if (type == 0x82)
{
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [lobby]: received client_auth.\n");
#endif
std::string packet_3(packet.data(), packet.size() - 8); // this 8 are client hash check?
@ -106,7 +113,7 @@ namespace demonware
raw_reply reply(response);
this->send_reply(&reply);
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [lobby]: sending server_auth_done.\n");
#endif
return;
@ -135,10 +142,10 @@ namespace demonware
serv.read_uint32(&serv_size);
uint8_t magic; // 0x86
serv.read_byte(&magic);
serv.read_ubyte(&magic);
uint8_t service_id;
serv.read_byte(&service_id);
serv.read_ubyte(&service_id);
this->call_service(service_id, serv.get_remaining());
@ -170,7 +177,7 @@ namespace demonware
// return no error
byte_buffer buffer(data);
uint8_t task_id;
buffer.read_byte(&task_id);
buffer.read_ubyte(&task_id);
this->create_reply(task_id)->send();
}

View File

@ -11,9 +11,9 @@ namespace demonware
byte_buffer buffer(packet);
buffer.set_use_data_types(false);
buffer.read_byte(&type);
buffer.read_byte(&version);
buffer.read_byte(&padding);
buffer.read_ubyte(&type);
buffer.read_ubyte(&version);
buffer.read_ubyte(&padding);
switch (type)
{
@ -34,9 +34,9 @@ namespace demonware
byte_buffer buffer;
buffer.set_use_data_types(false);
buffer.write_byte(31); // type
buffer.write_byte(2); // version
buffer.write_byte(0); // version
buffer.write_ubyte(31); // type
buffer.write_ubyte(2); // version
buffer.write_ubyte(0); // version
buffer.write_uint32(ip); // external ip
buffer.write_uint16(3074); // port
@ -49,9 +49,9 @@ namespace demonware
byte_buffer buffer;
buffer.set_use_data_types(false);
buffer.write_byte(21); // type
buffer.write_byte(2); // version
buffer.write_byte(0); // version
buffer.write_ubyte(21); // type
buffer.write_ubyte(2); // version
buffer.write_ubyte(0); // version
buffer.write_uint32(ip); // external ip
buffer.write_uint16(3074); // port
buffer.write_uint32(this->get_address()); // server ip

View File

@ -45,13 +45,13 @@ namespace demonware
byte_buffer buffer(data);
buffer.read_byte(&this->task_id_);
buffer.read_ubyte(&this->task_id_);
const auto& it = this->tasks_.find(this->task_id_);
if (it != this->tasks_.end())
{
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW] %s: executing task '%d'\n", name_.data(), this->task_id_);
#endif

View File

@ -7,30 +7,35 @@
#include "service.hpp"
#include "servers/service_server.hpp"
//#include "services/bdTeams.hpp" // 3
#include "services/bdTeams.hpp" // 3
#include "services/bdStats.hpp" // 4
//#include "services/bdMessaging.hpp" // 6
#include "services/bdProfiles.hpp" // 8
#include "services/bdStorage.hpp" // 10
#include "services/bdTitleUtilities.hpp" // 12
#include "services/bdBandwidthTest.hpp" // 18
//#include "services/bdMatchMaking.hpp" // 21
#include "services/bdCounters.hpp" // 23
#include "services/bdStats2.hpp" // 19
#include "services/bdCounter.hpp" // 23
#include "services/bdDML.hpp" // 27
#include "services/bdGroups.hpp" // 28
#include "services/bdGroup.hpp" // 28
//#include "services/bdCMail.hpp" // 29
#include "services/bdFacebook.hpp" // 36
#include "services/bdAnticheat.hpp" // 38
#include "services/bdContentStreaming.hpp" // 50
//#include "services/bdTags.hpp" // 52
#include "services/bdUNK63.hpp" // 63
#include "services/bdUserGroups.hpp" // 65
#include "services/bdEventLog.hpp" // 67
#include "services/bdRichPresence.hpp" // 68
//#include "services/bdTitleUtilities2.hpp" // 72
#include "services/bdUNK80.hpp"
#include "services/bdUNK95.hpp"
//#include "services/bdTencent.hpp" // 71
//#include "services/bdCodOnlineTeams.hpp" // 72
#include "services/bdMarketplace.hpp" // 80
#include "services/bdLeague.hpp" // 81
#include "services/bdLeague2.hpp" // 82
#include "services/bdStats3.hpp" // 91
#include "services/bdPublisherVariables.hpp"// 95
// AccountLinking // 86
#include "services/bdPresence.hpp" //103
#include "services/bdMarketingComms.hpp" //104
#include "services/bdMatchMaking2.hpp" //138
#include "services/bdMarketing.hpp" //139
#include "services/bdMatchMaking.hpp" //138
#include "services/bdReward.hpp" //139

View File

@ -5,18 +5,34 @@ namespace demonware
{
bdAnticheat::bdAnticheat() : service(38, "bdAnticheat")
{
this->register_task(2, &bdAnticheat::unk2);
this->register_task(4, &bdAnticheat::report_console_details);
this->register_task(2, &bdAnticheat::answerChallenges);
this->register_task(3, &bdAnticheat::reportConsoleID);
this->register_task(4, &bdAnticheat::reportConsoleDetails);
this->register_task(5, &bdAnticheat::answerTOTPChallenge);
}
void bdAnticheat::unk2(service_server* server, byte_buffer* /*buffer*/) const
void bdAnticheat::answerChallenges(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO: Read data as soon as needed
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdAnticheat::report_console_details(service_server* server, byte_buffer* /*buffer*/) const
void bdAnticheat::reportConsoleID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO: Read data as soon as needed
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdAnticheat::reportConsoleDetails(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO: Read data as soon as needed
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdAnticheat::answerTOTPChallenge(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO: Read data as soon as needed
auto reply = server->create_reply(this->task_id());

View File

@ -8,7 +8,9 @@ namespace demonware
bdAnticheat();
private:
void unk2(service_server* server, byte_buffer* buffer) const;
void report_console_details(service_server* server, byte_buffer* buffer) const;
void answerChallenges(service_server* server, byte_buffer* buffer) const;
void reportConsoleID(service_server* server, byte_buffer* buffer) const;
void reportConsoleDetails(service_server* server, byte_buffer* buffer) const;
void answerTOTPChallenge(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,25 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdCounter::bdCounter() : service(23, "bdCounter")
{
this->register_task(1, &bdCounter::incrementCounters);
this->register_task(2, &bdCounter::getCounterTotals);
}
void bdCounter::incrementCounters(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdCounter::getCounterTotals(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,14 @@
#pragma once
namespace demonware
{
class bdCounter final : public service
{
public:
bdCounter();
private:
void incrementCounters(service_server* server, byte_buffer* buffer) const;
void getCounterTotals(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -1,25 +0,0 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdCounters::bdCounters() : service(23, "bdCounters")
{
this->register_task(1, &bdCounters::unk1);
this->register_task(2, &bdCounters::unk2);
}
void bdCounters::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdCounters::unk2(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -1,14 +0,0 @@
#pragma once
namespace demonware
{
class bdCounters final : public service
{
public:
bdCounters();
private:
void unk1(service_server* server, byte_buffer* buffer) const;
void unk2(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -5,10 +5,20 @@ namespace demonware
{
bdDML::bdDML() : service(27, "bdDML")
{
this->register_task(2, &bdDML::get_user_raw_data);
this->register_task(1, &bdDML::recordIP);
this->register_task(2, &bdDML::getUserData);
this->register_task(3, &bdDML::getUserHierarchicalData);
this->register_task(4, &bdDML::getUsersLastLogonData);
}
void bdDML::get_user_raw_data(service_server* server, byte_buffer* /*buffer*/) const
void bdDML::recordIP(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdDML::getUserData(service_server* server, byte_buffer* /*buffer*/) const
{
auto result = new bdDMLRawData;
result->country_code = "US";
@ -25,4 +35,18 @@ namespace demonware
reply->add(result);
reply->send();
}
void bdDML::getUserHierarchicalData(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdDML::getUsersLastLogonData(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -8,6 +8,9 @@ namespace demonware
bdDML();
private:
void get_user_raw_data(service_server* server, byte_buffer* buffer) const;
void recordIP(service_server* server, byte_buffer* buffer) const;
void getUserData(service_server* server, byte_buffer* buffer) const;
void getUserHierarchicalData(service_server* server, byte_buffer* buffer) const;
void getUsersLastLogonData(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -5,10 +5,42 @@ namespace demonware
{
bdEventLog::bdEventLog() : service(67, "bdEventLog")
{
this->register_task(6, &bdEventLog::unk6);
this->register_task(1, &bdEventLog::recordEvent);
this->register_task(2, &bdEventLog::recordEventBin);
this->register_task(3, &bdEventLog::recordEvents);
this->register_task(4, &bdEventLog::recordEventsBin);
this->register_task(6, &bdEventLog::initializeFiltering);
}
void bdEventLog::unk6(service_server* server, byte_buffer* /*buffer*/) const
void bdEventLog::recordEvent(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdEventLog::recordEventBin(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdEventLog::recordEvents(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdEventLog::recordEventsBin(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdEventLog::initializeFiltering(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -8,6 +8,10 @@ namespace demonware
bdEventLog();
private:
void unk6(service_server* server, byte_buffer* buffer) const;
void recordEvent(service_server* server, byte_buffer* buffer) const;
void recordEventBin(service_server* server, byte_buffer* buffer) const;
void recordEvents(service_server* server, byte_buffer* buffer) const;
void recordEventsBin(service_server* server, byte_buffer* buffer) const;
void initializeFiltering(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -5,34 +5,106 @@ namespace demonware
{
bdFacebook::bdFacebook() : service(36, "bdFacebook")
{
this->register_task(1, &bdFacebook::unk1);
this->register_task(3, &bdFacebook::unk3);
this->register_task(7, &bdFacebook::unk7);
this->register_task(8, &bdFacebook::unk8);
this->register_task(1, &bdFacebook::registerAccount);
this->register_task(2, &bdFacebook::post);
this->register_task(3, &bdFacebook::unregisterAccount);
this->register_task(5, &bdFacebook::isRegistered);
this->register_task(6, &bdFacebook::getInfo);
this->register_task(7, &bdFacebook::getRegisteredAccounts);
this->register_task(8, &bdFacebook::getFriends);
this->register_task(9, &bdFacebook::getProfilePictures);
this->register_task(10, &bdFacebook::uploadPhoto);
this->register_task(11, &bdFacebook::registerToken);
this->register_task(12, &bdFacebook::uploadVideo);
this->register_task(13, &bdFacebook::getFriendsByID);
this->register_task(14, &bdFacebook::setLikeStatus);
}
void bdFacebook::unk1(service_server* server, byte_buffer* /*buffer*/) const
void bdFacebook::registerAccount(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::unk3(service_server* server, byte_buffer* /*buffer*/) const
void bdFacebook::post(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::unk7(service_server* server, byte_buffer* /*buffer*/) const
void bdFacebook::unregisterAccount(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::unk8(service_server* server, byte_buffer* /*buffer*/) const
void bdFacebook::isRegistered(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::getInfo(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::getRegisteredAccounts(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::getFriends(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::getProfilePictures(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::uploadPhoto(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::registerToken(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::uploadVideo(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::getFriendsByID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdFacebook::setLikeStatus(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -8,9 +8,18 @@ namespace demonware
bdFacebook();
private:
void unk1(service_server* server, byte_buffer* buffer) const;
void unk3(service_server* server, byte_buffer* buffer) const;
void unk7(service_server* server, byte_buffer* buffer) const;
void unk8(service_server* server, byte_buffer* buffer) const;
void registerAccount(service_server* server, byte_buffer* buffer) const;
void post(service_server* server, byte_buffer* buffer) const;
void unregisterAccount(service_server* server, byte_buffer* buffer) const;
void isRegistered(service_server* server, byte_buffer* buffer) const;
void getInfo(service_server* server, byte_buffer* buffer) const;
void getRegisteredAccounts(service_server* server, byte_buffer* buffer) const;
void getFriends(service_server* server, byte_buffer* buffer) const;
void getProfilePictures(service_server* server, byte_buffer* buffer) const;
void uploadPhoto(service_server* server, byte_buffer* buffer) const;
void registerToken(service_server* server, byte_buffer* buffer) const;
void uploadVideo(service_server* server, byte_buffer* buffer) const;
void getFriendsByID(service_server* server, byte_buffer* buffer) const;
void setLikeStatus(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,41 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdGroup::bdGroup() : service(28, "bdGroup")
{
this->register_task(1, &bdGroup::setGroups);
this->register_task(2, &bdGroup::setGroupsForEntity);
this->register_task(3, &bdGroup::getEntityGroups);
this->register_task(4, &bdGroup::getGroupCounts);
}
void bdGroup::setGroups(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdGroup::setGroupsForEntity(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdGroup::getEntityGroups(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdGroup::getGroupCounts(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,16 @@
#pragma once
namespace demonware
{
class bdGroup final : public service
{
public:
bdGroup();
private:
void setGroups(service_server* server, byte_buffer* buffer) const;
void setGroupsForEntity(service_server* server, byte_buffer* buffer) const;
void getEntityGroups(service_server* server, byte_buffer* buffer) const;
void getGroupCounts(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -1,25 +0,0 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdGroups::bdGroups() : service(28, "bdGroup")
{
this->register_task(1, &bdGroups::set_groups);
this->register_task(4, &bdGroups::unk4);
}
void bdGroups::set_groups(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdGroups::unk4(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -1,14 +0,0 @@
#pragma once
namespace demonware
{
class bdGroups final : public service
{
public:
bdGroups();
private:
void set_groups(service_server* server, byte_buffer* buffer) const;
void unk4(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,97 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdLeague::bdLeague() : service(81, "bdLeague")
{
this->register_task(1, &bdLeague::getTeamID);
this->register_task(2, &bdLeague::getTeamIDsForUser);
this->register_task(3, &bdLeague::getTeamSubdivisions);
this->register_task(4, &bdLeague::setTeamName);
this->register_task(5, &bdLeague::setTeamIcon);
this->register_task(6, &bdLeague::getTeamInfos);
this->register_task(7, &bdLeague::getTeamLeaguesAndSubdivisions);
this->register_task(8, &bdLeague::getTeamMemberInfos);
this->register_task(10, &bdLeague::incrementGamesPlayedCount);
this->register_task(20, &bdLeague::getSubdivisionInfos);
this->register_task(21, &bdLeague::getTeamSubdivisionHistory);
}
void bdLeague::getTeamID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::getTeamIDsForUser(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::getTeamSubdivisions(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::setTeamName(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::setTeamIcon(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::getTeamInfos(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::getTeamLeaguesAndSubdivisions(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::getTeamMemberInfos(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::incrementGamesPlayedCount(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::getSubdivisionInfos(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague::getTeamSubdivisionHistory(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,23 @@
#pragma once
namespace demonware
{
class bdLeague final : public service
{
public:
bdLeague();
private:
void getTeamID(service_server* server, byte_buffer* buffer) const;
void getTeamIDsForUser(service_server* server, byte_buffer* buffer) const;
void getTeamSubdivisions(service_server* server, byte_buffer* buffer) const;
void setTeamName(service_server* server, byte_buffer* buffer) const;
void setTeamIcon(service_server* server, byte_buffer* buffer) const;
void getTeamInfos(service_server* server, byte_buffer* buffer) const;
void getTeamLeaguesAndSubdivisions(service_server* server, byte_buffer* buffer) const;
void getTeamMemberInfos(service_server* server, byte_buffer* buffer) const;
void incrementGamesPlayedCount(service_server* server, byte_buffer* buffer) const;
void getSubdivisionInfos(service_server* server, byte_buffer* buffer) const;
void getTeamSubdivisionHistory(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,41 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdLeague2::bdLeague2() : service(82, "bdLeague")
{
this->register_task(1, &bdLeague2::writeStats);
this->register_task(2, &bdLeague2::readStatsByTeamID);
this->register_task(3, &bdLeague2::readStatsByRank);
this->register_task(4, &bdLeague2::readStatsByPivot);
}
void bdLeague2::writeStats(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague2::readStatsByTeamID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague2::readStatsByRank(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdLeague2::readStatsByPivot(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,16 @@
#pragma once
namespace demonware
{
class bdLeague2 final : public service
{
public:
bdLeague2();
private:
void writeStats(service_server* server, byte_buffer* buffer) const;
void readStatsByTeamID(service_server* server, byte_buffer* buffer) const;
void readStatsByRank(service_server* server, byte_buffer* buffer) const;
void readStatsByPivot(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -1,25 +0,0 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdMarketing::bdMarketing() : service(139, "bdMarketing")
{
this->register_task(2, &bdMarketing::unk2);
this->register_task(3, &bdMarketing::unk3);
}
void bdMarketing::unk2(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketing::unk3(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -1,14 +0,0 @@
#pragma once
namespace demonware
{
class bdMarketing final : public service
{
public:
bdMarketing();
private:
void unk2(service_server* server, byte_buffer* buffer) const;
void unk3(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -5,10 +5,18 @@ namespace demonware
{
bdMarketingComms::bdMarketingComms() : service(104, "bdMarketingComms")
{
this->register_task(1, &bdMarketingComms::get_messages);
this->register_task(1, &bdMarketingComms::getMessages);
this->register_task(4, &bdMarketingComms::reportFullMessagesViewed);
}
void bdMarketingComms::get_messages(service_server* server, byte_buffer* /*buffer*/) const
void bdMarketingComms::getMessages(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketingComms::reportFullMessagesViewed(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -8,6 +8,7 @@ namespace demonware
bdMarketingComms();
private:
void get_messages(service_server* server, byte_buffer* buffer) const;
void getMessages(service_server* server, byte_buffer* buffer) const;
void reportFullMessagesViewed(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,84 @@
#include <std_include.hpp>
#include "../services.hpp"
#include <utils/io.hpp>
namespace demonware
{
bdMarketplace::bdMarketplace() : service(80, "bdMarketplace")
{
this->register_task(42, &bdMarketplace::startExchangeTransaction); // COD POINTS purchase ?
//this->register_task(43, &bdMarketplace::purchaseOnSteamInitialize); // COD POINTS purchase ?
this->register_task(49, &bdMarketplace::getExpiredInventoryItems);
this->register_task(60, &bdMarketplace::steamProcessDurable);
this->register_task(122, &bdMarketplace::purchaseSkus);
this->register_task(130, &bdMarketplace::getBalance);
this->register_task(165, &bdMarketplace::getInventoryPaginated);
this->register_task(193, &bdMarketplace::putPlayersInventoryItems);
this->register_task(232, &bdMarketplace::getEntitlements);
}
void bdMarketplace::startExchangeTransaction(service_server* server, byte_buffer* buffer) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketplace::purchaseOnSteamInitialize(service_server* server, byte_buffer* buffer) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketplace::getExpiredInventoryItems(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketplace::steamProcessDurable(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketplace::purchaseSkus(service_server* server, byte_buffer* buffer) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketplace::getBalance(service_server* server, byte_buffer* buffer) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketplace::getInventoryPaginated(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketplace::putPlayersInventoryItems(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMarketplace::getEntitlements(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,21 @@
#pragma once
namespace demonware
{
class bdMarketplace final : public service
{
public:
bdMarketplace();
private:
void startExchangeTransaction(service_server* server, byte_buffer* buffer) const;
void purchaseOnSteamInitialize(service_server* server, byte_buffer* buffer) const;
void getExpiredInventoryItems(service_server* server, byte_buffer* buffer) const;
void steamProcessDurable(service_server* server, byte_buffer* buffer) const;
void purchaseSkus(service_server* server, byte_buffer* buffer) const;
void getBalance(service_server* server, byte_buffer* buffer) const;
void getInventoryPaginated(service_server* server, byte_buffer* buffer) const;
void putPlayersInventoryItems(service_server* server, byte_buffer* buffer) const;
void getEntitlements(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,129 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdMatchMaking::bdMatchMaking() : service(138, "bdMatchMaking")
{
this->register_task(1, &bdMatchMaking::createSession);
this->register_task(2, &bdMatchMaking::updateSession);
this->register_task(3, &bdMatchMaking::deleteSession);
this->register_task(4, &bdMatchMaking::findSessionFromID);
this->register_task(5, &bdMatchMaking::findSessions);
this->register_task(6, &bdMatchMaking::notifyJoin);
this->register_task(8, &bdMatchMaking::inviteToSession);
this->register_task(9, &bdMatchMaking::submitPerformance);
this->register_task(10, &bdMatchMaking::getPerformanceValues);
this->register_task(11, &bdMatchMaking::getSessionInvites);
this->register_task(12, &bdMatchMaking::updateSessionPlayers);
this->register_task(13, &bdMatchMaking::findSessionsPaged);
this->register_task(14, &bdMatchMaking::findSessionsByEntityIDs);
this->register_task(15, &bdMatchMaking::findSessionsFromIDs);
this->register_task(16, &bdMatchMaking::findSessionsTwoPass);
}
void bdMatchMaking::createSession(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::updateSession(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::deleteSession(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::findSessionFromID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::findSessions(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::getPerformanceValues(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::getSessionInvites(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::updateSessionPlayers(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::submitPerformance(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::notifyJoin(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::inviteToSession(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::findSessionsPaged(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::findSessionsByEntityIDs(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::findSessionsFromIDs(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking::findSessionsTwoPass(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,27 @@
#pragma once
namespace demonware
{
class bdMatchMaking final : public service
{
public:
bdMatchMaking();
private:
void createSession(service_server* server, byte_buffer* buffer) const;
void updateSession(service_server* server, byte_buffer* buffer) const;
void deleteSession(service_server* server, byte_buffer* buffer) const;
void findSessionFromID(service_server* server, byte_buffer* buffer) const;
void findSessions(service_server* server, byte_buffer* buffer) const;
void inviteToSession(service_server* server, byte_buffer* buffer) const;
void submitPerformance(service_server* server, byte_buffer* buffer) const;
void notifyJoin(service_server* server, byte_buffer* buffer) const;
void getPerformanceValues(service_server* server, byte_buffer* buffer) const;
void getSessionInvites(service_server* server, byte_buffer* buffer) const;
void updateSessionPlayers(service_server* server, byte_buffer* buffer) const;
void findSessionsPaged(service_server* server, byte_buffer* buffer) const;
void findSessionsByEntityIDs(service_server* server, byte_buffer* buffer) const;
void findSessionsFromIDs(service_server* server, byte_buffer* buffer) const;
void findSessionsTwoPass(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -1,57 +0,0 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdMatchMaking2::bdMatchMaking2() : service(138, "bdMatchMaking2")
{
this->register_task(1, &bdMatchMaking2::unk1);
this->register_task(2, &bdMatchMaking2::unk2);
this->register_task(3, &bdMatchMaking2::unk3);
this->register_task(5, &bdMatchMaking2::unk5);
this->register_task(10, &bdMatchMaking2::unk10);
this->register_task(16, &bdMatchMaking2::unk16);
}
void bdMatchMaking2::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking2::unk2(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking2::unk3(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking2::unk5(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking2::unk10(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdMatchMaking2::unk16(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -1,18 +0,0 @@
#pragma once
namespace demonware
{
class bdMatchMaking2 final : public service
{
public:
bdMatchMaking2();
private:
void unk1(service_server* server, byte_buffer* buffer) const;
void unk2(service_server* server, byte_buffer* buffer) const;
void unk3(service_server* server, byte_buffer* buffer) const;
void unk5(service_server* server, byte_buffer* buffer) const;
void unk10(service_server* server, byte_buffer* buffer) const;
void unk16(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -5,10 +5,66 @@ namespace demonware
{
bdProfiles::bdProfiles() : service(8, "bdProfiles")
{
this->register_task(3, &bdProfiles::unk3);
this->register_task(1, &bdProfiles::getPublicInfos);
this->register_task(2, &bdProfiles::getPrivateInfo);
this->register_task(3, &bdProfiles::setPublicInfo);
this->register_task(4, &bdProfiles::setPrivateInfo);
this->register_task(5, &bdProfiles::deleteProfile);
this->register_task(6, &bdProfiles::setPrivateInfoByUserID);
this->register_task(7, &bdProfiles::getPrivateInfoByUserID);
this->register_task(8, &bdProfiles::setPublicInfoByUserID);
}
void bdProfiles::unk3(service_server* server, byte_buffer* /*buffer*/) const
void bdProfiles::getPublicInfos(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdProfiles::setPublicInfo(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdProfiles::getPrivateInfo(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdProfiles::setPrivateInfo(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdProfiles::deleteProfile(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdProfiles::setPrivateInfoByUserID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdProfiles::getPrivateInfoByUserID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdProfiles::setPublicInfoByUserID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -8,6 +8,13 @@ namespace demonware
bdProfiles();
private:
void unk3(service_server* server, byte_buffer* buffer) const;
void getPublicInfos(service_server* server, byte_buffer* buffer) const;
void getPrivateInfo(service_server* server, byte_buffer* buffer) const;
void setPublicInfo(service_server* server, byte_buffer* buffer) const;
void setPrivateInfo(service_server* server, byte_buffer* buffer) const;
void deleteProfile(service_server* server, byte_buffer* buffer) const;
void setPrivateInfoByUserID(service_server* server, byte_buffer* buffer) const;
void getPrivateInfoByUserID(service_server* server, byte_buffer* buffer) const;
void setPublicInfoByUserID(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,17 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdPublisherVariables::bdPublisherVariables() : service(95, "bdPublisherVariables")
{
this->register_task(1, &bdPublisherVariables::retrievePublisherVariables);
}
void bdPublisherVariables::retrievePublisherVariables(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,13 @@
#pragma once
namespace demonware
{
class bdPublisherVariables final : public service
{
public:
bdPublisherVariables();
private:
void retrievePublisherVariables(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,41 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdReward::bdReward() : service(139, "bdReward")
{
this->register_task(1, &bdReward::incrementTime);
this->register_task(2, &bdReward::claimRewardRoll);
this->register_task(3, &bdReward::claimClientAchievements);
this->register_task(4, &bdReward::reportRewardEvents);
}
void bdReward::incrementTime(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdReward::claimRewardRoll(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdReward::claimClientAchievements(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdReward::reportRewardEvents(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,16 @@
#pragma once
namespace demonware
{
class bdReward final : public service
{
public:
bdReward();
private:
void incrementTime(service_server* server, byte_buffer* buffer) const;
void claimRewardRoll(service_server* server, byte_buffer* buffer) const;
void claimClientAchievements(service_server* server, byte_buffer* buffer) const;
void reportRewardEvents(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -5,18 +5,18 @@ namespace demonware
{
bdRichPresence::bdRichPresence() : service(68, "bdRichPresence")
{
this->register_task(1, &bdRichPresence::unk1);
this->register_task(2, &bdRichPresence::unk2);
this->register_task(1, &bdRichPresence::setInfo);
this->register_task(2, &bdRichPresence::getInfo);
}
void bdRichPresence::unk1(service_server* server, byte_buffer* /*buffer*/) const
void bdRichPresence::setInfo(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdRichPresence::unk2(service_server* server, byte_buffer* /*buffer*/) const
void bdRichPresence::getInfo(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -8,7 +8,7 @@ namespace demonware
bdRichPresence();
private:
void unk1(service_server* server, byte_buffer* buffer) const;
void unk2(service_server* server, byte_buffer* buffer) const;
void setInfo(service_server* server, byte_buffer* buffer) const;
void getInfo(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -5,14 +5,29 @@ namespace demonware
{
bdStats::bdStats() : service(4, "bdStats")
{
this->register_task(1, &bdStats::unk1);
this->register_task(1, &bdStats::writeStats);
this->register_task(2, &bdStats::deleteStats);
this->register_task(3, &bdStats::unk3); // leaderboards
this->register_task(4, &bdStats::unk4);
this->register_task(8, &bdStats::unk8);
this->register_task(11, &bdStats::unk11);
this->register_task(4, &bdStats::readStatsByRank);
this->register_task(5, &bdStats::readStatsByPivot);
this->register_task(6, &bdStats::readStatsByRating);
this->register_task(7, &bdStats::readStatsByMultipleRanks);
this->register_task(8, &bdStats::readExternalTitleStats);
this->register_task(10, &bdStats::readExternalTitleNamedStats);
this->register_task(11, &bdStats::readStatsByLeaderboardIDsAndEntityIDs);
this->register_task(12, &bdStats::readStatsByMultipleRatings);
this->register_task(13, &bdStats::readStatsByEntityID);
this->register_task(14, &bdStats::writeServerValidatedStats);
}
void bdStats::unk1(service_server* server, byte_buffer* /*buffer*/) const
void bdStats::writeStats(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::deleteStats(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
@ -26,21 +41,70 @@ namespace demonware
reply->send();
}
void bdStats::unk4(service_server* server, byte_buffer* /*buffer*/) const
void bdStats::readStatsByRank(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::unk8(service_server* server, byte_buffer* /*buffer*/) const
void bdStats::readStatsByPivot(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::unk11(service_server* server, byte_buffer* /*buffer*/) const
void bdStats::readStatsByRating(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::readStatsByMultipleRanks(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::readExternalTitleStats(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::readExternalTitleNamedStats(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::readStatsByLeaderboardIDsAndEntityIDs(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::readStatsByMultipleRatings(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::readStatsByEntityID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats::writeServerValidatedStats(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());

View File

@ -8,10 +8,18 @@ namespace demonware
bdStats();
private:
void unk1(service_server* server, byte_buffer* buffer) const;
void writeStats(service_server* server, byte_buffer* buffer) const;
void deleteStats(service_server* server, byte_buffer* buffer) const;
void unk3(service_server* server, byte_buffer* buffer) const;
void unk4(service_server* server, byte_buffer* buffer) const;
void unk8(service_server* server, byte_buffer* buffer) const;
void unk11(service_server* server, byte_buffer* buffer) const;
void readStatsByRank(service_server* server, byte_buffer* buffer) const;
void readStatsByPivot(service_server* server, byte_buffer* buffer) const;
void readStatsByRating(service_server* server, byte_buffer* buffer) const;
void readStatsByMultipleRanks(service_server* server, byte_buffer* buffer) const;
void readExternalTitleStats(service_server* server, byte_buffer* buffer) const;
void readExternalTitleNamedStats(service_server* server, byte_buffer* buffer) const;
void readStatsByLeaderboardIDsAndEntityIDs(service_server* server, byte_buffer* buffer) const;
void readStatsByMultipleRatings(service_server* server, byte_buffer* buffer) const;
void readStatsByEntityID(service_server* server, byte_buffer* buffer) const;
void writeServerValidatedStats(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,25 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdStats2::bdStats2() : service(19, "bdStats")
{
this->register_task(1, &bdStats2::startArbitratedSession);
this->register_task(2, &bdStats2::writeArbitratedStats);
}
void bdStats2::startArbitratedSession(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats2::writeArbitratedStats(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,14 @@
#pragma once
namespace demonware
{
class bdStats2 final : public service
{
public:
bdStats2();
private:
void startArbitratedSession(service_server* server, byte_buffer* buffer) const;
void writeArbitratedStats(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,65 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdStats3::bdStats3() : service(91, "bdStats")
{
this->register_task(1, &bdStats3::deleteCSFileStats);
this->register_task(3, &bdStats3::readStatsByEntityID);
this->register_task(4, &bdStats3::readStatsByRank);
this->register_task(5, &bdStats3::readStatsByPivot);
this->register_task(6, &bdStats3::readStatsByRating);
this->register_task(7, &bdStats3::readStatsByMultipleRanks);
this->register_task(11, &bdStats3::readStatsByLeaderboardIDsAndEntityIDs);
}
void bdStats3::deleteCSFileStats(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats3::readStatsByEntityID(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats3::readStatsByRank(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats3::readStatsByPivot(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats3::readStatsByRating(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats3::readStatsByMultipleRanks(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdStats3::readStatsByLeaderboardIDsAndEntityIDs(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,19 @@
#pragma once
namespace demonware
{
class bdStats3 final : public service
{
public:
bdStats3();
private:
void deleteCSFileStats(service_server* server, byte_buffer* buffer) const;
void readStatsByEntityID(service_server* server, byte_buffer* buffer) const;
void readStatsByRank(service_server* server, byte_buffer* buffer) const;
void readStatsByPivot(service_server* server, byte_buffer* buffer) const;
void readStatsByRating(service_server* server, byte_buffer* buffer) const;
void readStatsByMultipleRanks(service_server* server, byte_buffer* buffer) const;
void readStatsByLeaderboardIDsAndEntityIDs(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -18,6 +18,7 @@ namespace demonware
this->register_task(12, &bdStorage::unk12);
this->map_publisher_resource("motd-.*\\.txt", DW_MOTD);
// this->map_publisher_resource("ffotd-.*\\.ff", DW_FASTFILE);
this->map_publisher_resource("playlists(_.+)?\\.aggr", DW_PLAYLISTS);
}
@ -56,7 +57,7 @@ namespace demonware
}
}
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [bdStorage]: missing publisher file: %s\n", name.data());
#endif
@ -65,10 +66,6 @@ namespace demonware
void bdStorage::list_publisher_files(service_server* server, byte_buffer* buffer)
{
#ifdef DEBUG
utils::io::write_file("demonware/bdStorage/list_publisher_files", buffer->get_buffer());
#endif
uint32_t date;
uint16_t num_results, offset;
std::string unk, filename, data;
@ -79,7 +76,7 @@ namespace demonware
buffer->read_uint16(&offset);
buffer->read_string(&filename);
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [bdStorage]: list publisher files: %s\n", filename.data());
#endif
@ -105,15 +102,11 @@ namespace demonware
void bdStorage::get_publisher_file(service_server* server, byte_buffer* buffer)
{
#ifdef DEBUG
utils::io::write_file("demonware/bdStorage/get_publisher_file", buffer->get_buffer());
#endif
std::string unk, filename;
buffer->read_string(&unk);
buffer->read_string(&filename);
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [bdStorage]: loading publisher file: %s\n", filename.data());
#endif
@ -121,7 +114,7 @@ namespace demonware
if (this->load_publisher_resource(filename, data))
{
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [bdStorage]: sending publisher file: %s, size: %lld\n", filename.data(), data.size());
#endif
@ -142,10 +135,6 @@ namespace demonware
void bdStorage::set_user_file(service_server* server, byte_buffer* buffer) const
{
#ifdef DEBUG
utils::io::write_file("demonware/bdStorage/set_user_file", buffer->get_buffer());
#endif
uint64_t owner;
uint32_t numfiles;
std::string game, platform;
@ -182,7 +171,7 @@ namespace demonware
info->filename = filename;
info->data = data;
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [bdStorage]: set user file: %s\n", filename.data());
#endif
@ -194,10 +183,6 @@ namespace demonware
void bdStorage::get_user_file(service_server* server, byte_buffer* buffer) const
{
#ifdef DEBUG
utils::io::write_file("demonware/bdStorage/get_user_file", buffer->get_buffer());
#endif
uint32_t unk32_0;
uint32_t numfiles, count = 0;
uint64_t owner;
@ -221,7 +206,7 @@ namespace demonware
const auto path = get_user_file_path(filename);
if (!utils::io::read_file(path, &data))
{
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [bdStorage]: get user file: missing file: %s, %s, %s\n", game.data(), filename.data(), platform.data());
#endif
continue;
@ -237,7 +222,7 @@ namespace demonware
reply->add(response);
++count;
#ifdef DEBUG
#ifdef DW_DEBUG
printf("[DW]: [bdStorage]: get user file: %s, %s, %s\n", game.data(), filename.data(), platform.data());
#endif
}
@ -254,10 +239,6 @@ namespace demonware
void bdStorage::unk12(service_server* server, byte_buffer* buffer) const
{
#ifdef DEBUG
utils::io::write_file("demonware/bdStorage/unk12", buffer->get_buffer());
#endif
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();

View File

@ -0,0 +1,409 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdTeams::bdTeams() : service(3, "bdTeams")
{
this->register_task(30, &bdTeams::createTeam);
this->register_task(31, &bdTeams::updateTeamName);
this->register_task(32, &bdTeams::promoteMember);
this->register_task(33, &bdTeams::kickMember);
this->register_task(34, &bdTeams::leaveTeam);
this->register_task(35, &bdTeams::proposeMembership);
this->register_task(36, &bdTeams::rejectMembership);
this->register_task(37, &bdTeams::acceptMembership);
this->register_task(38, &bdTeams::getPublicProfiles);
this->register_task(39, &bdTeams::getPrivateProfile);
this->register_task(40, &bdTeams::getPublicMemberProfiles);
this->register_task(41, &bdTeams::getPrivateMemberProfiles);
this->register_task(42, &bdTeams::setPublicProfile);
this->register_task(43, &bdTeams::setPrivateProfile);
this->register_task(44, &bdTeams::setPublicMemberProfile);
this->register_task(45, &bdTeams::setPrivateMemberProfile);
this->register_task(46, &bdTeams::getMemberships);
this->register_task(47, &bdTeams::getMembers);
this->register_task(48, &bdTeams::getOutgoingProposals);
this->register_task(49, &bdTeams::withdrawProposal);
this->register_task(50, &bdTeams::demoteMember);
this->register_task(51, &bdTeams::promoteMemberToOwner);
this->register_task(52, &bdTeams::getTeamInfo);
this->register_task(53, &bdTeams::getIncomingProposals);
this->register_task(54, &bdTeams::sendInstantMessage);
this->register_task(56, &bdTeams::getMembershipsUser);
this->register_task(57, &bdTeams::sendInstantMessageToTeam);
this->register_task(58, &bdTeams::searchPublicTeamProfiles);
this->register_task(63, &bdTeams::addApplication);
this->register_task(64, &bdTeams::getApplicationsByTeam);
this->register_task(65, &bdTeams::acceptApplication);
this->register_task(66, &bdTeams::rejectApplication);
this->register_task(68, &bdTeams::autoJoinTeam);
this->register_task(70, &bdTeams::createTeamWithProfiles);
this->register_task(73, &bdTeams::banMember);
this->register_task(74, &bdTeams::unbanMember);
this->register_task(76, &bdTeams::blockApplication);
this->register_task(78, &bdTeams::unblockApplication);
this->register_task(80, &bdTeams::updateTeamType);
this->register_task(82, &bdTeams::setOnline);
this->register_task(83, &bdTeams::getMembershipsWithCounts);
this->register_task(84, &bdTeams::getMembershipsWithCountsUser);
this->register_task(85, &bdTeams::searchTeams);
this->register_task(86, &bdTeams::createTeamWithProfilesAndTeamType);
this->register_task(87, &bdTeams::getMembershipsWithCountsAndTeamTypeUser);
this->register_task(88, &bdTeams::getMembershipsWithCountsAndTeamType);
this->register_task(89, &bdTeams::getTeamInfoWithTeamType);
this->register_task(91, &bdTeams::setTeamAutoJoin);
this->register_task(92, &bdTeams::getTeamAutoJoin);
this->register_task(94, &bdTeams::getMembersAndPrivileges);
}
void bdTeams::createTeam(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::updateTeamName(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::promoteMember(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::kickMember(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::leaveTeam(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::proposeMembership(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::rejectMembership(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::acceptMembership(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getPublicProfiles(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getPrivateProfile(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getPublicMemberProfiles(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getPrivateMemberProfiles(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::setPublicProfile(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::setPrivateProfile(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::setPublicMemberProfile(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::setPrivateMemberProfile(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getMemberships(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getMembers(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getOutgoingProposals(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::withdrawProposal(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::demoteMember(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::promoteMemberToOwner(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getTeamInfo(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getIncomingProposals(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::sendInstantMessage(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getMembershipsUser(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::sendInstantMessageToTeam(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::searchPublicTeamProfiles(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::addApplication(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getApplicationsByTeam(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::acceptApplication(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::rejectApplication(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::autoJoinTeam(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::createTeamWithProfiles(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::banMember(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::unbanMember(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::blockApplication(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::unblockApplication(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::updateTeamType(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::setOnline(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getMembershipsWithCounts(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getMembershipsWithCountsUser(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::searchTeams(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::createTeamWithProfilesAndTeamType(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getMembershipsWithCountsAndTeamTypeUser(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getMembershipsWithCountsAndTeamType(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getTeamInfoWithTeamType(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::setTeamAutoJoin(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getTeamAutoJoin(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdTeams::getMembersAndPrivileges(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,62 @@
#pragma once
namespace demonware
{
class bdTeams final : public service
{
public:
bdTeams();
private:
void createTeam(service_server* server, byte_buffer* buffer) const;
void updateTeamName(service_server* server, byte_buffer* buffer) const;
void promoteMember(service_server* server, byte_buffer* buffer) const;
void kickMember(service_server* server, byte_buffer* buffer) const;
void leaveTeam(service_server* server, byte_buffer* buffer) const;
void proposeMembership(service_server* server, byte_buffer* buffer) const;
void rejectMembership(service_server* server, byte_buffer* buffer) const;
void acceptMembership(service_server* server, byte_buffer* buffer) const;
void getPublicProfiles(service_server* server, byte_buffer* buffer) const;
void getPrivateProfile(service_server* server, byte_buffer* buffer) const;
void getPublicMemberProfiles(service_server* server, byte_buffer* buffer) const;
void getPrivateMemberProfiles(service_server* server, byte_buffer* buffer) const;
void setPublicProfile(service_server* server, byte_buffer* buffer) const;
void setPrivateProfile(service_server* server, byte_buffer* buffer) const;
void setPublicMemberProfile(service_server* server, byte_buffer* buffer) const;
void setPrivateMemberProfile(service_server* server, byte_buffer* buffer) const;
void getMemberships(service_server* server, byte_buffer* buffer) const;
void getMembers(service_server* server, byte_buffer* buffer) const;
void getOutgoingProposals(service_server* server, byte_buffer* buffer) const;
void withdrawProposal(service_server* server, byte_buffer* buffer) const;
void demoteMember(service_server* server, byte_buffer* buffer) const;
void promoteMemberToOwner(service_server* server, byte_buffer* buffer) const;
void getTeamInfo(service_server* server, byte_buffer* buffer) const;
void getIncomingProposals(service_server* server, byte_buffer* buffer) const;
void sendInstantMessage(service_server* server, byte_buffer* buffer) const;
void getMembershipsUser(service_server* server, byte_buffer* buffer) const;
void sendInstantMessageToTeam(service_server* server, byte_buffer* buffer) const;
void searchPublicTeamProfiles(service_server* server, byte_buffer* buffer) const;
void addApplication(service_server* server, byte_buffer* buffer) const;
void getApplicationsByTeam(service_server* server, byte_buffer* buffer) const;
void acceptApplication(service_server* server, byte_buffer* buffer) const;
void rejectApplication(service_server* server, byte_buffer* buffer) const;
void autoJoinTeam(service_server* server, byte_buffer* buffer) const;
void createTeamWithProfiles(service_server* server, byte_buffer* buffer) const;
void banMember(service_server* server, byte_buffer* buffer) const;
void unbanMember(service_server* server, byte_buffer* buffer) const;
void blockApplication(service_server* server, byte_buffer* buffer) const;
void unblockApplication(service_server* server, byte_buffer* buffer) const;
void updateTeamType(service_server* server, byte_buffer* buffer) const;
void setOnline(service_server* server, byte_buffer* buffer) const;
void getMembershipsWithCounts(service_server* server, byte_buffer* buffer) const;
void getMembershipsWithCountsUser(service_server* server, byte_buffer* buffer) const;
void searchTeams(service_server* server, byte_buffer* buffer) const;
void createTeamWithProfilesAndTeamType(service_server* server, byte_buffer* buffer) const;
void getMembershipsWithCountsAndTeamTypeUser(service_server* server, byte_buffer* buffer) const;
void getMembershipsWithCountsAndTeamType(service_server* server, byte_buffer* buffer) const;
void getTeamInfoWithTeamType(service_server* server, byte_buffer* buffer) const;
void setTeamAutoJoin(service_server* server, byte_buffer* buffer) const;
void getTeamAutoJoin(service_server* server, byte_buffer* buffer) const;
void getMembersAndPrivileges(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -1,66 +0,0 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdUNK80::bdUNK80() : service(80, "bdUNK80")
{
this->register_task(42, &bdUNK80::unk42); // COD POINTS purchase ?
// this->register_task(43, &bdUNK80::unk43); COD POINTS purchase ?
this->register_task(49, &bdUNK80::unk49);
this->register_task(60, &bdUNK80::unk60);
this->register_task(130, &bdUNK80::unk130);
this->register_task(165, &bdUNK80::unk165);
this->register_task(193, &bdUNK80::unk193);
this->register_task(232, &bdUNK80::unk232);
}
void bdUNK80::unk42(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk49(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk60(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk130(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk165(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk193(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUNK80::unk232(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -1,19 +0,0 @@
#pragma once
namespace demonware
{
class bdUNK80 final : public service
{
public:
bdUNK80();
private:
void unk42(service_server* server, byte_buffer* buffer) const;
void unk49(service_server* server, byte_buffer* buffer) const;
void unk60(service_server* server, byte_buffer* buffer) const;
void unk130(service_server* server, byte_buffer* buffer) const;
void unk165(service_server* server, byte_buffer* buffer) const;
void unk193(service_server* server, byte_buffer* buffer) const;
void unk232(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -1,17 +0,0 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdUNK95::bdUNK95() : service(95, "bdUNK95")
{
this->register_task(1, &bdUNK95::unk1);
}
void bdUNK95::unk1(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -1,13 +0,0 @@
#pragma once
namespace demonware
{
class bdUNK95 final : public service
{
public:
bdUNK95();
private:
void unk1(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -0,0 +1,97 @@
#include <std_include.hpp>
#include "../services.hpp"
namespace demonware
{
bdUserGroups::bdUserGroups() : service(65, "bdUserGroups")
{
this->register_task(1, &bdUserGroups::createGroup);
this->register_task(2, &bdUserGroups::deleteGroup);
this->register_task(3, &bdUserGroups::joinGroup);
this->register_task(4, &bdUserGroups::leaveGroup);
this->register_task(5, &bdUserGroups::getMembershipInfo);
this->register_task(6, &bdUserGroups::changeMemberType);
this->register_task(7, &bdUserGroups::getNumMembers);
this->register_task(8, &bdUserGroups::getMembers);
this->register_task(9, &bdUserGroups::getMemberships);
this->register_task(10, &bdUserGroups::readStatsByRank);
this->register_task(11, &bdUserGroups::getGroupLists);
}
void bdUserGroups::createGroup(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::deleteGroup(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::joinGroup(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::leaveGroup(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::getMembershipInfo(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::changeMemberType(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::getNumMembers(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::getMembers(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::getMemberships(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::readStatsByRank(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
void bdUserGroups::getGroupLists(service_server* server, byte_buffer* /*buffer*/) const
{
// TODO:
auto reply = server->create_reply(this->task_id());
reply->send();
}
}

View File

@ -0,0 +1,23 @@
#pragma once
namespace demonware
{
class bdUserGroups final : public service
{
public:
bdUserGroups();
private:
void createGroup(service_server* server, byte_buffer* buffer) const;
void deleteGroup(service_server* server, byte_buffer* buffer) const;
void joinGroup(service_server* server, byte_buffer* buffer) const;
void leaveGroup(service_server* server, byte_buffer* buffer) const;
void getMembershipInfo(service_server* server, byte_buffer* buffer) const;
void changeMemberType(service_server* server, byte_buffer* buffer) const;
void getNumMembers(service_server* server, byte_buffer* buffer) const;
void getMembers(service_server* server, byte_buffer* buffer) const;
void getMemberships(service_server* server, byte_buffer* buffer) const;
void readStatsByRank(service_server* server, byte_buffer* buffer) const;
void getGroupLists(service_server* server, byte_buffer* buffer) const;
};
}

View File

@ -1510,7 +1510,7 @@ namespace game
namespace demonware
{
enum DWOnlineStatus
enum DWOnlineStatus : std::int32_t
{
DW_LIVE_DISCONNECTED = 0x0,
DW_LIVE_UNKNOWN = 0x1,
@ -1518,7 +1518,7 @@ namespace game
DW_LIVE_CONNECTED = 0x3,
};
enum DWNetStatus
enum DWNetStatus : std::int32_t
{
DW_NET_ERROR_START_FAILED = 0x0,
DW_NET_ERROR_NO_LOCAL_IP = 0x1,
@ -1529,7 +1529,7 @@ namespace game
DW_NET_STARTED_ONLINE = 0x6,
};
enum bdLobbyErrorCode : uint32_t
enum bdLobbyErrorCode : std::int32_t
{
BD_NO_ERROR = 0x0,
BD_TOO_MANY_TASKS = 0x1,

View File

@ -12,10 +12,10 @@ DECLSPEC_NORETURN void WINAPI exit_hook(const int code)
exit(code);
}
BOOL WINAPI system_parameters_info_a(const UINT uiAction, const UINT uiParam, const PVOID pvParam, const UINT fWinIni)
DWORD_PTR WINAPI set_thread_affinity_mask(HANDLE hThread, DWORD_PTR dwThreadAffinityMask)
{
component_loader::post_unpack();
return SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
return SetThreadAffinityMask(hThread, dwThreadAffinityMask);
}
FARPROC load_binary(uint64_t* base_address)
@ -34,10 +34,9 @@ FARPROC load_binary(uint64_t* base_address)
{
return exit_hook;
}
else if (function == "SystemParametersInfoA")
else if (function == "SetThreadAffinityMask")
{
// post_unpack called from SteamAPI_Init
//return system_parameters_info_a;
return set_thread_affinity_mask;
}
return component_loader::load_import(library, function);

View File

@ -102,4 +102,8 @@
using namespace std::literals;
#ifdef DEBUG
#define DW_DEBUG
#endif
#define __FILENAME__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)

View File

@ -101,4 +101,45 @@ namespace steam
{
return false;
}
}
steam_id apps::GetAppOwner()
{
return SteamUser()->GetSteamID();
}
const char* apps::GetLaunchQueryParam(const char* pchKey)
{
return "";
}
bool apps::GetDlcDownloadProgress(uint32_t nAppID, uint64_t* punBytesDownloaded, uint64_t* punBytesTotal)
{
*punBytesTotal = 0;
*punBytesDownloaded = 0;
return false;
}
int apps::GetAppBuildId()
{
return 0;
}
void apps::RequestAllProofOfPurchaseKeys()
{
}
uint64_t apps::GetFileDetails(const char* pszFileName)
{
return 0;
}
int apps::GetLaunchCommandLine(char* pszCommandLine, int cubCommandLine)
{
return 0;
}
bool apps::BIsSubscribedFromFamilySharing()
{
return false;
}
}

View File

@ -28,5 +28,14 @@ namespace steam
virtual unsigned int GetInstalledDepots(int* pvecDepots, unsigned int cMaxDepots);
virtual unsigned int GetAppInstallDir(unsigned int appID, char* pchFolder, unsigned int cchFolderBufferSize);
virtual bool BIsAppInstalled(unsigned int appID);
virtual steam_id GetAppOwner();
virtual const char* GetLaunchQueryParam(const char* pchKey);
virtual bool GetDlcDownloadProgress(uint32_t nAppID, uint64_t* punBytesDownloaded, uint64_t* punBytesTotal);
virtual int GetAppBuildId();
virtual void RequestAllProofOfPurchaseKeys();
virtual uint64_t GetFileDetails(const char* pszFileName);
virtual int GetLaunchCommandLine(char* pszCommandLine, int cubCommandLine);
virtual bool BIsSubscribedFromFamilySharing();
};
}

View File

@ -0,0 +1,277 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam
{
namespace
{
void* get_dummy()
{
static class blub
{
public:
virtual uint64_t m0() { return 0; }
virtual uint64_t m1() { return 0; }
virtual uint64_t m2() { return 0; }
virtual uint64_t m3() { return 0; }
virtual uint64_t m4() { return 0; }
virtual uint64_t m5() { return 0; }
virtual uint64_t m6() { return 0; }
virtual uint64_t m7() { return 0; }
virtual uint64_t m8() { return 0; }
virtual uint64_t m9() { return 0; }
virtual uint64_t m10() { return 0; }
virtual uint64_t m11() { return 0; }
virtual uint64_t m12() { return 0; }
virtual uint64_t m13() { return 0; }
virtual uint64_t m14() { return 0; }
virtual uint64_t m15() { return 0; }
virtual uint64_t m16() { return 0; }
virtual uint64_t m17() { return 0; }
virtual uint64_t m18() { return 0; }
virtual uint64_t m19() { return 0; }
virtual uint64_t m20() { return 0; }
virtual uint64_t m21() { return 0; }
virtual uint64_t m22() { return 0; }
virtual uint64_t m23() { return 0; }
virtual uint64_t m24() { return 0; }
virtual uint64_t m25() { return 0; }
virtual uint64_t m26() { return 0; }
virtual uint64_t m27() { return 0; }
virtual uint64_t m28() { return 0; }
virtual uint64_t m29() { return 0; }
virtual uint64_t m30() { return 0; }
virtual uint64_t m31() { return 0; }
virtual uint64_t m32() { return 0; }
virtual uint64_t m33() { return 0; }
virtual uint64_t m34() { return 0; }
virtual uint64_t m35() { return 0; }
virtual uint64_t m36() { return 0; }
virtual uint64_t m37() { return 0; }
virtual uint64_t m38() { return 0; }
virtual uint64_t m39() { return 0; }
virtual uint64_t m40() { return 0; }
virtual uint64_t m41() { return 0; }
virtual uint64_t m42() { return 0; }
virtual uint64_t m43() { return 0; }
virtual uint64_t m44() { return 0; }
virtual uint64_t m45() { return 0; }
virtual uint64_t m46() { return 0; }
virtual uint64_t m47() { return 0; }
virtual uint64_t m48() { return 0; }
virtual uint64_t m49() { return 0; }
virtual uint64_t m50() { return 0; }
virtual uint64_t m51() { return 0; }
virtual uint64_t m52() { return 0; }
virtual uint64_t m53() { return 0; }
virtual uint64_t m54() { return 0; }
virtual uint64_t m55() { return 0; }
virtual uint64_t m56() { return 0; }
virtual uint64_t m57() { return 0; }
virtual uint64_t m58() { return 0; }
virtual uint64_t m59() { return 0; }
virtual uint64_t m60() { return 0; }
virtual uint64_t m61() { return 0; }
virtual uint64_t m62() { return 0; }
virtual uint64_t m63() { return 0; }
virtual uint64_t m64() { return 0; }
virtual uint64_t m65() { return 0; }
virtual uint64_t m66() { return 0; }
virtual uint64_t m67() { return 0; }
virtual uint64_t m68() { return 0; }
virtual uint64_t m69() { return 0; }
} x;
return &x;
}
}
HSteamPipe client::CreateSteamPipe()
{
return 1;
}
bool client::BReleaseSteamPipe(HSteamPipe hSteamPipe)
{
return true;
}
HSteamUser client::ConnectToGlobalUser(HSteamPipe hSteamPipe)
{
return 1;
}
HSteamUser client::CreateLocalUser(HSteamPipe* phSteamPipe, uint32_t eAccountType)
{
return 1;
}
void client::ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser)
{
}
void* client::GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamUser();
}
void* client::GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamGameServer();
}
void client::SetLocalIPBinding(uint32_t unIP, uint16_t usPort)
{
}
void* client::GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamFriends();
}
void* client::GetISteamUtils(HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamUtils();
}
void* client::GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamMatchmaking();
}
void* client::GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
static matchmaking_servers u;
return &u;
}
void* client::GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return nullptr;
}
void* client::GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamUserStats();
}
void* client::GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
static game_server_stats u;
return &u;
}
void* client::GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamApps();
}
void* client::GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamNetworking();
}
void* client::GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return SteamRemoteStorage();
}
void* client::GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
static screenshots s;
return &s;
}
void client::RunFrame()
{
}
uint32_t client::GetIPCCallCount()
{
return 0;
}
void client::SetWarningMessageHook(void* pFunction)
{
}
bool client::BShutdownIfAllPipesClosed()
{
return true;
}
void* client::GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
static http h;
return &h;
}
void* client::GetISteamUnifiedMessages(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
static unified_messages u;
return &u;
}
void* client::GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
static controller c;
return &c;
}
void* client::GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return get_dummy();
}
void* client::GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return get_dummy();
}
void* client::GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return get_dummy();
}
void* client::GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return get_dummy();
}
void* client::GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return get_dummy();
}
void client::Set_SteamAPI_CPostAPIResultInProcess(void* func)
{
}
void client::Remove_SteamAPI_CPostAPIResultInProcess(void* func)
{
}
void client::Set_SteamAPI_CCheckCallbackRegisteredInProcess(void* func)
{
}
void* client::GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return get_dummy();
}
void* client::GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return get_dummy();
}
void* client::GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion)
{
return get_dummy();
}
}

View File

@ -0,0 +1,52 @@
#pragma once
#include <cstdint>
namespace steam
{
using HSteamPipe = uint64_t;
using HSteamUser = uint64_t;
class client
{
public:
~client() = default;
virtual HSteamPipe CreateSteamPipe();
virtual bool BReleaseSteamPipe(HSteamPipe hSteamPipe);
virtual HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe);
virtual HSteamUser CreateLocalUser(HSteamPipe* phSteamPipe, uint32_t eAccountType);
virtual void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser);
virtual void* GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void SetLocalIPBinding(uint32_t unIP, uint16_t usPort);
virtual void* GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamUtils(HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void RunFrame();
virtual uint32_t GetIPCCallCount();
virtual void SetWarningMessageHook(void* pFunction);
virtual bool BShutdownIfAllPipesClosed();
virtual void* GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamUnifiedMessages(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void Set_SteamAPI_CPostAPIResultInProcess(void* func);
virtual void Remove_SteamAPI_CPostAPIResultInProcess(void* func);
virtual void Set_SteamAPI_CCheckCallbackRegisteredInProcess(void* func);
virtual void* GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
virtual void* GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char* pchVersion);
};
}

View File

@ -0,0 +1,84 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam
{
bool controller::Init()
{
return true;
}
bool controller::Shutdown()
{
return true;
}
void controller::RunFrame()
{
}
int controller::GetConnectedControllers(ControllerHandle_t* handlesOut)
{
return 0;
}
bool controller::ShowBindingPanel(ControllerHandle_t controllerHandle)
{
return false;
}
uint64_t controller::GetActionSetHandle(const char* pszActionSetName)
{
return 0;
}
void controller::ActivateActionSet(ControllerHandle_t controllerHandle, uint64_t actionSetHandle)
{
}
uint64_t controller::GetCurrentActionSet(ControllerHandle_t controllerHandle)
{
return 0;
}
uint64_t controller::GetDigitalActionHandle(const char* pszActionName)
{
return 0;
}
uint64_t controller::GetDigitalActionData(ControllerHandle_t controllerHandle, uint64_t digitalActionHandle)
{
return 0;
}
int controller::GetDigitalActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle,
uint64_t digitalActionHandle, uint64_t* originsOut)
{
return 0;
}
uint64_t controller::GetAnalogActionHandle(const char* pszActionName)
{
return 0;
}
uint64_t controller::GetAnalogActionData(ControllerHandle_t controllerHandle, uint64_t analogActionHandle)
{
return 0;
}
int controller::GetAnalogActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle,
uint64_t analogActionHandle, uint64_t* originsOut)
{
return 0;
}
void controller::StopAnalogActionMomentum(ControllerHandle_t controllerHandle, uint64_t eAction)
{
}
void controller::TriggerHapticPulse(ControllerHandle_t controllerHandle, uint64_t eTargetPad,
unsigned short usDurationMicroSec)
{
}
}

View File

@ -0,0 +1,32 @@
#pragma once
namespace steam
{
using ControllerHandle_t = uint64_t;
class controller
{
public:
~controller() = default;
virtual bool Init();
virtual bool Shutdown();
virtual void RunFrame();
virtual int GetConnectedControllers(ControllerHandle_t* handlesOut);
virtual bool ShowBindingPanel(ControllerHandle_t controllerHandle);
virtual uint64_t GetActionSetHandle(const char* pszActionSetName);
virtual void ActivateActionSet(ControllerHandle_t controllerHandle, uint64_t actionSetHandle);
virtual uint64_t GetCurrentActionSet(ControllerHandle_t controllerHandle);
virtual uint64_t GetDigitalActionHandle(const char* pszActionName);
virtual uint64_t GetDigitalActionData(ControllerHandle_t controllerHandle, uint64_t digitalActionHandle);
virtual int GetDigitalActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle,
uint64_t digitalActionHandle, uint64_t* originsOut);
virtual uint64_t GetAnalogActionHandle(const char* pszActionName);
virtual uint64_t GetAnalogActionData(ControllerHandle_t controllerHandle, uint64_t analogActionHandle);
virtual int GetAnalogActionOrigins(ControllerHandle_t controllerHandle, uint64_t actionSetHandle,
uint64_t analogActionHandle, uint64_t* originsOut);
virtual void StopAnalogActionMomentum(ControllerHandle_t controllerHandle, uint64_t eAction);
virtual void TriggerHapticPulse(ControllerHandle_t controllerHandle, uint64_t eTargetPad,
unsigned short usDurationMicroSec);
};
}

View File

@ -1,7 +1,7 @@
#include <std_include.hpp>
#include "../steam.hpp"
#include <game/game.hpp>
//#include <game/game.hpp>
namespace steam
{

View File

@ -0,0 +1,56 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam
{
uint64_t game_server_stats::RequestUserStats(steam_id steamIDUser)
{
return 0;
}
bool game_server_stats::GetUserStat(steam_id steamIDUser, const char* pchName, int32_t* pData)
{
return false;
}
bool game_server_stats::GetUserStat(steam_id steamIDUser, const char* pchName, float* pData)
{
return false;
}
bool game_server_stats::GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved)
{
return false;
}
bool game_server_stats::SetUserStat(steam_id steamIDUser, const char* pchName, int32_t nData)
{
return false;
}
bool game_server_stats::SetUserStat(steam_id steamIDUser, const char* pchName, float fData)
{
return false;
}
bool game_server_stats::UpdateUserAvgRateStat(steam_id steamIDUser, const char* pchName, float flCountThisSession,
double dSessionLength)
{
return false;
}
bool game_server_stats::SetUserAchievement(steam_id steamIDUser, const char* pchName)
{
return false;
}
bool game_server_stats::ClearUserAchievement(steam_id steamIDUser, const char* pchName)
{
return false;
}
uint64_t game_server_stats::StoreUserStats(steam_id steamIDUser)
{
return 0;
}
}

View File

@ -0,0 +1,22 @@
#pragma once
namespace steam
{
class game_server_stats
{
public:
~game_server_stats() = default;
virtual uint64_t RequestUserStats(steam_id steamIDUser);
virtual bool GetUserStat(steam_id steamIDUser, const char* pchName, int32_t* pData);
virtual bool GetUserStat(steam_id steamIDUser, const char* pchName, float* pData);
virtual bool GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved);
virtual bool SetUserStat(steam_id steamIDUser, const char* pchName, int32_t nData);
virtual bool SetUserStat(steam_id steamIDUser, const char* pchName, float fData);
virtual bool UpdateUserAvgRateStat(steam_id steamIDUser, const char* pchName, float flCountThisSession,
double dSessionLength);
virtual bool SetUserAchievement(steam_id steamIDUser, const char* pchName);
virtual bool ClearUserAchievement(steam_id steamIDUser, const char* pchName);
virtual uint64_t StoreUserStats(steam_id steamIDUser);
};
}

View File

@ -0,0 +1,137 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam
{
HTTPRequestHandle http::http::CreateHTTPRequest(uint32_t eHTTPRequestMethod, const char* pchAbsoluteURL)
{
return 0;
}
bool http::SetHTTPRequestContextValue(HTTPRequestHandle hRequest, uint64_t ulContextValue)
{
return false;
}
bool http::SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint32_t unTimeoutSeconds)
{
return false;
}
bool http::SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName,
const char* pchHeaderValue)
{
return false;
}
bool http::SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, const char* pchParamName,
const char* pchParamValue)
{
return false;
}
bool http::SendHTTPRequest(HTTPRequestHandle hRequest, uint64_t* pCallHandle)
{
return false;
}
bool http::SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, uint64_t* pCallHandle)
{
return false;
}
bool http::DeferHTTPRequest(HTTPRequestHandle hRequest)
{
return false;
}
bool http::PrioritizeHTTPRequest(HTTPRequestHandle hRequest)
{
return false;
}
bool http::GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, const char* pchHeaderName,
uint32_t* unResponseHeaderSize)
{
return false;
}
bool http::GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName,
uint8_t* pHeaderValueBuffer, uint32_t unBufferSize)
{
return false;
}
bool http::GetHTTPResponseBodySize(HTTPRequestHandle hRequest, uint32_t* unBodySize)
{
return false;
}
bool http::GetHTTPResponseBodyData(HTTPRequestHandle hRequest, uint8_t* pBodyDataBuffer, uint32_t unBufferSize)
{
return false;
}
bool http::GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint32_t cOffset, uint8_t* pBodyDataBuffer,
uint32_t unBufferSize)
{
return false;
}
bool http::ReleaseHTTPRequest(HTTPRequestHandle hRequest)
{
return false;
}
bool http::GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, float* pflPercentOut)
{
return false;
}
bool http::SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, const char* pchContentType, uint8_t* pubBody,
uint32_t unBodyLen)
{
return false;
}
HTTPCookieContainerHandle http::CreateCookieContainer(bool bAllowResponsesToModify)
{
return 0;
}
bool http::ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer)
{
return false;
}
bool http::SetCookie(HTTPCookieContainerHandle hCookieContainer, const char* pchHost, const char* pchUrl,
const char* pchCookie)
{
return false;
}
bool http::SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer)
{
return false;
}
bool http::SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, const char* pchUserAgentInfo)
{
return false;
}
bool http::SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate)
{
return false;
}
bool http::SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint32_t unMilliseconds)
{
return false;
}
bool http::GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, bool* pbWasTimedOut)
{
return false;
}
}

View File

@ -0,0 +1,49 @@
#pragma once
namespace steam
{
using HTTPRequestHandle = uint64_t;
using HTTPCookieContainerHandle = uint64_t;
class http
{
public:
~http() = default;
virtual HTTPRequestHandle CreateHTTPRequest(uint32_t eHTTPRequestMethod, const char* pchAbsoluteURL);
virtual bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, uint64_t ulContextValue);
virtual bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint32_t unTimeoutSeconds);
virtual bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName,
const char* pchHeaderValue);
virtual bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, const char* pchParamName,
const char* pchParamValue);
virtual bool SendHTTPRequest(HTTPRequestHandle hRequest, uint64_t* pCallHandle);
virtual bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, uint64_t* pCallHandle);
virtual bool DeferHTTPRequest(HTTPRequestHandle hRequest);
virtual bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest);
virtual bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, const char* pchHeaderName,
uint32_t* unResponseHeaderSize);
virtual bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, const char* pchHeaderName,
uint8_t* pHeaderValueBuffer, uint32_t unBufferSize);
virtual bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, uint32_t* unBodySize);
virtual bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, uint8_t* pBodyDataBuffer,
uint32_t unBufferSize);
virtual bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint32_t cOffset,
uint8_t* pBodyDataBuffer, uint32_t unBufferSize);
virtual bool ReleaseHTTPRequest(HTTPRequestHandle hRequest);
virtual bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, float* pflPercentOut);
virtual bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, const char* pchContentType, uint8_t* pubBody,
uint32_t unBodyLen);
virtual HTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify);
virtual bool ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer);
virtual bool SetCookie(HTTPCookieContainerHandle hCookieContainer, const char* pchHost, const char* pchUrl,
const char* pchCookie);
virtual bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest,
HTTPCookieContainerHandle hCookieContainer);
virtual bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, const char* pchUserAgentInfo);
virtual bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest,
bool bRequireVerifiedCertificate);
virtual bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint32_t unMilliseconds);
virtual bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, bool* pbWasTimedOut);
};
}

View File

@ -0,0 +1,92 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam
{
void* matchmaking_servers::RequestInternetServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse)
{
return reinterpret_cast<void*>(1);
}
void* matchmaking_servers::RequestLANServerList(unsigned int iApp,
matchmaking_server_list_response* pRequestServersResponse)
{
return reinterpret_cast<void*>(2);
}
void* matchmaking_servers::RequestFriendsServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse)
{
return reinterpret_cast<void*>(3);
}
void* matchmaking_servers::RequestFavoritesServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse)
{
return reinterpret_cast<void*>(4);
}
void* matchmaking_servers::RequestHistoryServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse)
{
return reinterpret_cast<void*>(5);
}
void* matchmaking_servers::RequestSpectatorServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse)
{
return reinterpret_cast<void*>(6);
}
void matchmaking_servers::ReleaseRequest(void* hServerListRequest)
{
}
gameserveritem_t* matchmaking_servers::GetServerDetails(void* hRequest, int iServer)
{
return nullptr;
}
void matchmaking_servers::CancelQuery(void* hRequest)
{
}
void matchmaking_servers::RefreshQuery(void* hRequest)
{
}
bool matchmaking_servers::IsRefreshing(void* hRequest)
{
return false;
}
int matchmaking_servers::GetServerCount(void* hRequest)
{
return 0;
}
void matchmaking_servers::RefreshServer(void* hRequest, int iServer)
{
}
void* matchmaking_servers::PingServer(unsigned int unIP, unsigned short usPort,
matchmaking_ping_response* pRequestServersResponse)
{
return nullptr;
}
int matchmaking_servers::PlayerDetails(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse)
{
return 0;
}
int matchmaking_servers::ServerRules(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse)
{
return 0;
}
void matchmaking_servers::CancelServerQuery(int hServerQuery)
{
}
}

View File

@ -0,0 +1,87 @@
#pragma once
namespace steam
{
typedef enum EMatchMakingServerResponse
{
eServerResponded = 0,
eServerFailedToRespond,
eNoServersListedOnMasterServer
} matchmaking_server_response;
class servernetadr_t
{
public:
uint16_t m_usConnectionPort;
uint16_t m_usQueryPort;
uint32_t m_unIP;
};
class gameserveritem_t
{
public:
servernetadr_t m_NetAdr;
int m_nPing;
bool m_bHadSuccessfulResponse;
bool m_bDoNotRefresh;
char m_szGameDir[32];
char m_szMap[32];
char m_szGameDescription[64];
uint32_t m_nAppID;
int m_nPlayers;
int m_nMaxPlayers;
int m_nBotPlayers;
bool m_bPassword;
bool m_bSecure;
uint32_t m_ulTimeLastPlayed;
int m_nServerVersion;
char m_szServerName[64];
char m_szGameTags[128];
steam_id m_steamID;
};
class matchmaking_ping_response
{
public:
virtual void ServerResponded(gameserveritem_t& server) = 0;
virtual void ServerFailedToRespond() = 0;
};
class matchmaking_server_list_response
{
public:
virtual void ServerResponded(void* hRequest, int iServer) = 0;
virtual void ServerFailedToRespond(void* hRequest, int iServer) = 0;
virtual void RefreshComplete(void* hRequest, matchmaking_server_response response) = 0;
};
class matchmaking_servers
{
public:
~matchmaking_servers() = default;
virtual void* RequestInternetServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse);
virtual void* RequestLANServerList(unsigned int iApp,
matchmaking_server_list_response* pRequestServersResponse);
virtual void* RequestFriendsServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse);
virtual void* RequestFavoritesServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse);
virtual void* RequestHistoryServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse);
virtual void* RequestSpectatorServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
matchmaking_server_list_response* pRequestServersResponse);
virtual void ReleaseRequest(void* hServerListRequest);
virtual gameserveritem_t* GetServerDetails(void* hRequest, int iServer);
virtual void CancelQuery(void* hRequest);
virtual void RefreshQuery(void* hRequest);
virtual bool IsRefreshing(void* hRequest);
virtual int GetServerCount(void* hRequest);
virtual void RefreshServer(void* hRequest, int iServer);
virtual void* PingServer(unsigned int unIP, unsigned short usPort, matchmaking_ping_response* pRequestServersResponse);
virtual int PlayerDetails(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse);
virtual int ServerRules(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse);
virtual void CancelServerQuery(int hServerQuery);
};
}

View File

@ -0,0 +1,39 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam
{
uint64_t screenshots::WriteScreenshot(void* pubRGB, uint32_t cubRGB, int nWidth, int nHeight)
{
return 0;
}
uint64_t screenshots::AddScreenshotToLibrary(const char* pchFilename, const char* pchThumbnailFilename, int nWidth,
int nHeight)
{
return 0;
}
void screenshots::TriggerScreenshot()
{
}
void screenshots::HookScreenshots(bool bHook)
{
}
bool screenshots::SetLocation(uint64_t hScreenshot, const char* pchLocation)
{
return false;
}
bool screenshots::TagUser(uint64_t hScreenshot, steam_id steamID)
{
return false;
}
bool screenshots::TagPublishedFile(uint64_t hScreenshot, uint64_t unPublishedFileID)
{
return false;
}
}

View File

@ -0,0 +1,19 @@
#pragma once
namespace steam
{
class screenshots
{
public:
~screenshots() = default;
virtual uint64_t WriteScreenshot(void* pubRGB, uint32_t cubRGB, int nWidth, int nHeight);
virtual uint64_t AddScreenshotToLibrary(const char* pchFilename, const char* pchThumbnailFilename, int nWidth,
int nHeight);
virtual void TriggerScreenshot();
virtual void HookScreenshots(bool bHook);
virtual bool SetLocation(uint64_t hScreenshot, const char* pchLocation);
virtual bool TagUser(uint64_t hScreenshot, steam_id steamID);
virtual bool TagPublishedFile(uint64_t hScreenshot, uint64_t unPublishedFileID);
};
}

View File

@ -0,0 +1,34 @@
#include <std_include.hpp>
#include "../steam.hpp"
namespace steam
{
ClientUnifiedMessageHandle unified_messages::SendMethod(const char* pchServiceMethod, const void* pRequestBuffer,
uint32_t unRequestBufferSize, uint64_t unContext)
{
return 0;
}
bool unified_messages::GetMethodResponseInfo(ClientUnifiedMessageHandle hHandle, uint32_t* punResponseSize,
uint32_t* peResult)
{
return false;
}
bool unified_messages::GetMethodResponseData(ClientUnifiedMessageHandle hHandle, void* pResponseBuffer,
uint32_t unResponseBufferSize, bool bAutoRelease)
{
return false;
}
bool unified_messages::ReleaseMethod(ClientUnifiedMessageHandle hHandle)
{
return false;
}
bool unified_messages::SendNotification(const char* pchServiceNotification, const void* pNotificationBuffer,
uint32_t unNotificationBufferSize)
{
return false;
}
}

View File

@ -0,0 +1,22 @@
#pragma once
namespace steam
{
using ClientUnifiedMessageHandle = uint64_t;
class unified_messages
{
public:
~unified_messages() = default;
virtual ClientUnifiedMessageHandle SendMethod(const char* pchServiceMethod, const void* pRequestBuffer,
uint32_t unRequestBufferSize, uint64_t unContext);
virtual bool GetMethodResponseInfo(ClientUnifiedMessageHandle hHandle, uint32_t* punResponseSize,
uint32_t* peResult);
virtual bool GetMethodResponseData(ClientUnifiedMessageHandle hHandle, void* pResponseBuffer,
uint32_t unResponseBufferSize, bool bAutoRelease);
virtual bool ReleaseMethod(ClientUnifiedMessageHandle hHandle);
virtual bool SendNotification(const char* pchServiceNotification, const void* pNotificationBuffer,
uint32_t unNotificationBufferSize);
};
}

View File

@ -19,7 +19,7 @@ namespace steam
int user::GetHSteamUser()
{
return NULL;
return 1;
}
bool user::LoggedOn()
@ -71,7 +71,7 @@ namespace steam
unsigned int cbUncompressedDestBufferSize, unsigned int* nUncompressBytesWritten,
unsigned int nUncompressedVoiceDesiredSampleRate)
{
return 0;
return 2;
}
int user::DecompressVoice(void* pCompressed, unsigned int cbCompressed, void* pDestBuffer,
@ -87,6 +87,7 @@ namespace steam
unsigned int user::GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
{
static uint32_t ticket = 0;
*pcbTicket = 1;
@ -116,7 +117,7 @@ namespace steam
unsigned int user::UserHasLicenseForApp(steam_id steamID, unsigned int appID)
{
return 0;
return 1;
}
bool user::BIsBehindNAT()
@ -140,7 +141,8 @@ namespace steam
// Create the call response
const auto result = callbacks::register_call();
const auto retvals = static_cast<encrypted_app_ticket_response*>(calloc(1, sizeof(encrypted_app_ticket_response)));
const auto retvals = static_cast<encrypted_app_ticket_response*>(calloc(
1, sizeof(encrypted_app_ticket_response)));
//::Utils::Memory::AllocateArray<EncryptedAppTicketResponse>();
retvals->m_e_result = 1;
@ -155,10 +157,51 @@ namespace steam
{
if (cbMaxTicket < 0 || auth_ticket.empty()) return false;
const auto size = std::min(size_t(cbMaxTicket), auth_ticket.size());
const auto size = auth_ticket.size();
if (size_t(cbMaxTicket) < size)
{
*pcbTicket = static_cast<unsigned>(size);
return false;
}
std::memcpy(pTicket, auth_ticket.data(), size);
*pcbTicket = static_cast<unsigned>(size);
return true;
}
int user::GetGameBadgeLevel(int nSeries, bool bFoil)
{
return 1;
}
int user::GetPlayerSteamLevel()
{
return 0;
}
uint64_t user::RequestStoreAuthURL(const char* pchRedirectURL)
{
return 0;
}
bool user::BIsPhoneVerified()
{
return true;
}
bool user::BIsTwoFactorEnabled()
{
return true;
}
bool user::BIsPhoneIdentifying()
{
return false;
}
bool user::BIsPhoneRequiringVerification()
{
return false;
}
}

View File

@ -51,5 +51,13 @@ namespace steam
virtual void AdvertiseGame(steam_id steamIDGameServer, unsigned int unIPServer, unsigned short usPortServer);
virtual unsigned long long RequestEncryptedAppTicket(void* pUserData, int cbUserData);
virtual bool GetEncryptedAppTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket);
virtual int GetGameBadgeLevel(int nSeries, bool bFoil);
virtual int GetPlayerSteamLevel();
virtual uint64_t RequestStoreAuthURL(const char* pchRedirectURL);
virtual bool BIsPhoneVerified();
virtual bool BIsTwoFactorEnabled();
virtual bool BIsPhoneIdentifying();
virtual bool BIsPhoneRequiringVerification();
};
}

View File

@ -3,8 +3,38 @@
namespace steam
{
namespace
{
struct user_stats_received
{
enum { callback_id = 1101 };
uint64_t m_n_game_id;
int m_e_result;
steam_id m_steam_id_user;
};
}
bool user_stats::RequestCurrentStats()
{
static uint32_t ticket = 0;
game_id game{};
game.raw.mod_id = 0;
game.raw.type = 0;
game.raw.app_id = SteamUtils()->GetAppID();
const auto result = callbacks::register_call();
auto* response = static_cast<user_stats_received*>(calloc(
1, sizeof(user_stats_received)));
const auto id = SteamUser()->GetSteamID();
response->m_steam_id_user = id;
response->m_e_result = 1; // k_EResultOK;
response->m_n_game_id = game.bits;
callbacks::return_call(response, sizeof(user_stats_received),
user_stats_received::callback_id, result);
return true;
}
@ -20,12 +50,12 @@ namespace steam
bool user_stats::SetStat(const char* pchName, int nData)
{
return false;
return true;
}
bool user_stats::SetStat(const char* pchName, float fData)
{
return false;
return true;
}
bool user_stats::UpdateAvgRateStat(const char* pchName, float flCountThisSession, double dSessionLength)

View File

@ -120,4 +120,27 @@ namespace steam
{
return false;
}
const char* utils::GetSteamUILanguage()
{
return "english";
}
bool utils::IsSteamRunningInVR()
{
return false;
}
void utils::SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset)
{
}
bool utils::IsSteamInBigPictureMode()
{
return false;
}
void utils::StartVRDashboard()
{
}
}

View File

@ -33,5 +33,11 @@ namespace steam
unsigned int uMaxLength);
virtual unsigned int GetEnteredGamepadTextLength();
virtual bool GetEnteredGamepadTextInput(char* pchValue, unsigned int cchValueMax);
virtual const char* GetSteamUILanguage();
virtual bool IsSteamRunningInVR();
virtual void SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset);
virtual bool IsSteamInBigPictureMode();
virtual void StartVRDashboard();
};
}

View File

@ -2,6 +2,7 @@
#include "steam.hpp"
#include <utils/nt.hpp>
#include <utils/io.hpp>
#include "loader/component_loader.hpp"
@ -112,15 +113,13 @@ namespace steam
bool SteamAPI_Init()
{
const std::filesystem::path steam_path = steam::SteamAPI_GetSteamInstallPath();
const std::filesystem::path steam_path = SteamAPI_GetSteamInstallPath();
if (steam_path.empty()) return false;
::utils::nt::library::load(steam_path / "tier0_s64.dll");
::utils::nt::library::load(steam_path / "vstdlib_s64.dll");
::utils::nt::library::load(steam_path / "gameoverlayrenderer64.dll");
::utils::nt::library::load(steam_path / "steamclient64.dll");
component_loader::post_unpack();
return true;
}
@ -178,6 +177,43 @@ namespace steam
return install_path.data();
}
void* SteamGameServer_GetHSteamPipe()
{
return reinterpret_cast<void*>(1);
}
void* SteamGameServer_GetHSteamUser()
{
return reinterpret_cast<void*>(1);
}
void* SteamAPI_GetHSteamUser()
{
return reinterpret_cast<void*>(1);
}
void* SteamAPI_GetHSteamPipe()
{
return reinterpret_cast<void*>(1);
}
void* SteamInternal_CreateInterface(const char* interfacename)
{
if (std::string(interfacename) == "SteamClient017")
{
static client c;
return &c;
}
MessageBoxA(0, interfacename, __FUNCTION__, 0);
return nullptr;
}
bool SteamInternal_GameServer_Init()
{
return true;
}
bool SteamGameServer_Init()
{
@ -248,4 +284,4 @@ namespace steam
}
}
}
}

View File

@ -39,7 +39,14 @@ typedef union
#include "interfaces/game_server.hpp"
#include "interfaces/networking.hpp"
#include "interfaces/matchmaking.hpp"
#include "interfaces/matchmaking_servers.hpp"
#include "interfaces/remote_storage.hpp"
#include "interfaces/screenshots.hpp"
#include "interfaces/game_server_stats.hpp"
#include "interfaces/http.hpp"
#include "interfaces/unified_messages.hpp"
#include "interfaces/controller.hpp"
#include "interfaces/client.hpp"
namespace steam
{
@ -105,6 +112,15 @@ namespace steam
STEAM_EXPORT void SteamAPI_UnregisterCallback(callbacks::base* handler);
STEAM_EXPORT const char* SteamAPI_GetSteamInstallPath();
STEAM_EXPORT void* SteamGameServer_GetHSteamPipe();
STEAM_EXPORT void* SteamGameServer_GetHSteamUser();
STEAM_EXPORT void* SteamAPI_GetHSteamUser();
STEAM_EXPORT void* SteamAPI_GetHSteamPipe();
STEAM_EXPORT void* SteamInternal_CreateInterface(const char* interfacename);
STEAM_EXPORT bool SteamInternal_GameServer_Init();
STEAM_EXPORT bool SteamGameServer_Init();
STEAM_EXPORT void SteamGameServer_RunCallbacks();
STEAM_EXPORT void SteamGameServer_Shutdown();

View File

@ -345,22 +345,22 @@ namespace utils::hook
}
}
bool iat(const nt::library& library, const std::string& target_library, const std::string& process, void* stub)
std::optional<std::pair<void*, void*>> iat(const nt::library& library, const std::string& target_library, const std::string& process, void* stub)
{
if (!library.is_valid()) return false;
if (!library.is_valid()) return {};
auto* const ptr = library.get_iat_entry(target_library, process);
if (!ptr) return false;
if (!ptr) return {};
store_original_data(ptr, sizeof(*ptr));
DWORD protect;
VirtualProtect(ptr, sizeof(*ptr), PAGE_EXECUTE_READWRITE, &protect);
*ptr = stub;
std::swap(*ptr, stub);
VirtualProtect(ptr, sizeof(*ptr), protect, &protect);
return true;
return { {ptr, stub} };
}
void nop(void* place, const size_t length)

View File

@ -147,7 +147,7 @@ namespace utils::hook
void un_move();
};
bool iat(const nt::library& library, const std::string& target_library, const std::string& process, void* stub);
std::optional<std::pair<void*, void*>> iat(const nt::library& library, const std::string& target_library, const std::string& process, void* stub);
void nop(void* place, size_t length);
void nop(size_t place, size_t length);

View File

@ -12,10 +12,11 @@ namespace utils::nt
return library::load(path.generic_string());
}
library library::get_by_address(void* address)
library library::get_by_address(const void* address)
{
HMODULE handle = nullptr;
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, static_cast<LPCSTR>(address), &handle);
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
static_cast<LPCSTR>(address), &handle);
return library(handle);
}
@ -93,7 +94,7 @@ namespace utils::nt
DWORD protection;
VirtualProtect(this->get_ptr(), this->get_optional_header()->SizeOfImage, PAGE_EXECUTE_READWRITE,
&protection);
&protection);
}
size_t library::get_relative_entry_point() const
@ -128,7 +129,7 @@ namespace utils::nt
{
if (!this->is_valid()) return "";
char name[MAX_PATH] = {0};
char name[MAX_PATH] = { 0 };
GetModuleFileNameA(this->module_, name, sizeof name);
return name;
@ -183,16 +184,22 @@ namespace utils::nt
while (original_thunk_data->u1.AddressOfData)
{
const size_t ordinal_number = original_thunk_data->u1.AddressOfData & 0xFFFFFFF;
if (ordinal_number > 0xFFFF) continue;
if (GetProcAddress(other_module.module_, reinterpret_cast<char*>(ordinal_number)) ==
target_function)
if (thunk_data->u1.Function == (uint64_t)target_function)
{
return reinterpret_cast<void**>(&thunk_data->u1.Function);
}
const size_t ordinal_number = original_thunk_data->u1.AddressOfData & 0xFFFFFFF;
if (ordinal_number <= 0xFFFF)
{
if (GetProcAddress(other_module.module_, reinterpret_cast<char*>(ordinal_number)) ==
target_function)
{
return reinterpret_cast<void**>(&thunk_data->u1.Function);
}
}
++original_thunk_data;
++thunk_data;
}
@ -206,6 +213,17 @@ namespace utils::nt
return nullptr;
}
bool is_shutdown_in_progress()
{
static auto* shutdown_in_progress = []
{
const library ntdll("ntdll.dll");
return ntdll.get_proc<BOOLEAN(*)()>("RtlDllShutdownInProgress");
}();
return shutdown_in_progress();
}
void raise_hard_exception()
{
int data = false;
@ -241,7 +259,7 @@ namespace utils::nt
auto* const command_line = GetCommandLineA();
CreateProcessA(self.get_path().data(), command_line, nullptr, nullptr, false, NULL, nullptr, current_dir,
&startup_info, &process_info);
&startup_info, &process_info);
if (process_info.hThread && process_info.hThread != INVALID_HANDLE_VALUE) CloseHandle(process_info.hThread);
if (process_info.hProcess && process_info.hProcess != INVALID_HANDLE_VALUE) CloseHandle(process_info.hProcess);

View File

@ -23,7 +23,7 @@ namespace utils::nt
public:
static library load(const std::string& name);
static library load(const std::filesystem::path& path);
static library get_by_address(void* address);
static library get_by_address(const void* address);
library();
explicit library(const std::string& name);
@ -102,6 +102,71 @@ namespace utils::nt
HMODULE module_;
};
template <HANDLE InvalidHandle = nullptr>
class handle
{
public:
handle() = default;
handle(const HANDLE h)
: handle_(h)
{
}
~handle()
{
if (*this)
{
CloseHandle(this->handle_);
this->handle_ = InvalidHandle;
}
}
handle(const handle&) = delete;
handle& operator=(const handle&) = delete;
handle(handle&& obj) noexcept
: handle()
{
this->operator=(std::move(obj));
}
handle& operator=(handle&& obj) noexcept
{
if (this != &obj)
{
this->~handle();
this->handle_ = obj.handle_;
obj.handle_ = InvalidHandle;
}
return *this;
}
handle& operator=(HANDLE h) noexcept
{
this->~handle();
this->handle_ = h;
return *this;
}
operator bool() const
{
return this->handle_ != InvalidHandle;
}
operator HANDLE() const
{
return this->handle_;
}
private:
HANDLE handle_{ InvalidHandle };
};
bool is_shutdown_in_progress();
__declspec(noreturn) void raise_hard_exception();
std::string load_resource(int id);