Files
jadeite/game_payload/src/hi3.c

37 lines
1.1 KiB
C

#include <utils.h>
#include <msg.h>
#include <pe.h>
#include <main.h>
#include <game.h>
const char *HI3_TXS_SECTION_NAME_OLD = ".bh3";
const char *HI3_TXS_SECTION_NAME_NEW = ".ace";
const char *HI3_BASE_MODULE_NAME = "BH3Base.dll";
const char *HI3_ASSEMBLY_PATH = "BH3_Data\\Native\\UserAssembly.dll";
const char *HI3_TVM_SECTION_NAME = ".tvm0";
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
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);
}
buf->base_module_name = HI3_BASE_MODULE_NAME;
buf->assembly_path = HI3_ASSEMBLY_PATH;
buf->tvm_section_name = HI3_TVM_SECTION_NAME;
buf->unityplayer_callback = NULL;
}