Created
January 5, 2017 16:55
-
-
Save Bueddl/063a1c8c6755d630a85f1a558bfbc321 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class replacement | |
{ | |
public: | |
struct vmt_t | |
{ | |
void (*dtor)(void* _this); | |
getter_fn_t *virtual_getter; | |
} *vmt; | |
void setter(int a) | |
{ | |
_setter(this, a); | |
} | |
int getter() const | |
{ | |
return _getter(this); | |
} | |
int virtual_getter() const | |
{ | |
return vmt->virtual_getter(this); | |
} | |
void operator delete(void *_this) | |
{ | |
vmt_t *vmt = (vmt_t*)_this; | |
vmt->dtor(_this); | |
::operator delete(_this); | |
} | |
static setter_fn_t *_setter; | |
static getter_fn_t *_getter; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment