This commit is contained in:
2024-09-23 21:48:35 +08:00
parent a0f0588018
commit 80c072e757
11 changed files with 202 additions and 24 deletions

View File

@@ -3,11 +3,15 @@
#include "gh_base.h"
#include "gh_static_mem.h"
#include "gh_structs.h"
#include "gh_types.h"
#include "gh_global.h"
#ifdef _WIN32
#include <direct.h>
#include <process.h>
#else
#include <unistd.h>
#endif
template <size_t Offset, size_t Size> struct Field {};

View File

@@ -5,15 +5,36 @@
#include <Windows.h>
#else
#include "../win32_shim.h"
#include <unistd.h>
#include <sys/proc.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <string.h>
// Fallback to int if type is not annotated
typedef unsigned char undefined;
struct undefined {
size_t _0;
undefined(int i) {
*this = i;
}
undefined(uint32_t i) {
*this = i;
}
undefined(void* i) {
reinterpret_cast<void*&>(_0) = i;
}
undefined(uint64_t i) {
*this = i;
}
undefined() = default;
template <typename T> operator T&() {
static_assert(sizeof(T) <= sizeof(_0), "Invalid assignment");
return reinterpret_cast<T&>(_0);
}
template <typename T> T& operator=(const T &other) {
static_assert(sizeof(T) <= sizeof(_0), "Invalid assignment");
return reinterpret_cast<T&>(_0) = other;
}
};
typedef uint32_t undefined4;
typedef uint16_t undefined2;
struct undefined3 {

View File

@@ -2,7 +2,7 @@
#define EDBE48FC_B879_4985_9274_B7ACF24AD024
#include "gh_base.h"
#include "gh_structs.h"
#include "gh_types.h"
#include "gh_static_mem.h"
#endif /* EDBE48FC_B879_4985_9274_B7ACF24AD024 */