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
+41
View File
@@ -0,0 +1,41 @@
#ifndef BT_API_HOOK_H
#define BT_API_HOOK_H
#include <windows.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "api/core/config.h"
typedef enum bt_io_bst_gpio_sys_bit {
BT_IO_BST_GPIO_SYS_COIN = 2,
BT_IO_BST_GPIO_SYS_TEST = 4,
BT_IO_BST_GPIO_SYS_SERVICE = 5,
} bt_io_bst_gpio_sys_bit_t;
typedef void (*bt_hook_iat_dll_name_get_t)(char *buffer, size_t size);
typedef bool (*bt_hook_pre_avs_init_t)(const bt_core_config_t *config);
// game module reference, either the exe or dll. allow for further targeted hooking/patching
// remark: you can't own the memory of the property_node config. whatever you need form that, make sure to copy the data and not just reference it.
// there is no guarantee the data is not free'd/gone after this call returns
// use the property api to iterate the data and parse it into your own custom configuration struct
// it is advised to also validate all parameters
// if no configuration was provided upon loading, the config_node contains an empty root node
typedef bool (*bt_hook_main_init_t)(HMODULE game_module, const bt_core_config_t *config);
typedef void (*bt_hook_main_fini_t)();
typedef struct bt_hook_api {
uint16_t version;
struct {
// Optional
bt_hook_iat_dll_name_get_t iat_dll_name_get;
bt_hook_pre_avs_init_t pre_avs_init;
bt_hook_main_init_t main_init;
bt_hook_main_fini_t main_fini;
} v1;
} bt_hook_api_t;
#endif