mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
a9fc6ef1b2
## Link to GitHub Issue, if one exists n/a ## Description of change Adds support for Polaris Chord ## Testing Tested with XIF:J:A:A:2024122300. IO/ICCA works, game successfully connects to server and is playable.
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <functional>
|
|
#include <windows.h>
|
|
#include "acioemu/handle.h"
|
|
|
|
namespace execexe {
|
|
HMODULE init();
|
|
void init_deferred(std::function<void()> init_func);
|
|
void init_port_hook(const std::wstring &portName, acioemu::ACIOHandle *acioHandle);
|
|
HMODULE load_library(const char *module_name, bool fatal = true);
|
|
FARPROC get_proc(HMODULE module, const char *proc_name, bool fatal = true);
|
|
HMODULE get_module(const char *module_name, bool fatal = true);
|
|
bool trampoline(const char *dll, const char *func, void *hook, void **orig);
|
|
bool trampoline_try(const char *dll, const char *func, void *hook, void **orig);
|
|
|
|
template<typename T>
|
|
inline T get_proc(HMODULE module, const char *proc_name, bool fatal = true) {
|
|
return reinterpret_cast<T>(get_proc(module, proc_name, fatal));
|
|
}
|
|
|
|
template<typename T>
|
|
inline bool trampoline(const char *dll, const char *func, T hook, T *orig) {
|
|
return trampoline(
|
|
dll,
|
|
func,
|
|
reinterpret_cast<void *>(hook),
|
|
reinterpret_cast<void **>(orig));
|
|
}
|
|
|
|
template<typename T>
|
|
inline bool trampoline_try(const char *dll, const char *func, T hook, T *orig) {
|
|
return trampoline_try(
|
|
dll,
|
|
func,
|
|
reinterpret_cast<void *>(hook),
|
|
reinterpret_cast<void **>(orig));
|
|
}
|
|
}
|