Merged workaround for 3rd

This commit is contained in:
mkrsym1 2023-08-17 22:55:26 +03:00
commit 4c7dd302d5
3 changed files with 18 additions and 2 deletions

Binary file not shown.

View File

@ -3,16 +3,28 @@
#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_TXS_SECTION_NAME = ".bh3";
const char *HI3_TVM_SECTION_NAME = ".tvm0";
void hi3_fill_data(struct game_data *buf) {
// !!! TEMPORARY WORKAROUND FOR HI3 6.8.0 -> 6.9.0
const uint32_t NEW_CHECKSUM = 0x885b4c63;
uint32_t crc = utils_file_crc32c(L"UnityPlayer.dll");
if (crc == NEW_CHECKSUM) {
buf->txs_section_name = HI3_TXS_SECTION_NAME_NEW;
} else {
buf->txs_section_name = HI3_TXS_SECTION_NAME_OLD;
}
buf->base_module_name = HI3_BASE_MODULE_NAME;
buf->assembly_path = HI3_ASSEMBLY_PATH;
buf->txs_section_name = HI3_TXS_SECTION_NAME;
buf->tvm_section_name = HI3_TVM_SECTION_NAME;
buf->unityplayer_callback = NULL;

View File

@ -28,6 +28,10 @@ void tx_table_file(struct game_data *game, wchar_t *buf) {
// Checksum the TXS section
IMAGE_SECTION_HEADER *txsSection = pe_find_section(baseMap, game->txs_section_name);
if (!txsSection) {
msg_err_a("Could not find %s in %s. " ISSUE_SUFFIX, game->txs_section_name, game->base_module_name);
}
uint32_t txsChecksum = crc32c(0, baseMap + txsSection->PointerToRawData, txsSection->SizeOfRawData);
// Format the path