mirror of
https://gitea.tendokyu.moe/Hay1tsme/segatools.git
synced 2026-05-06 21:38:58 -05:00
This adds full support for the Taisen series of games, namely Sangokushi Taisen and Eiketsu Taisen. Games added: * Sangokushi Taisen (SDDD) * Eiketsu Taisen (SDGY) Devices added: * CHC-320 printer (SGT) * "Printer camera" (SGT, unsure what this actually really is) * CX-7000 printer (EKT) * Y3CR BD SIE F720MM (SGT, EKT) Notable changes in the codebase: * Renamed everything printer specific to seperate between CHC and CX. * Many new function and registry hooks were added across the board. * An error is now logged when segatools.ini (or the path in `SEGATOOLS_CONFIG_PATH`) cannot be found. * Netenv now redirects UDP broadcasts targeted at the subnet that is specified in the keychip configuration. The terminal announces it's presence by broadcasting UDP to 192.168.189.255, this will be redirected to 255.255.255.255. * Vfs now seperates between absolute and relative paths in `vfs_fixup_path` via an environment variable called `SEGATOOLS_VFS_RELATIVE_PATH`. This is needed because amcapture accesses files as workingdirectory-relative. * The Y3 board emulation has support for external Y3 I/O dlls. The default implementation (y3ws) that comes with this is a websocket implementation. The docs are available under `doc\y3ws.txt` and a sample card player .html file is under `dist\ekt\card_player.html`. I already know one person that is hosting a massively improved version of it. * For websockets, my own websocket implementation is used as a subproject (MIT license): https://github.com/akechi-haruka/cwinwebsocket * For JSON, cJSON was embedded (MIT license): https://github.com/DaveGamble/cJSON * y3ws reads all printed cards from `DEVICE\print` by default including card back sides. It's up to the client to merge or skip them. Remarks: * SGT takes ~8 minutes to load. This seems to be intentional. * SGT uses some weird TCP network implementation like IDZ. I have not bothered reversing that yet and I have confirmed everything working from the test menu. * EKT will throw a network error if no terminal is found. You must run the terminal on another computer to be able to launch the satellite. * EKT has a very bizzare speed glitch that will speed up the ingame unit movement by several 1000% and also slows down cutscene animations by 90%. When this effect is active, you also take a ton more damage than usual. I do not know what causes this and it seems PC specific. * EKT is very stutter sensitive and will throw error 6401 (I/O timeout) at random when trying to alt+tab or have other things running. * EKT features a livestream system called Enbu (or "Dojo Upload"). While you are in a match, regardless of vs. AI or another player, the game will record your screen and live-stream it to the Enbu server as defined by the game server's startup response. The application responsible for that, "AM Capture" will not limit it's recording to the game window, but also anything that overlays the game window (notifications, popups, alt+tabbed windows, web browsers, etc). Since this is live-streamed, killing the process will have no effect afterwards, as the frames showing unwanted things will already have been transmitted. To make people aware of this, a one-time dialog message will pop up when starting EKT. The flag for that is stored in the DEVICE folder. Closes #25. Co-authored-by: Dniel97 <Dniel97@noreply.gitea.tendokyu.moe> Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/85 Co-authored-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com> Co-committed-by: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com>
626 lines
15 KiB
C
626 lines
15 KiB
C
// ReSharper disable CppParameterNeverUsed
|
|
#include <windows.h>
|
|
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <assert.h>
|
|
|
|
#include "y3.h"
|
|
|
|
#include "hook/table.h"
|
|
#include "hook/procaddr.h"
|
|
|
|
#include "hooklib/y3-dll.h"
|
|
|
|
#include "util/dprintf.h"
|
|
|
|
#if _WIN32 || _WIN64
|
|
#if _WIN64
|
|
#define ENV64BIT
|
|
#else
|
|
#define ENV32BIT
|
|
#endif
|
|
#endif
|
|
|
|
// Check GCC
|
|
#if __GNUC__
|
|
#if __x86_64__ || __ppc64__
|
|
#define ENV64BIT
|
|
#else
|
|
#define ENV32BIT
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef ENV64BIT
|
|
#define CALL
|
|
#else
|
|
#define CALL __cdecl
|
|
#endif
|
|
|
|
float CALL API_DLLVersion();
|
|
uint32_t CALL API_GetLastError(int* hDevice);
|
|
uint32_t CALL API_GetErrorMessage(uint32_t errNo, char* szMessage, int numBytes);
|
|
int* CALL API_Connect(char* szPortName);
|
|
int CALL API_Close(int* hDevice);
|
|
int CALL API_Start(int* hDevice);
|
|
int CALL API_Stop(int* hDevice);
|
|
float CALL API_GetFirmVersion(int* hDevice);
|
|
uint32_t CALL API_GetFirmName(int* hDevice);
|
|
uint32_t CALL API_GetTargetCode(int* hDevice);
|
|
uint32_t CALL API_GetStatus(int* hDevice);
|
|
uint32_t CALL API_GetCounter(int* hDevice);
|
|
int CALL API_ClearError(int* hDevice);
|
|
int CALL API_Reset(int* hDevice, bool isHardReset);
|
|
int CALL API_GetCardInfo(int* hDevice, int numCards, struct CardInfo* pCardInfo);
|
|
int CALL API_GetCardInfoCharSize();
|
|
int CALL API_FirmwareUpdate(int* hDevice, uint32_t address, uint32_t size, uint8_t* buffer);
|
|
int CALL API_Calibration(int* hDevice, int calib);
|
|
int CALL API_GetCalibrationResult(int* hDevice, int calib, uint32_t* result);
|
|
uint32_t CALL API_GetProcTime(int* hDevice);
|
|
uint32_t CALL API_GetMemStatus(int* hDevice);
|
|
uint32_t CALL API_GetMemCounter(int* hDevice);
|
|
int CALL API_SetParameter(int* hDevice, uint32_t uParam, uint32_t* pParam);
|
|
int CALL API_GetParameter(int* hDevice, uint32_t uParam, uint32_t* pParam);
|
|
|
|
signed int CALL API_SetDevice(int a1, int a2);
|
|
signed int CALL API_SetCommand(int a1, int a2, int a3, int* a4);
|
|
signed int CALL API_SetSysControl(int a1, int a2, int* a3);
|
|
signed int CALL API_GetSysControl(int a1, int a2, int* a3);
|
|
int CALL API_TestReset(int a1);
|
|
signed int API_DebugReset(int a1, ...);
|
|
int CALL API_GetBoardType(int a1);
|
|
int CALL API_GetCardDataSize(int a1);
|
|
int CALL API_GetFirmDate(int a1);
|
|
int API_SystemCommand(int a1, char a2, ...);
|
|
int CALL API_CalcCheckSum(DWORD* a1, int a2, int a3);
|
|
int CALL API_GetCheckSumResult(int a1);
|
|
int CALL API_BlockRead(int a1, int a2, int a3, SIZE_T dwBytes);
|
|
int CALL API_GetBlockReadResult(int a1, void* a2);
|
|
int CALL API_BlockWrite(int a1, int a2, int a3, SIZE_T dwBytes, void* a5);
|
|
signed int CALL API_GetDebugParam(int a1, int a2, DWORD* a3);
|
|
|
|
uint32_t convert_string_to_uint(const char* firmName);
|
|
|
|
static const struct hook_symbol Y3_hooks[] = {
|
|
{
|
|
.name = "API_DLLVersion",
|
|
.patch = API_DLLVersion,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetLastError",
|
|
.patch = API_GetLastError,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetErrorMessage",
|
|
.patch = API_GetErrorMessage,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_Connect",
|
|
.patch = API_Connect,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_Close",
|
|
.patch = API_Close,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_Start",
|
|
.patch = API_Start,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_Stop",
|
|
.patch = API_Stop,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetFirmVersion",
|
|
.patch = API_GetFirmVersion,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetFirmName",
|
|
.patch = API_GetFirmName,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetTargetCode",
|
|
.patch = API_GetTargetCode,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetStatus",
|
|
.patch = API_GetStatus,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetCounter",
|
|
.patch = API_GetCounter,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_Reset",
|
|
.patch = API_Reset,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetCardInfo",
|
|
.patch = API_GetCardInfo,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetCardInfoCharSize",
|
|
.patch = API_GetCardInfoCharSize,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_FirmwareUpdate",
|
|
.patch = API_FirmwareUpdate,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_Calibration",
|
|
.patch = API_Calibration,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetCalibrationResult",
|
|
.patch = API_GetCalibrationResult,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetProcTime",
|
|
.patch = API_GetProcTime,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetMemStatus",
|
|
.patch = API_GetMemStatus,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetMemCounter",
|
|
.patch = API_GetMemCounter,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_SetParameter",
|
|
.patch = API_SetParameter,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetParameter",
|
|
.patch = API_GetParameter,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_SetDevice",
|
|
.patch = API_SetDevice,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_SetCommand",
|
|
.patch = API_SetCommand,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_SetSysControl",
|
|
.patch = API_SetSysControl,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetSysControl",
|
|
.patch = API_GetSysControl,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_TestReset",
|
|
.patch = API_TestReset,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_DebugReset",
|
|
.patch = API_DebugReset,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetBoardType",
|
|
.patch = API_GetBoardType,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetCardDataSize",
|
|
.patch = API_GetCardDataSize,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetFirmDate",
|
|
.patch = API_GetFirmDate,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_SystemCommand",
|
|
.patch = API_SystemCommand,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_CalcCheckSum",
|
|
.patch = API_CalcCheckSum,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetCheckSumResult",
|
|
.patch = API_GetCheckSumResult,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_BlockRead",
|
|
.patch = API_BlockRead,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetBlockReadResult",
|
|
.patch = API_GetBlockReadResult,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_BlockWrite",
|
|
.patch = API_BlockWrite,
|
|
.link = NULL
|
|
},
|
|
{
|
|
.name = "API_GetDebugParam",
|
|
.patch = API_GetDebugParam,
|
|
.link = NULL
|
|
},
|
|
};
|
|
|
|
static struct y3_config y3_config;
|
|
|
|
#define MAX_CARD_SIZE 32
|
|
static struct CardInfo card_data[MAX_CARD_SIZE];
|
|
|
|
static int* Y3_COM_FIELD = (int*)10;
|
|
static int* Y3_COM_PRINT = (int*)11;
|
|
|
|
HRESULT y3_hook_init(const struct y3_config* cfg, HINSTANCE self, const wchar_t* config_filename) {
|
|
HRESULT hr;
|
|
assert(cfg != NULL);
|
|
|
|
if (!cfg->enable) {
|
|
return S_FALSE;
|
|
}
|
|
|
|
memcpy(&y3_config, cfg, sizeof(*cfg));
|
|
Y3_COM_FIELD = (int*)(uintptr_t)cfg->port_field;
|
|
Y3_COM_PRINT = (int*)(uintptr_t)cfg->port_printer;
|
|
|
|
y3_insert_hooks(NULL);
|
|
|
|
memset(card_data, 0, sizeof(card_data));
|
|
|
|
struct y3_dll_config config;
|
|
y3_dll_config_load(&config, config_filename);
|
|
|
|
hr = y3_dll_init(&config, self);
|
|
if (FAILED(hr)) {
|
|
return hr;
|
|
}
|
|
|
|
dprintf("Y3: hook enabled (field port = %d, printer port = %d)\n", cfg->port_field, cfg->port_printer);
|
|
|
|
return hr;
|
|
}
|
|
|
|
void y3_insert_hooks(HMODULE target) {
|
|
hook_table_apply(
|
|
target,
|
|
"Y3CodeReaderNE.dll",
|
|
Y3_hooks,
|
|
_countof(Y3_hooks));
|
|
|
|
proc_addr_table_push(
|
|
target,
|
|
"Y3CodeReaderNE.dll",
|
|
Y3_hooks,
|
|
_countof(Y3_hooks));
|
|
}
|
|
|
|
float CALL API_DLLVersion() {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 1;
|
|
}
|
|
|
|
uint32_t CALL API_GetLastError(int* hDevice) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
if (!y3_config.enable) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
uint32_t CALL API_GetErrorMessage(uint32_t errNo, char* szMessage,
|
|
int numBytes) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int* CALL API_Connect(char* szPortName) {
|
|
HRESULT hr;
|
|
|
|
dprintf("Y3: %s(%s)\n", __func__, szPortName);
|
|
|
|
if (!y3_config.enable) {
|
|
return NULL;
|
|
}
|
|
|
|
char number[2];
|
|
strncpy(number, szPortName + 3, 2);
|
|
int* hDevice = (int*)(uintptr_t)atoi(number);
|
|
|
|
if (hDevice == Y3_COM_FIELD) {
|
|
hr = y3_dll.init();
|
|
if (FAILED(hr)) {
|
|
dprintf("Y3: Hook DLL initialization failed: %lx\n", hr);
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
return hDevice;
|
|
}
|
|
|
|
int CALL API_Close(int* hDevice) {
|
|
dprintf("Y3: %s(%p)\n", __func__, hDevice);
|
|
|
|
if (hDevice == Y3_COM_FIELD) {
|
|
y3_dll.close();
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_Start(int* hDevice) {
|
|
dprintf("Y3: %s(%p)\n", __func__, hDevice);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_Stop(int* hDevice) {
|
|
dprintf("Y3: %s(%p)\n", __func__, hDevice);
|
|
return 0;
|
|
}
|
|
|
|
float CALL API_GetFirmVersion(int* hDevice) {
|
|
dprintf("Y3: %s(%p)\n", __func__, hDevice);
|
|
return 1;
|
|
}
|
|
|
|
uint32_t CALL API_GetFirmName(int* hDevice) {
|
|
uint32_t result = 0;
|
|
dprintf("Y3: %s(%p)\n", __func__, hDevice);
|
|
|
|
if (hDevice == Y3_COM_FIELD) {
|
|
result = convert_string_to_uint(y3_config.firm_name_field);
|
|
dprintf("Y3: This device is a FIELD: %s\n", y3_config.firm_name_field);
|
|
} else if (hDevice == Y3_COM_PRINT) {
|
|
result = convert_string_to_uint(y3_config.firm_name_printer);
|
|
dprintf("Y3: This device is a PRINTER: %s\n", y3_config.firm_name_printer);
|
|
} else {
|
|
dprintf("Y3: This device is UNKNOWN\n");
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
uint32_t CALL API_GetTargetCode(int* hDevice) {
|
|
uint32_t result = 1162760014;
|
|
dprintf("Y3: %s(%p)\n", __func__, hDevice);
|
|
|
|
if (hDevice == Y3_COM_FIELD) {
|
|
result = convert_string_to_uint(y3_config.target_code_field);
|
|
dprintf("Y3: This device is a FIELD: %s\n", y3_config.target_code_field);
|
|
} else if (hDevice == Y3_COM_PRINT) {
|
|
result = convert_string_to_uint(y3_config.target_code_printer);
|
|
dprintf("Y3: This device is a PRINTER: %s\n", y3_config.target_code_printer);
|
|
} else {
|
|
dprintf("Y3: This Y3 device is UNKNOWN\n");
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
uint32_t CALL API_GetStatus(int* hDevice) {
|
|
// dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
uint32_t CALL API_GetCounter(int* hDevice) {
|
|
// dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_ClearError(int* hDevice) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_Reset(int* hDevice, bool isHardReset) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_GetCardInfo(int* hDevice, int numCards, struct CardInfo* pCardInfo) {
|
|
// dprintf("Y3: %s(%p), %d\n", __func__, hDevice, numCards);
|
|
// ret = num cards
|
|
// numCards = max cards
|
|
|
|
if (hDevice == Y3_COM_FIELD) {
|
|
|
|
int cards = numCards;
|
|
HRESULT hr = y3_dll.get_cards(pCardInfo, &cards);
|
|
if (FAILED(hr)) {
|
|
dprintf("Y3: DLL returned error when retrieving cards: %lx\n", hr);
|
|
return 0;
|
|
}
|
|
|
|
return cards;
|
|
} else if (hDevice == Y3_COM_PRINT) {
|
|
pCardInfo[0].fX = 0;
|
|
pCardInfo[0].fY = 0;
|
|
pCardInfo[0].fAngle = 0;
|
|
pCardInfo[0].eCardType = TYPE0;
|
|
pCardInfo[0].eCardStatus = MARKER;
|
|
pCardInfo[0].uID = 0x10;
|
|
pCardInfo[0].nNumChars = 0;
|
|
pCardInfo[0].ubChar0.Data = 0;
|
|
pCardInfo[0].ubChar1.Data = 0x4000;
|
|
pCardInfo[0].ubChar2.Data = 0;
|
|
pCardInfo[0].ubChar3.Data = 0x0; // 40
|
|
pCardInfo[0].ubChar4.Data = 0;
|
|
pCardInfo[0].ubChar5.Data = 0;
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_GetCardInfoCharSize() {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_FirmwareUpdate(int* hDevice, uint32_t address, uint32_t size,
|
|
uint8_t* buffer) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 1; // not supported
|
|
}
|
|
|
|
int CALL API_Calibration(int* hDevice, int calib) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 1;
|
|
}
|
|
|
|
int CALL API_GetCalibrationResult(int* hDevice, int calib, uint32_t* result) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 1;
|
|
}
|
|
|
|
uint32_t CALL API_GetProcTime(int* hDevice) {
|
|
// dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
uint32_t CALL API_GetMemStatus(int* hDevice) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
uint32_t CALL API_GetMemCounter(int* hDevice) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_SetParameter(int* hDevice, uint32_t uParam, uint32_t* pParam) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_GetParameter(int* hDevice, uint32_t uParam, uint32_t* pParam) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
signed int CALL API_SetDevice(int a1, int a2) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
signed int CALL API_SetCommand(int a1, int a2, int a3, int* a4) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
signed int CALL API_SetSysControl(int a1, int a2, int* a3) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
signed int CALL API_GetSysControl(int a1, int a2, int* a3) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_TestReset(int a1) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
signed int API_DebugReset(int a1, ...) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_GetBoardType(int a1) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_GetCardDataSize(int a1) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_GetFirmDate(int a1) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int API_SystemCommand(int a1, char a2, ...) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_CalcCheckSum(DWORD* a1, int a2, int a3) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_GetCheckSumResult(int a1) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_BlockRead(int a1, int a2, int a3, SIZE_T dwBytes) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_GetBlockReadResult(int a1, void* a2) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
int CALL API_BlockWrite(int a1, int a2, int a3, SIZE_T dwBytes, void* a5) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
signed int CALL API_GetDebugParam(int a1, int a2, DWORD* a3) {
|
|
dprintf("Y3: %s\n", __func__);
|
|
return 0;
|
|
}
|
|
|
|
uint32_t convert_string_to_uint(const char* firmName) {
|
|
uint32_t result = 0;
|
|
|
|
// Iterate over each character in the string and construct the uint32_t
|
|
for (int i = 0; i < 4; i++) {
|
|
result |= (uint32_t)firmName[i] << (i * 8);
|
|
}
|
|
|
|
return result;
|
|
}
|