Compare commits

...
Author SHA1 Message Date
dependabot[bot] c0cb0c14de build(deps): bump deps/libtomcrypt from a3cc5bf to 6c6d510
Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `a3cc5bf` to `6c6d510`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](https://github.com/libtom/libtomcrypt/compare/a3cc5bf62341b7269ace805fa227b701ddae4165...6c6d5104de66f3ca0dfd7b68540ef86869982b07)

---
updated-dependencies:
- dependency-name: deps/libtomcrypt
  dependency-version: 6c6d5104de66f3ca0dfd7b68540ef86869982b07
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-01 16:42:38 +00:00
Future 73eed087bc Merge pull request #142 from diamante0018/dependabot/submodules/deps/GSL-417ef68
build(deps): bump deps/GSL from `a75212b` to `417ef68`
2026-09-04 09:53:28 +02:00
Future 01d89de1da fix(deps): this lib trolls
Signed-off-by: diamante0018 <[email protected]>
2026-09-04 09:50:04 +02:00
Future e8aa411b53 Merge pull request #143 from diamante0018/dependabot/submodules/deps/libtomcrypt-a10cad6
build(deps): bump deps/libtomcrypt from `a3cc5bf` to `a10cad6`
2026-09-01 18:44:34 +02:00
dependabot[bot] efcea8693d build(deps): bump deps/libtomcrypt from a3cc5bf to a10cad6
Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `a3cc5bf` to `a10cad6`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](https://github.com/libtom/libtomcrypt/compare/a3cc5bf62341b7269ace805fa227b701ddae4165...a10cad624d58b4112335f3dc82e42967afdbe143)

---
updated-dependencies:
- dependency-name: deps/libtomcrypt
  dependency-version: a10cad624d58b4112335f3dc82e42967afdbe143
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-09-01 16:42:45 +00:00
dependabot[bot] e23fa9bdf5 build(deps): bump deps/GSL from a75212b to 417ef68
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `a75212b` to `417ef68`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/a75212b9f3b14162edd62d540cbf9273d5a59d20...417ef685eafd626db765f0027b7fc5a0057e0770)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: 417ef685eafd626db765f0027b7fc5a0057e0770
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-09-01 16:42:39 +00:00
Future f8382d54c8 Merge pull request #141 from diamante0018/dependabot/submodules/deps/GSL-a75212b
build(deps): bump deps/GSL from `b2f6bec` to `a75212b`
2026-08-02 20:29:06 +02:00
dependabot[bot] 0e06c71b54 build(deps): bump deps/GSL from b2f6bec to a75212b
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `b2f6bec` to `a75212b`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/b2f6bec48e27381b2e11d650ce7e4b899b446289...a75212b9f3b14162edd62d540cbf9273d5a59d20)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: a75212b9f3b14162edd62d540cbf9273d5a59d20
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-08-01 16:42:34 +00:00
Future 4158a70738 Merge pull request #139 from diamante0018/dependabot/submodules/deps/GSL-b2f6bec
build(deps): bump deps/GSL from `f3c5967` to `b2f6bec`
2026-07-02 07:46:37 +02:00
dependabot[bot] e2de98fcdd build(deps): bump deps/GSL from f3c5967 to b2f6bec
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `f3c5967` to `b2f6bec`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/f3c596712651dab987091e47ca8b6b20c6806e24...b2f6bec48e27381b2e11d650ce7e4b899b446289)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: b2f6bec48e27381b2e11d650ce7e4b899b446289
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-07-01 16:42:23 +00:00
Future 6bbf175089 Merge pull request #138 from diamante0018/dependabot/submodules/deps/GSL-f3c5967
build(deps): bump deps/GSL from `0249144` to `f3c5967`
2026-06-03 09:24:08 +02:00
dependabot[bot] 303459ff42 build(deps): bump deps/GSL from 0249144 to f3c5967
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `0249144` to `f3c5967`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/0249144ad1487bea10a2b553918e581c0c16a1c5...f3c596712651dab987091e47ca8b6b20c6806e24)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: f3c596712651dab987091e47ca8b6b20c6806e24
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-06-03 00:04:08 +00:00
Future d04c1ea131 Merge pull request #135 from diamante0018/dependabot/submodules/deps/libtommath-ae40a87
build(deps): bump deps/libtommath from `839ae9e` to `ae40a87`
2026-05-02 21:23:21 +02:00
dependabot[bot] 9310d8cc63 build(deps): bump deps/libtommath from 839ae9e to ae40a87
Bumps [deps/libtommath](https://github.com/libtom/libtommath) from `839ae9e` to `ae40a87`.
- [Release notes](https://github.com/libtom/libtommath/releases)
- [Commits](https://github.com/libtom/libtommath/compare/839ae9ea66718705fba2b5773d1bdfb2b457cea4...ae40a87a920099a7d9d00979570e0c8d917a1fd7)

---
updated-dependencies:
- dependency-name: deps/libtommath
  dependency-version: ae40a87a920099a7d9d00979570e0c8d917a1fd7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-05-01 19:58:05 +00:00
Future 88b7bcf18b Merge pull request #134 from diamante0018/dependabot/submodules/deps/GSL-0249144
build(deps): bump deps/GSL from `756c91a` to `0249144`
2026-04-11 17:40:16 +02:00
dependabot[bot] a8ef28fb29 build(deps): bump deps/GSL from 756c91a to 0249144
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `756c91a` to `0249144`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/756c91ab895aa52f650599bb1a3fc131f1f4b5ef...0249144ad1487bea10a2b553918e581c0c16a1c5)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: '0249144ad1487bea10a2b553918e581c0c16a1c5'
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-04-01 21:22:27 +00:00
Future 88add1a131 chore: update Premake5 2026-01-30 11:12:00 +01:00
Future c4cd3b209c Merge pull request #132 from diamante0018/dependabot/submodules/deps/GSL-756c91a
build(deps): bump deps/GSL from `543d0dd` to `756c91a`
2026-01-01 17:02:59 +01:00
dependabot[bot] 4c00efca91 build(deps): bump deps/GSL from 543d0dd to 756c91a
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `543d0dd` to `756c91a`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/543d0dd3fe966ddf20e884b44e5fdbf12cb43784...756c91ab895aa52f650599bb1a3fc131f1f4b5ef)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: 756c91ab895aa52f650599bb1a3fc131f1f4b5ef
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-01-01 16:01:04 +00:00
Future 4ced494aad Merge pull request #130 from diamante0018/dependabot/submodules/deps/GSL-543d0dd
build(deps): bump deps/GSL from `494e6e9` to `543d0dd`
2025-11-01 18:10:02 +01:00
Future 1fb68ae92c Merge pull request #129 from diamante0018/dependabot/submodules/deps/libtomcrypt-a3cc5bf
build(deps): bump deps/libtomcrypt from `5edb54e` to `a3cc5bf`
2025-11-01 18:04:02 +01:00
dependabot[bot] b336bf7ff8 build(deps): bump deps/GSL from 494e6e9 to 543d0dd
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `494e6e9` to `543d0dd`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/494e6e988cc55d0bc7f3763c076ec358a38c68a6...543d0dd3fe966ddf20e884b44e5fdbf12cb43784)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: 543d0dd3fe966ddf20e884b44e5fdbf12cb43784
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-11-01 16:01:07 +00:00
dependabot[bot] d4ec05ea12 build(deps): bump deps/libtomcrypt from 5edb54e to a3cc5bf
Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `5edb54e` to `a3cc5bf`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](https://github.com/libtom/libtomcrypt/compare/5edb54e52292c90113af6b3a72fd9147ba727f86...a3cc5bf62341b7269ace805fa227b701ddae4165)

---
updated-dependencies:
- dependency-name: deps/libtomcrypt
  dependency-version: a3cc5bf62341b7269ace805fa227b701ddae4165
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-11-01 16:01:04 +00:00
Future a7fc918745 Merge pull request #127 from diamante0018/dependabot/submodules/deps/GSL-494e6e9
build(deps): bump deps/GSL from `7e0943d` to `494e6e9`
2025-10-01 18:10:57 +02:00
Future 87540b7343 Merge pull request #128 from diamante0018/dependabot/submodules/deps/libtomcrypt-5edb54e
build(deps): bump deps/libtomcrypt from `d448df1` to `5edb54e`
2025-10-01 18:04:56 +02:00
dependabot[bot] d861da1ff1 build(deps): bump deps/libtomcrypt from d448df1 to 5edb54e
Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `d448df1` to `5edb54e`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](https://github.com/libtom/libtomcrypt/compare/d448df1938e8988bcdb0eed6591387e82b26874b...5edb54e52292c90113af6b3a72fd9147ba727f86)

---
updated-dependencies:
- dependency-name: deps/libtomcrypt
  dependency-version: 5edb54e52292c90113af6b3a72fd9147ba727f86
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-10-01 16:01:48 +00:00
dependabot[bot] 80150c051a build(deps): bump deps/GSL from 7e0943d to 494e6e9
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `7e0943d` to `494e6e9`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/7e0943d20d3082b4f350a7e0c3088d2388e934de...494e6e988cc55d0bc7f3763c076ec358a38c68a6)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: 494e6e988cc55d0bc7f3763c076ec358a38c68a6
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-10-01 16:01:47 +00:00
Future 4d9fcb349e Merge pull request #126 from diamante0018/dependabot/submodules/deps/libtommath-839ae9e
build(deps): bump deps/libtommath from `e823b0c` to `839ae9e`
2025-07-02 15:13:50 +02:00
dependabot[bot] 73f497e0c7 build(deps): bump deps/libtommath from e823b0c to 839ae9e
Bumps [deps/libtommath](https://github.com/libtom/libtommath) from `e823b0c` to `839ae9e`.
- [Release notes](https://github.com/libtom/libtommath/releases)
- [Commits](https://github.com/libtom/libtommath/compare/e823b0c34cea291bdb94d672731e1c1f08525557...839ae9ea66718705fba2b5773d1bdfb2b457cea4)

---
updated-dependencies:
- dependency-name: deps/libtommath
  dependency-version: 839ae9ea66718705fba2b5773d1bdfb2b457cea4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-07-01 16:56:45 +00:00
Future d5d580c0c3 chore: update Windows 2025-06-03 10:36:37 +02:00
Future acf32bb740 Merge pull request #125 from diamante0018/dependabot/submodules/deps/libtomcrypt-d448df1
build(deps): bump deps/libtomcrypt from `3905c28` to `d448df1`
2025-06-03 10:31:20 +02:00
Future 8c60074d8a Merge pull request #124 from diamante0018/dependabot/submodules/deps/GSL-7e0943d
build(deps): bump deps/GSL from `3325bbd` to `7e0943d`
2025-06-03 10:25:55 +02:00
dependabot[bot] 7e5d8b210c build(deps): bump deps/libtomcrypt from 3905c28 to d448df1
Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `3905c28` to `d448df1`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](https://github.com/libtom/libtomcrypt/compare/3905c28913232d6e82a2a381cc2b71b0af7aa791...d448df1938e8988bcdb0eed6591387e82b26874b)

---
updated-dependencies:
- dependency-name: deps/libtomcrypt
  dependency-version: d448df1938e8988bcdb0eed6591387e82b26874b
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-06-01 16:50:32 +00:00
dependabot[bot] 3ff1a8a957 build(deps): bump deps/GSL from 3325bbd to 7e0943d
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `3325bbd` to `7e0943d`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/3325bbd33d24d1f8f5a0f69e782c92ad5a39a68e...7e0943d20d3082b4f350a7e0c3088d2388e934de)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: 7e0943d20d3082b4f350a7e0c3088d2388e934de
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-06-01 16:50:30 +00:00
Future 2de524fa76 Merge pull request #123 from diamante0018/dependabot/submodules/deps/libtomcrypt-3905c28
build(deps): bump deps/libtomcrypt from `a6b9aff` to `3905c28`
2025-05-01 18:36:59 +02:00
dependabot[bot] 7fe1a30fbe build(deps): bump deps/libtomcrypt from a6b9aff to 3905c28
Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `a6b9aff` to `3905c28`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](https://github.com/libtom/libtomcrypt/compare/a6b9aff7aab857fe1b491710a5c5b9e2be49cb08...3905c28913232d6e82a2a381cc2b71b0af7aa791)

---
updated-dependencies:
- dependency-name: deps/libtomcrypt
  dependency-version: 3905c28913232d6e82a2a381cc2b71b0af7aa791
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-05-01 16:31:23 +00:00
Future 572b71da00 build: add back clang 2025-04-01 19:03:59 +02:00
Future 0541f9d095 chore: update some other stuff 2025-04-01 18:48:40 +02:00
Future e5b8b29a01 build: update Premake5 2025-04-01 18:36:58 +02:00
Future 86a5be8bb2 Merge pull request #122 from diamante0018/dependabot/submodules/deps/GSL-3325bbd
build(deps): bump deps/GSL from `2828399` to `3325bbd`
2025-04-01 18:28:59 +02:00
dependabot[bot] c9eb0efbeb build(deps): bump deps/GSL from 2828399 to 3325bbd
Bumps [deps/GSL](https://github.com/microsoft/GSL) from `2828399` to `3325bbd`.
- [Release notes](https://github.com/microsoft/GSL/releases)
- [Commits](https://github.com/microsoft/GSL/compare/2828399820ef4928cc89b65605dca5dc68efca6e...3325bbd33d24d1f8f5a0f69e782c92ad5a39a68e)

---
updated-dependencies:
- dependency-name: deps/GSL
  dependency-version: 3325bbd33d24d1f8f5a0f69e782c92ad5a39a68e
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-04-01 16:23:04 +00:00
20 changed files with 162 additions and 257 deletions

No files matched your search

+3 -2
View File
@@ -14,12 +14,12 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
PREMAKE_VERSION: "5.0.0-beta5" PREMAKE_VERSION: "5.0.0-beta8"
jobs: jobs:
build: build:
name: Build binaries name: Build binaries
runs-on: windows-2022 runs-on: windows-2025
strategy: strategy:
matrix: matrix:
configuration: configuration:
@@ -27,6 +27,7 @@ jobs:
- release - release
compiler: compiler:
- msvc - msvc
- clang
steps: steps:
- name: Check out files - name: Check out files
uses: actions/checkout@main uses: actions/checkout@main
Vendored
+1 -1
Submodule deps/GSL updated: 2828399820...417ef685ea.
+1 -1
+2 -2
View File
@@ -51,7 +51,7 @@ editandcontinue "Off"
warnings "Extra" warnings "Extra"
characterset "ASCII" characterset "ASCII"
flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"} multiprocessorcompile "On"
filter "platforms:Win*" filter "platforms:Win*"
defines {"_WINDOWS", "WIN32"} defines {"_WINDOWS", "WIN32"}
@@ -60,7 +60,7 @@ filter {}
filter "configurations:release" filter "configurations:release"
optimize "Size" optimize "Size"
defines {"NDEBUG"} defines {"NDEBUG"}
flags {"FatalCompileWarnings"} fatalwarnings {"All"}
filter "toolset:msc*" filter "toolset:msc*"
buildoptions "/GL" buildoptions "/GL"
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
# Navigate to the repository root
cd "$(dirname "$0")/.." || exit 2
# Set the clang-format binary (defaults to 'clang-format')
CLANG_FORMAT_BIN="${CLANG_FORMAT_BIN:-clang-format}"
# Find and format all .hpp and .cpp files in the src directory
find ./src \( -iname '*.hpp' -o -iname '*.cpp' \) -print0 |
xargs -0 "$CLANG_FORMAT_BIN" -i || {
echo "Error: clang-format failed." >&2
exit 1
}
+23 -26
View File
@@ -2,7 +2,6 @@
#include "loader/component_loader.hpp" #include "loader/component_loader.hpp"
#include <utils/hook.hpp> #include <utils/hook.hpp>
#include <utils/thread.hpp>
#include <utils/flags.hpp> #include <utils/flags.hpp>
#include <utils/concurrency.hpp> #include <utils/concurrency.hpp>
@@ -37,8 +36,7 @@ public:
void post_start() override { void post_start() override {
this->terminate_runner_ = false; this->terminate_runner_ = false;
this->console_runner_ = utils::thread::create_named_thread( this->console_runner_ = std::thread([this] { this->runner(); });
"Console IO", [this] { this->runner(); });
} }
void post_unpack() override { void post_unpack() override {
@@ -77,31 +75,30 @@ private:
int handles_[2]{}; int handles_[2]{};
void initialize() { void initialize() {
this->console_thread_ = this->console_thread_ = std::thread([this] {
utils::thread::create_named_thread("Console", [this] { if (!utils::flags::has_flag("noconsole")) {
if (!utils::flags::has_flag("noconsole")) { game::Sys_ShowConsole();
game::Sys_ShowConsole(); }
messages.access(
[&](message_queue&) { this->console_initialized_ = true; });
MSG msg;
while (!this->terminate_runner_) {
if (PeekMessageA(&msg, nullptr, NULL, NULL, PM_REMOVE)) {
if (msg.message == WM_QUIT) {
command::execute("quit", false);
break;
} }
messages.access( TranslateMessage(&msg);
[&](message_queue&) { this->console_initialized_ = true; }); DispatchMessageA(&msg);
} else {
MSG msg; this->log_messages();
while (!this->terminate_runner_) { std::this_thread::sleep_for(1ms);
if (PeekMessageA(&msg, nullptr, NULL, NULL, PM_REMOVE)) { }
if (msg.message == WM_QUIT) { }
command::execute("quit", false); });
break;
}
TranslateMessage(&msg);
DispatchMessageA(&msg);
} else {
this->log_messages();
std::this_thread::sleep_for(1ms);
}
}
});
} }
void log_messages() const { void log_messages() const {
+1 -2
View File
@@ -3,7 +3,6 @@
#include <utils/concurrency.hpp> #include <utils/concurrency.hpp>
#include <utils/hook.hpp> #include <utils/hook.hpp>
#include <utils/thread.hpp>
#include "scheduler.hpp" #include "scheduler.hpp"
@@ -135,7 +134,7 @@ unsigned int thread_id;
class component final : public component_interface { class component final : public component_interface {
public: public:
void post_unpack() override { void post_unpack() override {
thread = utils::thread::create_named_thread("Async Scheduler", [] { thread = std::thread([] {
while (!kill) { while (!kill) {
execute(pipeline::async); execute(pipeline::async);
std::this_thread::sleep_for(10ms); std::this_thread::sleep_for(10ms);
+15 -2
View File
@@ -2,6 +2,19 @@
#include "loader/component_loader.hpp" #include "loader/component_loader.hpp"
namespace { namespace {
std::string get_current_date() {
auto now = std::chrono::system_clock::now();
auto current_time = std::chrono::system_clock::to_time_t(now);
std::tm local_time{};
(void)localtime_s(&local_time, &current_time);
std::stringstream ss;
ss << std::put_time(&local_time, "%Y%m%d_%H%M%S");
return ss.str();
}
LONG WINAPI exception_handler(PEXCEPTION_POINTERS exception_info) { LONG WINAPI exception_handler(PEXCEPTION_POINTERS exception_info) {
if (exception_info->ExceptionRecord->ExceptionCode == 0x406D1388) { if (exception_info->ExceptionRecord->ExceptionCode == 0x406D1388) {
return EXCEPTION_CONTINUE_EXECUTION; return EXCEPTION_CONTINUE_EXECUTION;
@@ -21,8 +34,8 @@ LONG WINAPI exception_handler(PEXCEPTION_POINTERS exception_info) {
| MiniDumpWithFullMemoryInfo // | MiniDumpWithFullMemoryInfo //
| MiniDumpWithThreadInfo; | MiniDumpWithThreadInfo;
const auto file_name = std::format("minidumps\\mw3-server-freezer_{}.dmp", const auto file_name =
game::Sys_Milliseconds()); std::format("minidumps\\mw3-server-freezer_{}.dmp", get_current_date());
const auto file_handle = CreateFileA( const auto file_handle = CreateFileA(
file_name.data(), GENERIC_WRITE | GENERIC_READ, file_name.data(), GENERIC_WRITE | GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS,
+21
View File
@@ -24,4 +24,25 @@ void __declspec(naked) Dvar_SetVariant(dvar_t* /*dvar*/, DvarValue /*value*/,
ret ret
} }
} }
XAssetEntry* db_find_x_asset_entry(int type_, const char* name) {
static DWORD DB_FindXAssetEntry_t = 0x5c88a0;
XAssetEntry* result{};
__asm {
pushad
push name
mov edi, type_
call DB_FindXAssetEntry_t
add esp, 0x4
mov result, eax
popad
}
return result;
}
XAssetEntry* DB_FindXAssetEntry(int type, const char* name) {
return db_find_x_asset_entry(type, name);
}
} // namespace game } // namespace game
+2
View File
@@ -18,6 +18,8 @@ private:
// clang-format off // clang-format off
extern ScreenPlacement* ScrPlace_GetUnsafeFullPlacement(); extern ScreenPlacement* ScrPlace_GetUnsafeFullPlacement();
extern void Dvar_SetVariant(dvar_t* dvar, DvarValue value, DvarSetSource source); extern void Dvar_SetVariant(dvar_t* dvar, DvarValue value, DvarSetSource source);
extern XAssetEntry* DB_FindXAssetEntry(int type, const char* name);
// clang-format on // clang-format on
} // namespace game } // namespace game
+70
View File
@@ -9,6 +9,59 @@ typedef vec_t vec2_t[2];
typedef vec_t vec3_t[3]; typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4]; typedef vec_t vec4_t[4];
struct MaterialTechniqueSet {
const char* name;
unsigned char worldVertFormat;
unsigned char unused[2];
MaterialTechniqueSet* remappedTechniqueSet;
void* techniques[54];
};
struct __declspec(align(8)) GfxDrawSurfFields {
uint64_t unused : 1;
uint64_t primarySortKey : 6;
uint64_t surfType : 4;
uint64_t viewModelRender : 1;
uint64_t sceneLightIndex : 8;
uint64_t useHeroLighting : 1;
uint64_t prepass : 2;
uint64_t materialSortedIndex : 12;
uint64_t customIndex : 5;
uint64_t hasGfxEntIndex : 1;
uint64_t reflectionProbeIndex : 8;
uint64_t objectId : 15;
};
union GfxDrawSurf {
__declspec(align(8)) GfxDrawSurfFields fields;
__declspec(align(8)) uint64_t packed;
};
struct MaterialInfo {
const char* name;
unsigned char gameFlags;
unsigned char sortKey;
unsigned char textureAtlasRowCount;
unsigned char textureAtlasColumnCount;
GfxDrawSurf drawSurf;
unsigned int surfaceTypeBits;
};
struct Material {
MaterialInfo info;
char stateBitsEntry[54];
unsigned char textureCount;
unsigned char constantCount;
unsigned char stateBitsCount;
unsigned char stateFlags;
unsigned char cameraRegion;
MaterialTechniqueSet* techniqueSet;
void* textureTable;
void* constantTable;
void* stateBitsTable;
const char** subMaterials;
};
enum bdLogMessageType { enum bdLogMessageType {
BD_LOG_INFO, BD_LOG_INFO,
BD_LOG_WARNING, BD_LOG_WARNING,
@@ -261,6 +314,8 @@ struct usercmd_s {
int remoteControlMove; int remoteControlMove;
}; };
static_assert(offsetof(usercmd_s, buttons) == 0x4);
enum LocSelInputState { enum LocSelInputState {
LOC_SEL_INPUT_NONE = 0, LOC_SEL_INPUT_NONE = 0,
LOC_SEL_INPUT_CONFIRM = 1, LOC_SEL_INPUT_CONFIRM = 1,
@@ -367,6 +422,21 @@ struct Font_s {
union XAssetHeader { union XAssetHeader {
Font_s* font; Font_s* font;
Material* material;
};
struct XAsset {
int type;
XAssetHeader header;
};
struct XAssetEntry {
XAsset asset;
char zoneIndex;
volatile char inuseMask;
bool printedMissingAsset;
unsigned __int16 nextHash;
unsigned __int16 nextOverride;
}; };
} // namespace game } // namespace game
+3
View File
@@ -80,6 +80,9 @@ WEAK symbol<int(unsigned __int64, const void*, unsigned int)>
WEAK symbol<XAssetHeader(int type, const char* name, int allowCreateDefault)> WEAK symbol<XAssetHeader(int type, const char* name, int allowCreateDefault)>
DB_FindXAssetHeader{0x4B25C0}; DB_FindXAssetHeader{0x4B25C0};
WEAK symbol<int(char* dest, int size, const char* fmt, ...)> Com_sprintf{
0x450CF0};
// Variables // Variables
WEAK symbol<CmdArgs> cmd_args{0x1C96850}; WEAK symbol<CmdArgs> cmd_args{0x1C96850};
WEAK symbol<PlayerKeyState> playerKeys{0xB3A38C}; WEAK symbol<PlayerKeyState> playerKeys{0xB3A38C};
+5 -2
View File
@@ -10,13 +10,16 @@
#include <DbgHelp.h> #include <DbgHelp.h>
#include <algorithm>
#include <cassert> #include <cassert>
#include <cctype> #include <cctype>
#include <cstring> #include <cstring>
#include <algorithm>
#include <chrono>
#include <iomanip>
#include <iostream>
#include <format> #include <format>
#include <functional> #include <functional>
#include <iostream>
#include <mutex> #include <mutex>
#include <queue> #include <queue>
#include <source_location> #include <source_location>
-18
View File
@@ -103,24 +103,6 @@ void hook::quick() {
} }
} }
bool hook::iat(const nt::library module, const std::string& target_module,
const std::string& process, void* stub) {
if (!module.is_valid())
return false;
auto ptr = module.get_iat_entry(target_module, process);
if (!ptr)
return false;
DWORD protect;
VirtualProtect(ptr, sizeof(*ptr), PAGE_EXECUTE_READWRITE, &protect);
*ptr = stub;
VirtualProtect(ptr, sizeof(*ptr), protect, &protect);
return true;
}
hook* hook::uninstall(const bool unprotect) { hook* hook::uninstall(const bool unprotect) {
std::lock_guard _(this->state_mutex_); std::lock_guard _(this->state_mutex_);
-3
View File
@@ -75,9 +75,6 @@ public:
void* get_original() const; void* get_original() const;
void quick(); void quick();
static bool iat(nt::library module, const std::string& target_module,
const std::string& process, void* stub);
static void nop(void* place, size_t length); static void nop(void* place, size_t length);
static void nop(DWORD place, size_t length); static void nop(DWORD place, size_t length);
-56
View File
@@ -135,62 +135,6 @@ void library::free() {
HMODULE library::get_handle() const { return this->module_; } HMODULE library::get_handle() const { return this->module_; }
void** library::get_iat_entry(const std::string& module_name,
const std::string& proc_name) const {
if (!this->is_valid())
return nullptr;
const library other_module(module_name);
if (!other_module.is_valid())
return nullptr;
auto* const target_function = other_module.get_proc<void*>(proc_name);
if (!target_function)
return nullptr;
auto* header = this->get_optional_header();
if (!header)
return nullptr;
auto* import_descriptor = reinterpret_cast<PIMAGE_IMPORT_DESCRIPTOR>(
this->get_ptr() +
header->DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
while (import_descriptor->Name) {
if (!_stricmp(
reinterpret_cast<char*>(this->get_ptr() + import_descriptor->Name),
module_name.data())) {
auto* original_thunk_data = reinterpret_cast<PIMAGE_THUNK_DATA>(
import_descriptor->OriginalFirstThunk + this->get_ptr());
auto* thunk_data = reinterpret_cast<PIMAGE_THUNK_DATA>(
import_descriptor->FirstThunk + this->get_ptr());
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) {
return reinterpret_cast<void**>(&thunk_data->u1.Function);
}
++original_thunk_data;
++thunk_data;
}
// break;
}
++import_descriptor;
}
return nullptr;
}
std::string load_resource(const int id) { std::string load_resource(const int id) {
auto* const res = FindResource(library(), MAKEINTRESOURCE(id), RT_RCDATA); auto* const res = FindResource(library(), MAKEINTRESOURCE(id), RT_RCDATA);
if (!res) if (!res)
-15
View File
@@ -48,27 +48,12 @@ public:
HMODULE get_handle() const; HMODULE get_handle() const;
template <typename T> T get_proc(const std::string& process) const {
if (!this->is_valid())
return T{};
return reinterpret_cast<T>(GetProcAddress(this->module_, process.data()));
}
template <typename T> std::function<T> get(const std::string& process) const {
if (!this->is_valid())
return std::function<T>();
return reinterpret_cast<T*>(this->get_proc<void*>(process));
}
std::vector<PIMAGE_SECTION_HEADER> get_section_headers() const; std::vector<PIMAGE_SECTION_HEADER> get_section_headers() const;
PIMAGE_NT_HEADERS get_nt_headers() const; PIMAGE_NT_HEADERS get_nt_headers() const;
PIMAGE_DOS_HEADER get_dos_header() const; PIMAGE_DOS_HEADER get_dos_header() const;
PIMAGE_OPTIONAL_HEADER get_optional_header() const; PIMAGE_OPTIONAL_HEADER get_optional_header() const;
void** get_iat_entry(const std::string& module_name,
const std::string& proc_name) const;
private: private:
HMODULE module_; HMODULE module_;
}; };
-105
View File
@@ -1,105 +0,0 @@
#include <thread>
#include "nt.hpp"
#include "string.hpp"
#include "thread.hpp"
#include <TlHelp32.h>
#include <gsl/gsl>
namespace utils::thread {
bool set_name(const HANDLE t, const std::string& name) {
const nt::library kernel32("kernel32.dll");
if (!kernel32) {
return false;
}
const auto set_description =
kernel32.get_proc<HRESULT(WINAPI*)(HANDLE, PCWSTR)>(
"SetThreadDescription");
if (!set_description) {
return false;
}
return SUCCEEDED(set_description(t, string::convert(name).data()));
}
bool set_name(const DWORD id, const std::string& name) {
auto* const t = OpenThread(THREAD_SET_LIMITED_INFORMATION, FALSE, id);
if (!t)
return false;
const auto _ = gsl::finally([t]() { CloseHandle(t); });
return set_name(t, name);
}
bool set_name(std::thread& t, const std::string& name) {
return set_name(t.native_handle(), name);
}
bool set_name(const std::string& name) {
return set_name(GetCurrentThread(), name);
}
std::vector<DWORD> get_thread_ids() {
auto* const h =
CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, GetCurrentProcessId());
if (h == INVALID_HANDLE_VALUE) {
return {};
}
const auto _ = gsl::finally([h]() { CloseHandle(h); });
THREADENTRY32 entry{};
entry.dwSize = sizeof(entry);
if (!Thread32First(h, &entry)) {
return {};
}
std::vector<DWORD> ids;
do {
const auto check_size =
entry.dwSize < FIELD_OFFSET(THREADENTRY32, th32OwnerProcessID) +
sizeof(entry.th32OwnerProcessID);
entry.dwSize = sizeof(entry);
if (check_size && entry.th32OwnerProcessID == GetCurrentProcessId()) {
ids.emplace_back(entry.th32ThreadID);
}
} while (Thread32Next(h, &entry));
return ids;
}
void for_each_thread(const std::function<void(HANDLE)>& callback) {
const auto ids = get_thread_ids();
for (const auto& id : ids) {
auto* const thread = OpenThread(THREAD_ALL_ACCESS, FALSE, id);
if (thread != nullptr) {
const auto _ = gsl::finally([thread]() { CloseHandle(thread); });
callback(thread);
}
}
}
void suspend_other_threads() {
for_each_thread([](const HANDLE thread) {
if (GetThreadId(thread) != GetCurrentThreadId()) {
SuspendThread(thread);
}
});
}
void resume_other_threads() {
for_each_thread([](const HANDLE thread) {
if (GetThreadId(thread) != GetCurrentThreadId()) {
ResumeThread(thread);
}
});
}
} // namespace utils::thread
-21
View File
@@ -1,21 +0,0 @@
#pragma once
namespace utils::thread {
bool set_name(HANDLE t, const std::string& name);
bool set_name(DWORD id, const std::string& name);
bool set_name(std::thread& t, const std::string& name);
bool set_name(const std::string& name);
template <typename... Args>
std::thread create_named_thread(const std::string& name, Args&&... args) {
auto t = std::thread(std::forward<Args>(args)...);
set_name(t, name);
return t;
}
std::vector<DWORD> get_thread_ids();
void for_each_thread(const std::function<void(HANDLE)>& callback);
void suspend_other_threads();
void resume_other_threads();
} // namespace utils::thread