1
1
mirror of synced 2025-02-17 10:48:36 +01:00

Move cabinetofflinedata to exe folder

This commit is contained in:
BroGamer 2022-06-23 05:30:36 +12:00
parent 15658043aa
commit fbb8e7b6ed
3 changed files with 14 additions and 20 deletions

View File

@ -16,6 +16,9 @@ i32 __stdcall DllMain (HMODULE mod, DWORD cause, void *ctx) {
// Save settings cross session
WRITE_MEMORY (ASLR(0x140B5C528, handle), u8, "./Setting1.bin");
WRITE_MEMORY (ASLR(0x140B5C538, handle), u8, "./Setting2.bin");
// CabinetOfflineData
WRITE_MEMORY (ASLR(0x140b1b4b0, handle), u8, "./");
WRITE_MEMORY (ASLR(0x14001c941, handle), u8, 0x02);
void *amHandle = GetModuleHandle ("AMFrameWork.dll");
WRITE_MEMORY (amHandle + 0x33EF7, u8, 0xEB);

View File

@ -2,19 +2,6 @@
#include "helpers.h"
#include "poll.h"
HWND windowHandle = 0;
int CALLBACK
enumWindows (HWND handle, LPARAM param) {
char buf[64];
GetClassName (handle, buf, 64);
if (!strcmp (buf, "nuFoundation.Window")) {
windowHandle = handle;
return 0;
}
return 1;
}
// force show cursor
HOOK_DYNAMIC (i32, __stdcall, ShowMouse, i32 show) { return originalShowMouse (true); }
@ -57,9 +44,11 @@ u16 __fastcall bnusio_GetAnalogIn (u8 which) {
u16 __fastcall bnusio_GetCoin (i32 a1) {
static int coin_count = 0;
if (a1 == 1) {
static bool inited = false;
static bool inited = false;
static HWND windowHandle = 0;
if (!inited) {
EnumWindows (enumWindows, 0);
windowHandle = FindWindowA ("nuFoundation.Window", 0);
InitializePoll (windowHandle);
toml_table_t *config = openConfig (configPath ("keyconfig.toml"));
@ -115,7 +104,7 @@ i32 __stdcall DllMain (HMODULE mod, DWORD cause, void *ctx) {
// Set current directory to the directory of the executable
// Find all files in the plugins directory that end with .dll
// Call loadlibraryA on those files
// Call loadlibraryW on those files
// Create a message box if they fail to load
wchar_t path[MAX_PATH];
GetModuleFileNameW (NULL, path, MAX_PATH);

View File

@ -47,10 +47,12 @@ enum EnumType { none, keycode, button, axis, scroll };
struct ConfigValue {
enum EnumType type;
uint8_t keycode;
SDL_GameControllerButton button;
enum SDLAxis axis;
enum Scroll scroll;
union {
uint8_t keycode;
SDL_GameControllerButton button;
enum SDLAxis axis;
enum Scroll scroll;
};
};
struct InternalButtonState {