|
#pragma once
// Boost Headers
#include <boost/thread/mutex.hpp>
namespace indev
{
class Thunk32Base
{
protected:
Thunk32Base();
~Thunk32Base();
struct Bytecode
{
#pragma pack(push, 1)
unsigned short stub1; // lea ecx,
unsigned long nThisPtr; // this
unsigned char stub2; // mov eax,
unsigned long nJumpProc; // pointer to destination function
unsigned short stub3; // jmp eax
#pragma pack(pop)
Bytecode() :
stub1 (0x0D8D),
nThisPtr (0),
stub2 (0xB8),
nJumpProc (0),
stub3 (0xE0FF)
{}
} *bytecode;
static void* volatile bytecodeHeap;
static boost::mutex heapMutex;
private:
// Thunks will not be copyable
Thunk32Base(const Thunk32Base&); // not implemented
const Thunk32Base& operator=(const Thunk32Base&); // not implemented
static void __cdecl cleanupHeap();
};
}
|
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.
My name is Einar Otto Stangvik, and I'm a programmer based in Oslo, Norway. I mainly develop applications and software architectures targetting C++ on the Windows platform, but I have also got experience doing the same on Unix and Linux. The last few years I've used C# a lot, but native C++ is still my main focus.
As of July 2008, I'm a Microsoft MVP for Visual C++.
Follow me on Twitter:
@einaros
My code blog:
einaros.blogspot.com
My site:
www.indev.no