Compare commits

..

2 Commits
pr320 ... pr316

Author SHA1 Message Date
icex2
8282a9f3f4 TODO split to two features: imgui-bt abstraction layer + first component frame graph
Summary:

Test Plan:
Summary:

Test Plan:
2025-02-07 15:02:36 +01:00
icex2
2c00da6232 feat: Integrate imgui library
Version 1.91.7 of the imgui library with the cimgui wrapper.

imgui allows us to easily create minimal and powerful UI for
use-cases like in-game overlays or separate tooling.

The additional wrappers cimgui_impl_dx9 and cimgui_impl_win32
were added to provide a full C linkage integration for the rest
of the code base.

Tweaks to the makefile were kept to a minimum but enable
compilation of C++ since imgui is C++ based.

Remark: At this point bemanitools itself is still to be kept a pure
C codebase. Due to the lack of proper module/library management
with the current build system in bemanitools 5, proper separation
of concerns and clean integration with external libraries isn’t
possible with reasonable effort.
2025-02-07 13:23:21 +01:00
21 changed files with 0 additions and 143 deletions

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Magnetic card type, format XXX, 3 digit string (supports: C02, D01, E11, ECO)
eamuse.card_type=C02

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Magnetic card type, format XXX, 3 digit string (supports: C02, D01, E11, ECO)
eamuse.card_type=D01

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Magnetic card type, format XXX, 3 digit string (supports: C02, D01, E11, ECO)
eamuse.card_type=E11

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Magnetic card type, format XXX, 3 digit string (supports: C02, D01, E11, ECO)
eamuse.card_type=ECO

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Magnetic card type, format XXX, 3 digit string (supports: C02, D01, E11, ECO)
eamuse.card_type=C02

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# URL (e.g. http://my.eamuse.server:80/whatever) or IPV4 (e.g. 127.0.0.1:80) of the target eamuse server. The port is optional but defaults to 80.
eamuse.server=localhost:80

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# URL (e.g. http://my.eamuse.server:80/whatever) or IPV4 (e.g. 127.0.0.1:80) of the target eamuse server. The port is optional but defaults to 80.
eamuse.server=localhost:80

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# URL (e.g. http://my.eamuse.server:80/whatever) or IPV4 (e.g. 127.0.0.1:80) of the target eamuse server. The port is optional but defaults to 80.
eamuse.server=localhost:80

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# URL (e.g. http://my.eamuse.server:80/whatever) or IPV4 (e.g. 127.0.0.1:80) of the target eamuse server. The port is optional but defaults to 80.
eamuse.server=localhost:80

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# PCBID
eamuse.pcbid=0101020304050607086F

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Run the game in a framed window (requires windowed option)
gfx.framed=false

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Run the game in a framed window (requires windowed option)
gfx.framed=false

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# PCBID
eamuse.pcbid=0101020304050607086F

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Run the game in a framed window (requires windowed option)
gfx.framed=false

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Run the game in a framed window (requires windowed option)
gfx.framed=false

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Run the game in a framed window (requires windowed option)
gfx.framed=false

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Run the game in a framed window (requires windowed option)
gfx.framed=false

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Run the game in a framed window (requires windowed option)
gfx.framed=false

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Run the game in a framed window (requires windowed option)
gfx.framed=false

View File

@@ -1,6 +1,3 @@
# Enable frame performance graph overlay
debug.enable_frame_perf_graph=false
# Run the game in a framed window (requires windowed option)
gfx.framed=false

View File

@@ -15,21 +15,12 @@ static const size_t apiset_prefix_len = sizeof(apiset_prefix) - 1;
static void hook_table_apply_to_all(
const char *depname, const struct hook_symbol *syms, size_t nsyms);
static void hook_table_revert_to_all(
const char *depname, const struct hook_symbol *syms, size_t nsyms);
static void hook_table_apply_to_iid(
HMODULE target,
const pe_iid_t *iid,
const struct hook_symbol *syms,
size_t nsyms);
static void hook_table_revert_to_iid(
HMODULE target,
const pe_iid_t *iid,
const struct hook_symbol *syms,
size_t nsyms);
static bool hook_table_match_module(
HMODULE target, const char *iid_name, const char *depname);
@@ -53,23 +44,6 @@ static void hook_table_apply_to_all(
}
}
static void hook_table_revert_to_all(
const char *depname, const struct hook_symbol *syms, size_t nsyms)
{
const peb_dll_t *dll;
HMODULE pe;
for (dll = peb_dll_get_first(); dll != NULL; dll = peb_dll_get_next(dll)) {
pe = peb_dll_get_base(dll);
if (pe == NULL) {
continue; /* ?? Happens sometimes. */
}
hook_table_revert(pe, depname, syms, nsyms);
}
}
void hook_table_apply(
HMODULE target,
const char *depname,
@@ -99,35 +73,6 @@ void hook_table_apply(
}
}
void hook_table_revert(
HMODULE target,
const char *depname,
const struct hook_symbol *syms,
size_t nsyms)
{
const pe_iid_t *iid;
const char *iid_name;
assert(depname != NULL);
assert(syms != NULL || nsyms == 0);
if (target == NULL) {
/* Call out, which will then call us back repeatedly. Awkward, but
viewed from the outside it's good for usability. */
hook_table_revert_to_all(depname, syms, nsyms);
} else {
for (iid = pe_iid_get_first(target); iid != NULL;
iid = pe_iid_get_next(target, iid)) {
iid_name = pe_iid_get_name(target, iid);
if (hook_table_match_module(target, iid_name, depname)) {
hook_table_revert_to_iid(target, iid, syms, nsyms);
}
}
}
}
static void hook_table_apply_to_iid(
HMODULE target,
const pe_iid_t *iid,
@@ -156,34 +101,6 @@ static void hook_table_apply_to_iid(
}
}
static void hook_table_revert_to_iid(
HMODULE target,
const pe_iid_t *iid,
const struct hook_symbol *syms,
size_t nsyms)
{
struct pe_iat_entry iate;
size_t i;
size_t j;
const struct hook_symbol *sym;
i = 0;
while (pe_iid_get_iat_entry(target, iid, i++, &iate) == S_OK) {
for (j = 0; j < nsyms; j++) {
sym = &syms[j];
if (hook_table_match_proc(&iate, sym)) {
// Only revert-able if the original pointer was stored
// previously
if (sym->link != NULL && *sym->link != NULL) {
pe_patch(iate.ppointer, sym->link, sizeof(*sym->link));
}
}
}
}
}
static bool hook_table_match_module(
HMODULE target, const char *iid_name, const char *depname)
{