From 985d96c596ac190493f36c9764bfe5308dfecfe3 Mon Sep 17 00:00:00 2001 From: Quietust Date: Tue, 21 Aug 2012 15:27:29 -0500 Subject: [PATCH] Allow interposing the 1st vmethod --- library/VTableInterpose.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/VTableInterpose.cpp b/library/VTableInterpose.cpp index f612ba8bd..ad46b0b04 100644 --- a/library/VTableInterpose.cpp +++ b/library/VTableInterpose.cpp @@ -57,6 +57,7 @@ bool DFHack::is_vmethod_pointer_(void *pptr) // This expects that they all follow a very specific pattern. auto pval = (unsigned*)pobj->method; switch (pval[0]) { + case 0x20FF018BU: // mov eax, [ecx]; jmp [eax] case 0x60FF018BU: // mov eax, [ecx]; jmp [eax+0x??] case 0xA0FF018BU: // mov eax, [ecx]; jmp [eax+0x????????] return true; @@ -72,6 +73,8 @@ int DFHack::vmethod_pointer_to_idx_(void *pptr) auto pval = (unsigned*)pobj->method; switch (pval[0]) { + case 0x20FF018BU: // mov eax, [ecx]; jmp [eax] + return 0; case 0x60FF018BU: // mov eax, [ecx]; jmp [eax+0x??] return ((int8_t)pval[1])/sizeof(void*); case 0xA0FF018BU: // mov eax, [ecx]; jmp [eax+0x????????]