qemu-spoof: seed-driven per-VM hardware-identity anti-detection for pve-qemu

This commit is contained in:
2026-06-11 17:34:09 +03:00
commit 06463ee65c
33 changed files with 1788 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
/* spoof-audio.c — HDA codec identity (real machines = Realtek ALC, not a QEMU id). */
#include "qemu/osdep.h"
#include "hw/misc/spoof.h"
#include "hw/misc/spoof-core.h"
/* 32-bit HDA codec vendor/device id (Realtek vendor 0x10EC). */
static const uint32_t HDA_ID[] = {
0x10EC0892, 0x10EC1220, 0x10EC0887, 0x10EC0255, 0x10EC0256, 0x10EC0897, 0x10EC0233,
};
static const char *const HDA_NAME[] = {
"Realtek ALC892", "Realtek ALC1220", "Realtek ALC887", "Realtek ALC255",
"Realtek ALC256", "Realtek ALC897", "Realtek ALC233",
};
uint32_t spoof_hda_vendor_id(uint32_t def)
{
return spoof_on() ? HDA_ID[spoof_field("hda.id") % ARRAY_SIZE(HDA_ID)] : def;
}
const char *spoof_hda_name(const char *def)
{
return spoof_on() ? SPOOF_PICK("hda.name", HDA_NAME) : def;
}