summaryrefslogtreecommitdiff
path: root/library/VTableInterpose.cpp
diff options
context:
space:
mode:
authorQuietust2012-08-21 15:27:29 -0500
committerQuietust2012-08-21 15:27:29 -0500
commit985d96c596ac190493f36c9764bfe5308dfecfe3 (patch)
treea4d565ed68af0a2dcaf5927dbb027e069ad0f52b /library/VTableInterpose.cpp
parent44e3e318d0f0f5f31dcc4c19fed9b60df88b5eff (diff)
downloaddfhack-985d96c596ac190493f36c9764bfe5308dfecfe3.tar.gz
dfhack-985d96c596ac190493f36c9764bfe5308dfecfe3.tar.bz2
dfhack-985d96c596ac190493f36c9764bfe5308dfecfe3.tar.xz
Allow interposing the 1st vmethod
Diffstat (limited to 'library/VTableInterpose.cpp')
-rw-r--r--library/VTableInterpose.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/VTableInterpose.cpp b/library/VTableInterpose.cpp
index f612ba8b..ad46b0b0 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????????]