// CodeGear C++Builder
// Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Anyhook.pas' rev: 21.00

#ifndef AnyhookHPP
#define AnyhookHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Dialogs.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Anyhook
{
//-- type declarations -------------------------------------------------------
typedef void * *PPointer;

struct _IMAGE_DOS_HEADER;
typedef _IMAGE_DOS_HEADER *PImageDosHeader;

#pragma pack(push,1)
struct _IMAGE_DOS_HEADER
{
	
public:
	System::Word e_magic;
	System::Word e_cblp;
	System::Word e_cp;
	System::Word e_crlc;
	System::Word e_cparhdr;
	System::Word e_minalloc;
	System::Word e_maxalloc;
	System::Word e_ss;
	System::Word e_sp;
	System::Word e_csum;
	System::Word e_ip;
	System::Word e_cs;
	System::Word e_lfarlc;
	System::Word e_ovno;
	StaticArray<System::Word, 4> e_res;
	System::Word e_oemid;
	System::Word e_oeminfo;
	StaticArray<System::Word, 10> e_res2;
	int _lfanew;
};
#pragma pack(pop)


typedef _IMAGE_DOS_HEADER TImageDosHeader;

typedef _IMAGE_FILE_HEADER *PImageFileHeader;

typedef _IMAGE_FILE_HEADER TImageFileHeader;

typedef _IMAGE_EXPORT_DIRECTORY *PImageExportDirectory;

typedef _IMAGE_EXPORT_DIRECTORY TImageExportDirectory;

#pragma pack(push,1)
struct TImportCode
{
	
public:
	System::Word JumpInstruction;
	void * *AddressOfPointerToFunction;
};
#pragma pack(pop)


typedef TImportCode *PImportCode;

struct Image_Import_Entry;
typedef Image_Import_Entry *PImage_Import_Entry;

struct Image_Import_Entry
{
	
public:
	unsigned Characteristics;
	unsigned TimeDateStamp;
	System::Word MajorVersion;
	System::Word MinorVersion;
	unsigned Name;
	unsigned LookupTable;
};


#pragma pack(push,1)
struct TLongJmp
{
	
public:
	System::ShortInt JmpCode;
	unsigned FuncAddr;
};
#pragma pack(pop)


class DELPHICLASS THookClass;
class PASCALIMPLEMENTATION THookClass : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	bool Trap;
	unsigned hProcess;
	bool AlreadyHook;
	bool AllowChange;
	StaticArray<System::Byte, 5> Oldcode;
	TLongJmp Newcode;
	
public:
	void *OldFunction;
	void *NewFunction;
	__fastcall THookClass(bool IsTrap, void * OldFun, void * NewFun);
	__fastcall virtual ~THookClass(void);
	void __fastcall Restore(void);
	void __fastcall Change(void);
	__property bool Hooked = {read=AlreadyHook, nodefault};
};


//-- var, const, procedure ---------------------------------------------------

}	/* namespace Anyhook */
using namespace Anyhook;
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// AnyhookHPP
