#include <Thunk/StdToStd.h> #define THUNK_MACHINE_CODE_IMPLEMENT #include <Thunk/MachineCodeMacro.h> namespace Thunk { dword_ptr StdToStd::GetObject() const { return m_this; } void StdToStd::SetObject(dword_ptr newObj) { m_this = newObj; Helper::FlushInstructionCache(&m_this,sizeof(m_this)); } dword StdToStd::GetMethod() const { return Helper::GetTransferDST(&JMP); } void StdToStd::SetMethod(dword newMethod) { Helper::SetTransferDST(&JMP,newMethod); Helper::FlushInstructionCache(&m_method,sizeof(m_method)); } StdToStd::~StdToStd() {} StdToStd::StdToStd(dword_ptr Obj,dword method) STD_TO_STD_CODES() { SetObject(Obj); SetMethod(method); } StdToStd::StdToStd(const StdToStd &src) STD_TO_STD_CODES() { *this = src; } StdToStd& StdToStd::operator =(const Thunk::StdToStd &rhs) { SetObject( rhs.GetObject() ); SetMethod( rhs.GetMethod() ); return *this; } bool StdToStd::operator == (const StdToStd &rhs) const { return (GetObject()==rhs.GetObject() && GetMethod()==rhs.GetMethod()); } bool StdToStd::operator != (const StdToStd &rhs) const { return !(*this==rhs); } dword_ptr StdToStd::Attach(dword_ptr newObj) { dword_ptr oldObj = GetObject(); SetObject(newObj); return oldObj; } dword StdToStd::Attach(dword newMethod) { dword oldMetod = GetMethod(); SetMethod(newMethod); return oldMetod; } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)