feat: bemanitools 6 initial refactoring drop, alpha 1

**THIS IS A HIGHLY WORK/DEVELOPMENT IN PROGRESS VERSION**

**THINGS ARE BROKEN AND EVERYTHING IS SUBJECT TO CHANGE**

First cut after massive refactoring with most critical and fundamental changes implemented.
We need to start somewhere, and this might be as good as anything else, so we can get started
with testing, bug fixing and iterating for the next releases.

The following list is non-exhaustive, does not guarantee anything does work, yet, and is supposed
to give a high level idea of what all of this is about. Updated documentation will reflect all of
this at some later point in time in more detail.

* A common "core" now abstracts logging, thread, property and configuration infrastructure and
  provides a common interface. This is used by bemanitools internally as well as all tools, hooks
  and APIs provided and don't depend on the game, version of the game or AVS version available
  anymore
* New bemanitools (public) API
  * Versioned API allowing for handling incremental API changes as well as breaking changes by
    providing a new/different version when necessary
  * Unified interfaces for bemanitools core API, i.e. logging, threads, configuration
  * SDK with examples (TBD)
  * Dogfooding approach: Bemanitools uses its own (public) API to implement and provide fundamental
    features like configurable keyboard implementations for IO or hooks for different games and
    versions
* All bemanitools hooks and IO libraries have been or are about to be re-worked to use the new APIs
* New hook API allows for more fine grained runtime control when stages of the hook are to be
  executed, i.e. pre AVS, before main game, iat hooking instead of relying purely on DllMain
  (which is still a compatible option though)
* launcher as a replacement for bootstrap: Bring it significantly closer to the original bootstrap
  by supporting completely vanilla data and bootstrap.xml configurations to run the games. Note
  that bemanitools does not include any code or means to run DRM'd data, only decrypted
* inject is also being reworked to use as much of the same "infrastructure" as launcher to provide
  a more seamless bootstrapping process for games that keeps pre-eapki data as vanilla as possible
Summary:

Test Plan:
Summary:

Test Plan:
Summary:

Test Plan:
Summary:

Test Plan:
This commit is contained in:
icex2
2024-08-15 11:34:31 +02:00
parent 106b908f17
commit 57e68f928a
692 changed files with 19534 additions and 8278 deletions
+51
View File
@@ -0,0 +1,51 @@
#ifndef BT_API_CORE_CONFIG_H
#define BT_API_CORE_CONFIG_H
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef struct bt_core_config bt_core_config_t;
typedef enum bt_core_config_result {
BT_CORE_CONFIG_RESULT_SUCCESS = 0,
BT_CORE_CONFIG_RESULT_ERROR_INTERNAL = 1,
BT_CORE_CONFIG_RESULT_VALUE_NOT_FOUND = 2,
BT_CORE_CONFIG_RESULT_TYPE_MISMATCH = 3,
} bt_core_config_result_t;
typedef bt_core_config_result_t (*bt_core_config_s8_get_t)(const bt_core_config_t *config, const char *path, int8_t *value);
typedef bt_core_config_result_t (*bt_core_config_u8_get_t)(const bt_core_config_t *config, const char *path, uint8_t *value);
typedef bt_core_config_result_t (*bt_core_config_s16_get_t)(const bt_core_config_t *config, const char *path, int16_t *value);
typedef bt_core_config_result_t (*bt_core_config_u16_get_t)(const bt_core_config_t *config, const char *path, uint16_t *value);
typedef bt_core_config_result_t (*bt_core_config_s32_get_t)(const bt_core_config_t *config, const char *path, int32_t *value);
typedef bt_core_config_result_t (*bt_core_config_u32_get_t)(const bt_core_config_t *config, const char *path, uint32_t *value);
typedef bt_core_config_result_t (*bt_core_config_s64_get_t)(const bt_core_config_t *config, const char *path, int64_t *value);
typedef bt_core_config_result_t (*bt_core_config_u64_get_t)(const bt_core_config_t *config, const char *path, uint64_t *value);
typedef bt_core_config_result_t (*bt_core_config_float_get_t)(const bt_core_config_t *config, const char *path, float *value);
typedef bt_core_config_result_t (*bt_core_config_double_get_t)(const bt_core_config_t *config, const char *path, double *value);
typedef bt_core_config_result_t (*bt_core_config_bool_get_t)(const bt_core_config_t *config, const char *path, bool *value);
typedef bt_core_config_result_t (*bt_core_config_bin_get_t)(const bt_core_config_t *config, const char *path, void *value, size_t len);
typedef bt_core_config_result_t (*bt_core_config_str_get_t)(const bt_core_config_t *config, const char *path, char *value, size_t len);
typedef struct bt_core_config_api {
uint16_t version;
struct {
bt_core_config_s8_get_t s8_get;
bt_core_config_u8_get_t u8_get;
bt_core_config_s16_get_t s16_get;
bt_core_config_u16_get_t u16_get;
bt_core_config_s32_get_t s32_get;
bt_core_config_u32_get_t u32_get;
bt_core_config_s64_get_t s64_get;
bt_core_config_u64_get_t u64_get;
bt_core_config_float_get_t float_get;
bt_core_config_double_get_t double_get;
bt_core_config_bool_get_t bool_get;
bt_core_config_bin_get_t bin_get;
bt_core_config_str_get_t str_get;
} v1;
} bt_core_config_api_t;
#endif
+19
View File
@@ -0,0 +1,19 @@
#ifndef BT_API_CORE_LOG_H
#define BT_API_CORE_LOG_H
#include <stdint.h>
typedef void (*bt_core_log_message_t)(const char *module, const char *fmt, ...);
typedef struct bt_core_log_api {
uint16_t version;
struct {
bt_core_log_message_t misc;
bt_core_log_message_t info;
bt_core_log_message_t warning;
bt_core_log_message_t fatal;
} v1;
} bt_core_log_api_t;
#endif
+28
View File
@@ -0,0 +1,28 @@
#ifndef BT_API_CORE_THREAD_H
#define BT_API_CORE_THREAD_H
#include <stdint.h>
typedef enum bt_core_thread_result {
BT_CORE_THREAD_RESULT_SUCCESS = 0,
BT_CORE_THREAD_RESULT_ERROR_INTERNAL = 1,
} bt_core_thread_result_t;
typedef int bt_core_thread_id_t;
typedef bt_core_thread_result_t (*bt_core_thread_create_t)(
int (*proc)(void *), void *ctx, uint32_t stack_sz, unsigned int priority, bt_core_thread_id_t *thread_id);
typedef bt_core_thread_result_t (*bt_core_thread_join_t)(bt_core_thread_id_t thread_id, int *result);
typedef bt_core_thread_result_t (*bt_core_thread_destroy_t)(bt_core_thread_id_t thread_id);
typedef struct bt_core_thread_api {
uint16_t version;
struct {
bt_core_thread_create_t create;
bt_core_thread_join_t join;
bt_core_thread_destroy_t destroy;
} v1;
} bt_core_thread_api_t;
#endif