#ifndef _PLUGS_H_ #define _PLUGS_H_ #pragma pack(1) // yes, must be here! extern "C" { #define WANTVXDWRAPS #include #include #include } typedef DWORD PHOOKER; typedef DWORD* PPHOOKER; #ifndef STDCALL #define STDCALL __stdcall #endif #ifndef EXC #define EXC extern "C" #endif #ifndef EXPORT #define EXPORT _declspec(dllexport) #endif #define pd *(DWORD *) #define pw *(WORD *) #define pb *(BYTE *) #define KEY_ESC 0x011b #define KEY_ENTER 0x1c0d #define KEY_TAB 0x0f09 #define KEY_LEFT 0x4be0 #define KEY_RIGHT 0x4de0 #define KEY_HOME 0x47e0 #define KEY_END 0x4fe0 #define KEY_BACKSPACE 0x0e08 #define KEY_DEL 0x53e0 #define KEY_INSERT 0x52e0 #define KEY_C_PGUP 0x84e0 #define KEY_C_PGDN 0x76e0 #define KEY_C_LEFT 0x73e0 #define KEY_C_RIGHT 0x74e0 #define KEY_C_UP 0x8de0 #define KEY_C_DOWN 0x91e0 #define KEY_A_LEFT 0x9be0 #define KEY_A_RIGHT 0x9de0 #define KEY_A_PGUP 0x9900 #define KEY_A_PGDN 0xa100 #define KEY_A_UP 0x9800 #define KEY_A_DOWN 0xa000 #define KEY_PGUP 0x49e0 #define KEY_PGDN 0x51e0 #define KEY_UP 0x48e0 #define KEY_DOWN 0x50e0 #define KEY_A_G 0x2200 #define KEY_SPACE 0x3920 #define KEY_C_A_UP 0x9800 #define KEY_C_A_DOWN 0xa000 #define KEY_C_A_LEFT 0x9b00 #define KEY_C_A_RIGHT 0x9d00 #define KEY_C_Z 0x2c1a #include #define STDDASM 0x10000000 #define STDDATA 0x20000000 #define STDUSER 0x40000000 #define SY_MOVE 0x00000001 #define SY_ZOOM 0x00000002 #define SY_SIZE 0x00000004 #define SY_CLOSE 0x00000008 #define SY_SHADOW 0x00000010 #define SY_TOP 0x00000020 struct MouseEvent { int x; int y; WORD button; }; typedef struct { DWORD _off; WORD _seg; WORD _mod; } ADDRE, *PADDRE; struct KeyEvent { WORD keycode; WORD control; }; struct MessageEvent { WORD event; DWORD Para_1; DWORD Para_2; }; #define evNOTHING 0 #define evMOUSE 1 #define evKEY 2 #define evMESSAGE 3 class TEvent { public: WORD what; union { MouseEvent mevent; KeyEvent kevent; MessageEvent msgevent; }; }; const msgNOMSG = 0, msgACTIVE = 1, msgNOACTIVE = 2, msgCLOSE = 3, msgMOVE = 4, msgSIZE = 5, msgZOOM = 6, msgSCRLINES = 7, msgREFURBISH = 8, msgDRAW = 9, msgPREDRAW = 10, msgREARRANGESUB = 11, //I add // evMESSAGE msgSCROLLUP = 27, msgSCROLLDOWN = 28, msgSCROLLPGUP = 29, msgSCROLLPGDN = 30, msgSCROLLDRAGV= 31, msgSCROLLLEFT = 32, msgSCROLLRIGHT= 33, msgSCROLLPGLT = 34, msgSCROLLPGRT = 35, msgSCROLLDRAGH= 36, // use in scroller msgCOMMAND = 56, msgDEFAULT = 57, msgOK = 58, msgCANCEL = 59, msgYES = 60, msgNO = 61, msgHELP = 62, // use in Dialog NOMOUSEHIT = 0, MOUSELEFT = 1, MOUSERIGHT = 2, MOUSEMIDDLE = 4, MOUSELEFTDOUBLE = 8+1, MOUSERIGHTDOUBLE = 8+2, MOUSEMIDDLEDOUBLE= 8+4, MOUSELEFTRELEASE = 16+1, MOUSERIGHTRELEASE= 16+2, MOUSELEFTAUTO = 128, MOUSERIGHTAUTO = 129, MOUSELEFTHITLINK = 130, MOUSERIGHTHITLINK= 131; // evMOUSE #define msgFINDHELP 501 #define msgFINDSTACK 502 #define msgFINDZOOMCMD 503 #define msgFIND_UNASM 504 #define msgFIND_DATA 505 #define msgFIND_REG 506 #define msgFIND_LOGCMD 507 #define msgUSER 1000 typedef struct { WORD x; WORD y; WORD button; } MOUSE_STATE; struct X86_REG_STRUCT { DWORD _CR0; DWORD _CR2; DWORD _CR3; DWORD _DR0; DWORD _DR1; DWORD _DR2; DWORD _DR3; DWORD _DR6; DWORD _DR7; DWORD _TR3; DWORD _TR4; DWORD _TR5; DWORD _TR6; DWORD _TR7; struct { WORD Limit; DWORD Base; } _GDTR; struct { WORD Limit; DWORD Base; } _IDTR; WORD _LDT; WORD _TR; }; class WNDCLASS { public: int Origin_x; // Read Only int Origin_y; // Read Only int Delta_x; int Delta_y; int Offset_x; int Offset_y; int Size_x; // Read Only int Size_y; // Read Only }; class DASM_WNDCLASS : public WNDCLASS { public: ADDRE Waddre; }; class DATA_WNDCLASS : public DASM_WNDCLASS { public: WORD Data_Number; BYTE Data_Format; }; #define SYM_NOTRELOC 0 #define SYM_RELOCVXD 1 #define SYM_RELOCPE 2 #define SYM_RELOCNE 3 #define SYM_RELOCDOS 4 #define SYM_RELOCUSER 1000 #define SYM_TYPE_COMPLEX 0x80000000 #define SYM_TYPE_COMMENT 0x40000000 #define SYM_TYPE_DATA 0x20000000 #define SYM_TYPE_POINT 0x10000000 // These can be used in dynamic-list // TYPE define #define SYM_NORMALSYM 1 #define SYM_DELCOMPLEXSYM 1 #define SYM_GETCOMPLEXSYM 2 #define SYM_SAVECOMPLEXSYM 3 #define SYM_LOADCOMPLEXSYM 4 typedef struct _tagCPLSYM { DWORD complex_type; } SYMCOMPLEXSYM,*PSYMCOMPLEXSYM; typedef union _tagMYBP { struct{ DWORD reserved1; DWORD reserved2; DWORD reserved3; DWORD reserved4; }ubpreserved; struct{ WORD hwnd; WORD msgno; }ubpmsg; } MYBP,*PMYBP; #define BP_IMMED 1 #define BP_ASYNC 2 #define BPDR_X 0 #define BPDR_W 1 #define BPDR_R 3 // NOT IMPLEMENT! #define BPDR_A 3 #define BPDR_BYTE 0 #define BPDR_WORD 1 #define BPDR_DWORD 3 #define SYSMSG_USER 1000 #define DD_ENTERDEBUGGER 1 #define DD_LEAVEDEBUGGER 2 #define DD_REDRAWSCREEN 3 //Param1: ScreenBuf(8192 byets), Param2: Lines #define DD_MOUSECURSHOW 4 //Param1: X, Param2: Y #define DD_MOUSECURHIDE 5 //Param1: X, Param2: Y #define DD_CURSORCHANGE 6 //Param1: BeginLine, Param2: EndLine #define DD_CURSORPOS 7 //Param1: X, Param2: Y #define DD_CURSORSAVE 8 //Param1: Pointer to state (DWORD) #define DD_CURSORRESTORE 9 //Param1: State(DWORD) //**************************************** #define FS_ReadOnly 0 #define FS_WriteOnly 1 #define FS_ReadWrite 2 #define FS_Share 0x40 #define FS_OnNotExist_Fail 0 #define FS_OnNotExist_Create 0x1000 #define FS_OnExist_Fail 0 #define FS_OnExist_Append 0x0100 #define FS_OnExist_Open 0x0100 #define FS_OnExist_Trunc 0x0200 #define fopen_append(fname) fopen(fname,\ FS_ReadWrite|FS_OnNotExist_Create|FS_OnExist_Append ) #define fopen_read(fname) fopen(fname,FS_Share|FS_OnExist_Open ) #define fopen_create(fname) fopen(fname,\ FS_ReadWrite|FS_OnNotExist_Create|FS_OnExist_Trunc ) #include "plugapi.h" EXC PLUGS_API* api; //OK, If you use .CPP file, you must reload operator new and delete, //add these code to your main .cpp file. //void* cdecl operator new(size_t size) // Reload NEW ! //{ // return api->malloc(size); //} //void cdecl operator delete(void* p) // Reload DELETE ! //{ // api->free(p); //} #endif