diff --git a/platform/pcbid.c b/platform/pcbid.c index 7c66c24e..86a5f203 100644 --- a/platform/pcbid.c +++ b/platform/pcbid.c @@ -30,6 +30,12 @@ void pcbid_hook_init(const struct pcbid_config *cfg) return; } + if (wcslen(cfg->serial_no) != 15) { + dprintf("Pcbid: ERROR: Must be 15 chars! ex: ACAE01A99999999\n"); + + return; + } + memcpy(&pcbid_cfg, cfg, sizeof(*cfg)); hook_table_apply(NULL, "kernel32.dll", pcbid_syms, _countof(pcbid_syms)); } @@ -53,7 +59,10 @@ static BOOL WINAPI pcbid_GetComputerNameA(char *dest, uint32_t *len) } dprintf("Pcbid: Get PCB serial\n"); + wcstombs_s(NULL, dest, *len, pcbid_cfg.serial_no, *len - 1); + SetLastError(ERROR_SUCCESS); + *len = required - 1; return TRUE; }