Files
jadeite/game_payload/src/hi3.c

37 lines
1.1 KiB
C
Raw Normal View History

2023-06-06 00:23:08 +03:00
#include <utils.h>
2023-06-08 21:44:42 +03:00
#include <msg.h>
#include <pe.h>
#include <main.h>
2023-06-06 00:23:08 +03:00
2023-06-06 21:14:21 +03:00
#include <game.h>
2023-06-06 00:23:08 +03:00
2023-08-17 22:51:43 +03:00
const char *HI3_TXS_SECTION_NAME_OLD = ".bh3";
const char *HI3_TXS_SECTION_NAME_NEW = ".ace";
2023-08-04 00:19:02 +03:00
const char *HI3_BASE_MODULE_NAME = "BH3Base.dll";
2023-08-05 09:28:36 +03:00
const char *HI3_ASSEMBLY_PATH = "BH3_Data\\Native\\UserAssembly.dll";
2023-06-08 18:36:22 +03:00
const char *HI3_TVM_SECTION_NAME = ".tvm0";
2023-06-06 00:23:08 +03:00
void hi3_fill_data(struct game_data *buf) {
// !!! TEMPORARY WORKAROUND
// Name in exe matches name in base module
HMODULE exe = GetModuleHandleA(NULL);
if (pe_find_section(exe, HI3_TXS_SECTION_NAME_OLD)) {
// Old name
buf->txs_section_name = HI3_TXS_SECTION_NAME_OLD;
} else if (pe_find_section(exe, HI3_TXS_SECTION_NAME_NEW)) {
// New name
2023-08-17 22:51:43 +03:00
buf->txs_section_name = HI3_TXS_SECTION_NAME_NEW;
} else {
// This should not happen
msg_err_a("Could not determine region-specific section name. " ISSUE_SUFFIX);
2023-08-17 22:51:43 +03:00
}
2023-08-04 00:19:02 +03:00
buf->base_module_name = HI3_BASE_MODULE_NAME;
2023-08-05 09:28:36 +03:00
buf->assembly_path = HI3_ASSEMBLY_PATH;
2023-06-06 00:23:08 +03:00
buf->tvm_section_name = HI3_TVM_SECTION_NAME;
2023-06-08 20:13:21 +03:00
buf->unityplayer_callback = NULL;
2023-06-06 00:23:08 +03:00
}