diff --git a/profile/3.3.5a-windows-386/include/client/gameclientcommands.h b/profile/3.3.5a-windows-386/include/client/gameclientcommands.h index 9395b46..e705a7b 100644 --- a/profile/3.3.5a-windows-386/include/client/gameclientcommands.h +++ b/profile/3.3.5a-windows-386/include/client/gameclientcommands.h @@ -4,12 +4,12 @@ DECLARE_STRUCT(GameClientCommands); DECLARE_STRUCT(GameClientCommands__v_table); +#define INTERFACE GameClientCommands struct GameClientCommands__v_table { - E_METHOD(GameClientCommands, void, Install); - E_METHOD(GameClientCommands, void, Uninstall); - // void* Install; - // void* Uninstall; + E_METHOD(void, Install); + E_METHOD(void, Uninstall); }; +#undef INTERFACE struct GameClientCommands { GameClientCommands__v_table* v_table; diff --git a/profile/3.3.5a-windows-386/include/system/detect.h b/profile/3.3.5a-windows-386/include/system/detect.h index 2fb1729..de29a5e 100644 --- a/profile/3.3.5a-windows-386/include/system/detect.h +++ b/profile/3.3.5a-windows-386/include/system/detect.h @@ -28,4 +28,23 @@ #define DECLARE_UNION(T) typedef union T T +#if defined(IDA) || defined(CLANGD) +// void Method(int32_t a1); +#define P_METHOD(__result__, name, ...) __result__(__thiscall* name)(INTERFACE * this, __VA_ARGS__) + +// void Method(); +#define E_METHOD(__result__, name) __result__(__thiscall* name)(INTERFACE * this) + +#else + +// ghidra doesn't support calling conventions in function pointer types :( +// this hides autoanalysis for the 'this' pointer but at least has correct +// parameter types + +#define P_METHOD(__result__, name, ...) __result__ (*name)(__VA_ARGS__) + +#define E_METHOD(__result__, name) __result__ (*name)() + +#endif + #endif