0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
-
+#if defined(CONFIG_X86_64)
+#define PATCH_OP_POS 3
#define CODE_MATCH(code, i) \
(code[i] == 0x40 && code[i + 1] == 0x80 && code[i + 2] == 0xce && code[i + 3] == 0x80)
+#elif defined(CONFIG_X86_32)
+#define PATCH_OP_POS 2
+#define CODE_MATCH(code, i) \
+ (code[i] == 0x80 && code[i + 1] == 0xca && code[i + 2] == 0x80 && code[i + 3] == 0xe8)
+#else
+#error "unsupported arch"
+#endif
#define vdebug(fmt, args...) if(kprintf) kprintf(KERN_ERR fmt, ##args)
{
if (CODE_MATCH(opCode, i) && cnt < MAX_PATCH)
{
- patch[cnt] = opCode + i + 3;
+ patch[cnt] = opCode + i + PATCH_OP_POS;
cnt++;
}
}
1. install ubuntu 21.10\r
-2. apt-get install build-essential flex ncurse linux-headers-generic linux-source ...... and so on\r
+2. apt-get install build-essential flex libncurses-dev linux-headers-generic linux-source libssl-dev ...... and so on\r
3. cp /lib/modules/5.13.0-23-generic/build/Module.symvers ./\r
4. /boot/config-5.13.0-23-generic as .config make oldconfig\r
5. make menuconfig \r
if echo $vtMType | $EGREP -i -q "x86.64|amd64"; then
vtKoName=dm_patch_64.ko
+ elif echo $vtMType | $EGREP -i -q "i[3-6]86"; then
+ vtKoName=dm_patch_32.ko
else
vtlog "unsupported machine type $vtMType"
return