Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdint> /* uintptr_t */
- #include "saten.h" /* objAddr, substVmt */
- class A {
- private:
- int a;
- public:
- A(int a) {
- this->a = a;
- };
- virtual int getA() {
- return a;
- }
- };
- int fake_getA(A * self) {
- return *(buffAddr(self) + 1) * *(buffAddr(self) + 1);
- }
- int main() {
- A * a = new A(5);
- uintptr_t * fakeVmt = new uintptr_t;
- *fakeVmt = (uintptr_t)objAddr(fake_getA);
- substVmt(fakeVmt, a);
- std::cout << a->getA();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement