From 1042d9fa228c58e4a019c08c9dd5183ba3a6da6a Mon Sep 17 00:00:00 2001 From: superp00t Date: Fri, 9 Aug 2024 07:15:03 -0400 Subject: [PATCH] feat(binana): no special include directories now, you must pass GHIDRA or IDA as a definition into your preprocessor --- 3.3.5a/ida/import_data_types.idc | 19 + 3.3.5a/ida/{import.idc => import_symbols.idc} | 57 +- 3.3.5a/ida/include/stdbool.h | 4 - 3.3.5a/ida/include/stdint.h | 17 - 3.3.5a/include/common/datarecycler.h | 39 + 3.3.5a/include/common/handle.h | 13 + 3.3.5a/include/common/instance.h | 43 + 3.3.5a/include/d3d9/caps.h | 2 +- 3.3.5a/include/d3d9/device.h | 2 +- 3.3.5a/include/event/context.h | 66 + 3.3.5a/include/event/handler.h | 20 + 3.3.5a/include/event/id_table.h | 15 + 3.3.5a/include/event/keydown.h | 16 + 3.3.5a/include/event/message.h | 23 + 3.3.5a/include/event/timer.h | 32 + 3.3.5a/include/event/types.h | 277 ++++ 3.3.5a/include/framescript/event_object.h | 35 + 3.3.5a/include/framescript/object.h | 15 + 3.3.5a/include/gx/buffer.h | 270 ++-- 3.3.5a/include/gx/caps.h | 2 +- 3.3.5a/include/gx/device.h | 2 +- 3.3.5a/include/gx/format.h | 3 +- 3.3.5a/include/gx/matrix_stack.h | 42 +- 3.3.5a/include/gx/state_bom.h | 40 +- 3.3.5a/include/gx/types.h | 2 +- 3.3.5a/include/main.h | 49 +- 3.3.5a/include/storm/array.h | 26 +- 3.3.5a/include/storm/array/pointer_to_void.h | 10 + 3.3.5a/include/storm/array/uint32_t.h | 18 +- 3.3.5a/include/storm/array/uint8_t.h | 18 +- 3.3.5a/include/storm/hash.h | 93 +- 3.3.5a/include/storm/list.h | 62 +- 3.3.5a/include/storm/queue.h | 31 + .../storm/queue/timer_priority_uint32_t.h | 10 + 3.3.5a/include/storm/thread.h | 17 + 3.3.5a/include/system/detect.h | 23 + .../stdint.h => 3.3.5a/include/system/types.h | 27 +- 3.3.5a/include/tempest/box.h | 40 +- 3.3.5a/include/tempest/matrix.h | 108 +- 3.3.5a/include/tempest/plane.h | 24 +- 3.3.5a/include/tempest/quaternion.h | 24 +- 3.3.5a/include/tempest/range.h | 36 +- 3.3.5a/include/tempest/rect.h | 44 +- 3.3.5a/include/tempest/sphere.h | 24 +- 3.3.5a/include/tempest/vector.h | 84 +- 3.3.5a/include/ui/simpleframe.h | 9 + 3.3.5a/symbol/console/label.sym | 68 +- 3.3.5a/symbol/event/func.sym | 7 +- 3.3.5a/symbol/event/label.sym | 4 +- 3.3.5a/symbol/framescript/func.sym | 1 + 3.3.5a/symbol/lua/func.sym | 22 + 3.3.5a/symbol/main.sym | 47 +- 3.3.5a/symbol/storm/func.sym | 15 +- 3.3.5a/x32dbg/game.dd32 | 362 +++++ 3.3.5a/x32dbg/types.json | 1270 ++++++++++++++++- README.md | 31 +- go.mod | 1 + go/profile/ida_generate_files.go | 41 +- go/profile/include/stdbool.h | 6 - go/profile/x64dbg_generate_types.go | 13 +- 60 files changed, 3132 insertions(+), 589 deletions(-) create mode 100644 3.3.5a/ida/import_data_types.idc rename 3.3.5a/ida/{import.idc => import_symbols.idc} (99%) delete mode 100644 3.3.5a/ida/include/stdbool.h delete mode 100644 3.3.5a/ida/include/stdint.h create mode 100644 3.3.5a/include/common/datarecycler.h create mode 100644 3.3.5a/include/common/handle.h create mode 100644 3.3.5a/include/common/instance.h create mode 100644 3.3.5a/include/event/context.h create mode 100644 3.3.5a/include/event/handler.h create mode 100644 3.3.5a/include/event/id_table.h create mode 100644 3.3.5a/include/event/keydown.h create mode 100644 3.3.5a/include/event/message.h create mode 100644 3.3.5a/include/event/timer.h create mode 100644 3.3.5a/include/event/types.h create mode 100644 3.3.5a/include/framescript/event_object.h create mode 100644 3.3.5a/include/framescript/object.h create mode 100644 3.3.5a/include/storm/array/pointer_to_void.h create mode 100644 3.3.5a/include/storm/queue.h create mode 100644 3.3.5a/include/storm/queue/timer_priority_uint32_t.h create mode 100644 3.3.5a/include/storm/thread.h create mode 100644 3.3.5a/include/system/detect.h rename go/profile/include/stdint.h => 3.3.5a/include/system/types.h (59%) create mode 100644 3.3.5a/include/ui/simpleframe.h create mode 100644 3.3.5a/symbol/framescript/func.sym create mode 100644 3.3.5a/symbol/lua/func.sym delete mode 100644 go/profile/include/stdbool.h diff --git a/3.3.5a/ida/import_data_types.idc b/3.3.5a/ida/import_data_types.idc new file mode 100644 index 0000000..9a83f12 --- /dev/null +++ b/3.3.5a/ida/import_data_types.idc @@ -0,0 +1,19 @@ +#include + +static import_data_types() { + apply_type(0x004804F0, "void __cdecl func(EvtContext* context, EVENTID id, void* handler, void* param, float priority)"); + apply_type(0x004806A0, "int32_t __cdecl func(EvtContext* context, EVENTID id, void *data, size_t bytes)"); + apply_type(0x0076E540, "void* __stdcall func(uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)"); + apply_type(0x0076E5A0, "int32_t __stdcall func(void* ptr, char* filename, int32_t linenumber, uint32_t flags)"); + apply_type(0x0076E5E0, "void* __stdcall func(void* ptr, uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)"); + apply_type(0x0076F070, "int32_t __stdcall func(char* dest, size_t maxchars, char* format, ...)"); + apply_type(0x00774620, "SCritSect* __thiscall func(SCritSect* this)"); + apply_type(0x00774630, "void __thiscall func(SCritSect *this)"); + apply_type(0x00774640, "void __thiscall func(SCritSect *this)"); + apply_type(0x00774650, "void __thiscall func(SCritSect *this)"); + apply_type(0x00819EA0, "void __stdcall func(int32_t function, FrameScript_Object* object, int32_t args, char* args_fmt, FrameScript_EventObject* eventObject)"); + apply_type(0x00B417C8, "uint32_t"); + apply_type(0x00B417D0, "int32_t"); + apply_type(0x00B41850, "CDataRecycler"); + apply_type(0x00C26DF0, "CImVector[54][1024]"); +} diff --git a/3.3.5a/ida/import.idc b/3.3.5a/ida/import_symbols.idc similarity index 99% rename from 3.3.5a/ida/import.idc rename to 3.3.5a/ida/import_symbols.idc index a619b17..5d97e42 100644 --- a/3.3.5a/ida/import.idc +++ b/3.3.5a/ida/import_symbols.idc @@ -1,5 +1,6 @@ #include +#include "import_data_types.idc" static main() { // Make names set_name(0x00401070, "CDataStore__FetchWrite"); @@ -91,6 +92,7 @@ static main() { set_name(0x0047DCA0, "EventForceIdleProcessing"); set_name(0x0047DEA0, "IEvtSchedulerDestroy"); set_name(0x0047E910, "InitializeSchedulerThread"); + set_name(0x0047EC10, "AttachContextToThread"); set_name(0x0047EFF0, "SchedulerThreadProcProcess"); set_name(0x0047F230, "SchedulerThreadProc"); set_name(0x0047F2D0, "EventDoMessageLoop"); @@ -2272,6 +2274,7 @@ static main() { set_name(0x0076E4A0, "SMemSetDebugFlags"); set_name(0x0076E540, "SMemAlloc"); set_name(0x0076E5A0, "SMemFree"); + set_name(0x0076E5E0, "SMemReAlloc"); set_name(0x0076E6E0, "SStrChr"); set_name(0x0076E760, "SStrCmp"); set_name(0x0076E780, "SStrCmpI"); @@ -2329,6 +2332,7 @@ static main() { set_name(0x00809E30, "Script_SpellStopTargeting"); set_name(0x00809EA0, "Script_SpellStopCasting"); set_name(0x0080DC00, "Script_SpellTargetUnit"); + set_name(0x00819EA0, "FrameScript_Execute"); set_name(0x0081B720, "Script_GetText"); set_name(0x0081B7B0, "Script_CreateFont"); set_name(0x0081B820, "Script_GetCurrentKeyBoardFocus"); @@ -2336,6 +2340,28 @@ static main() { set_name(0x0081BAB0, "Script_GetNumFrames"); set_name(0x0081BB20, "Script_CreateFrame"); set_name(0x0081BE70, "Script_GetFramesRegisteredForEvent"); + set_name(0x0084DBD0, "_lua_gettop"); + set_name(0x0084DBF0, "_lua_settop"); + set_name(0x0084DCC0, "_lua_insert"); + set_name(0x0084DEB0, "_lua_type"); + set_name(0x0084DF20, "_lua_isnumber"); + set_name(0x0084DF60, "_lua_isstring"); + set_name(0x0084E030, "_lua_tonumber"); + set_name(0x0084E0E0, "_lua_tolstring"); + set_name(0x0084E1C0, "_lua_touserdata"); + set_name(0x0084E280, "_lua_pushnil"); + set_name(0x0084E2A0, "_lua_pushnumber"); + set_name(0x0084E350, "_lua_pushstring"); + set_name(0x0084E600, "_lua_rawget"); + set_name(0x0084E670, "_lua_rawgeti"); + set_name(0x0084E970, "_lua_rawset"); + set_name(0x0084F280, "_luaL_error"); + set_name(0x0084F7A0, "_luaL_unref"); + set_name(0x00850920, "_luaG_runerror"); + set_name(0x008562E0, "_luaD_throw"); + set_name(0x00856370, "_luaD_precall"); + set_name(0x00856760, "luaD_call"); + set_name(0x00857CA0, "_luaV_execute"); set_name(0x008695B0, "RestoreMouse"); set_name(0x00869720, "OsInputInitialize"); set_name(0x00869760, "OsInputDestroy"); @@ -2545,6 +2571,8 @@ static main() { set_name(0x00ADBAD4, "s_hRect"); set_name(0x00ADBAE4, "s_baseTextFlags"); set_name(0x00B417C8, "s_mainThread"); + set_name(0x00B417D0, "s_interactiveCount"); + set_name(0x00B41850, "s_messageRecycler"); set_name(0x00C26DF0, "s_cursorImages"); set_name(0x00C5DF88, "g_theGxDevicePtr"); set_name(0x00C5DFDC, "CGxDevice__s_uiVertexShader"); @@ -2736,6 +2764,7 @@ static main() { set_func_end(0x0047DEA0, 0x0047E117); set_func_start(0x0047E910, 0x0047E910); set_func_end(0x0047E910, 0x0047EA69); + set_func_start(0x0047EC10, 0x0047EC10); set_func_start(0x0047EFF0, 0x0047EFF0); set_func_end(0x0047EFF0, 0x0047F225); set_func_start(0x0047F230, 0x0047F230); @@ -7065,6 +7094,8 @@ static main() { set_func_end(0x0076E540, 0x0076E59A); set_func_start(0x0076E5A0, 0x0076E5A0); set_func_end(0x0076E5A0, 0x0076E5C4); + set_func_start(0x0076E5E0, 0x0076E5E0); + set_func_end(0x0076E5E0, 0x0076E6D6); set_func_start(0x0076E6E0, 0x0076E6E0); set_func_end(0x0076E6E0, 0x0076E712); set_func_start(0x0076E760, 0x0076E760); @@ -7179,6 +7210,8 @@ static main() { set_func_end(0x00809EA0, 0x00809F7E); set_func_start(0x0080DC00, 0x0080DC00); set_func_end(0x0080DC00, 0x0080DCE3); + set_func_start(0x00819EA0, 0x00819EA0); + set_func_end(0x00819EA0, 0x0081A2B5); set_func_start(0x0081B720, 0x0081B720); set_func_end(0x0081B720, 0x0081B7AF); set_func_start(0x0081B7B0, 0x0081B7B0); @@ -7193,6 +7226,28 @@ static main() { set_func_end(0x0081BB20, 0x0081BE68); set_func_start(0x0081BE70, 0x0081BE70); set_func_end(0x0081BE70, 0x0081BF4D); + set_func_start(0x0084DBD0, 0x0084DBD0); + set_func_start(0x0084DBF0, 0x0084DBF0); + set_func_start(0x0084DCC0, 0x0084DCC0); + set_func_start(0x0084DEB0, 0x0084DEB0); + set_func_start(0x0084DF20, 0x0084DF20); + set_func_start(0x0084DF60, 0x0084DF60); + set_func_start(0x0084E030, 0x0084E030); + set_func_start(0x0084E0E0, 0x0084E0E0); + set_func_start(0x0084E1C0, 0x0084E1C0); + set_func_start(0x0084E280, 0x0084E280); + set_func_start(0x0084E2A0, 0x0084E2A0); + set_func_start(0x0084E350, 0x0084E350); + set_func_start(0x0084E600, 0x0084E600); + set_func_start(0x0084E670, 0x0084E670); + set_func_start(0x0084E970, 0x0084E970); + set_func_start(0x0084F280, 0x0084F280); + set_func_start(0x0084F7A0, 0x0084F7A0); + set_func_start(0x00850920, 0x00850920); + set_func_start(0x008562E0, 0x008562E0); + set_func_start(0x00856370, 0x00856370); + set_func_start(0x00856760, 0x00856760); + set_func_start(0x00857CA0, 0x00857CA0); set_func_start(0x008695B0, 0x008695B0); set_func_end(0x008695B0, 0x008695FB); set_func_start(0x00869720, 0x00869720); @@ -7444,5 +7499,5 @@ static main() { set_func_start(0x009DE1C0, 0x009DE1C0); set_func_start(0x009DE1D0, 0x009DE1D0); // Apply data types - apply_type(0x00C26DF0, "CImVector[54][1024]"); + import_data_types(); } diff --git a/3.3.5a/ida/include/stdbool.h b/3.3.5a/ida/include/stdbool.h deleted file mode 100644 index 9bfafa6..0000000 --- a/3.3.5a/ida/include/stdbool.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef IDA_STD_BOOL_H -#define IDA_STD_BOOL_H - -#endif \ No newline at end of file diff --git a/3.3.5a/ida/include/stdint.h b/3.3.5a/ida/include/stdint.h deleted file mode 100644 index 1eece58..0000000 --- a/3.3.5a/ida/include/stdint.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef IDA_STD_INT_H -#define IDA_STD_INT_H - -typedef signed char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef long long int64_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -typedef int32_t ptrdiff_t; -typedef uint32_t uintptr_t; -typedef int32_t intptr_t; - -#endif \ No newline at end of file diff --git a/3.3.5a/include/common/datarecycler.h b/3.3.5a/include/common/datarecycler.h new file mode 100644 index 0000000..cacb782 --- /dev/null +++ b/3.3.5a/include/common/datarecycler.h @@ -0,0 +1,39 @@ +#ifndef COMMON_DATA_RECYCLER_H +#define COMMON_DATA_RECYCLER_H + +#include "system/types.h" + +DECLARE_STRUCT(CDataRecycler); +DECLARE_STRUCT(CDataRecycler__vtable); +DECLARE_STRUCT(CDataRecycler__NodeBlock); +DECLARE_STRUCT(CDataRecycler__Node); + +struct CDataRecycler__vtable { + void *v_fn_00; + void *v_fn_01; + void *v_fn_02; + void *v_fn_03; + void *v_fn_04; +}; + +struct CDataRecycler__Node { + CDataRecycler__Node* m_next; + void* m_data; + uint32_t m_bytes; +}; + +struct CDataRecycler__NodeBlock { + CDataRecycler__NodeBlock* m_next; + CDataRecycler__Node m_nodes[1]; +}; + +struct CDataRecycler { + CDataRecycler__vtable* v_vtable; + int32_t m_nodesRecyclable; + uint32_t m_nodesPerBlock; + CDataRecycler__NodeBlock* m_nodeBlockList; + CDataRecycler__Node* m_nodeFullList; + CDataRecycler__Node* m_nodeEmptyList; +}; + +#endif diff --git a/3.3.5a/include/common/handle.h b/3.3.5a/include/common/handle.h new file mode 100644 index 0000000..2e3fb4a --- /dev/null +++ b/3.3.5a/include/common/handle.h @@ -0,0 +1,13 @@ +#ifndef COMMON_HANDLE_H +#define COMMON_HANDLE_H + +#include "system/types.h" + +#if !defined(DECLARE_HANDLE) +#define DECLARE_HANDLE(name) \ +typedef struct name##__ { \ + int32_t unused; \ +}* name +#endif + +#endif \ No newline at end of file diff --git a/3.3.5a/include/common/instance.h b/3.3.5a/include/common/instance.h new file mode 100644 index 0000000..d7d1748 --- /dev/null +++ b/3.3.5a/include/common/instance.h @@ -0,0 +1,43 @@ +#ifndef COMMON_INSTANCE_H +#define COMMON_INSTANCE_H + +#include "system/types.h" + +#include "storm/list.h" +#include "storm/thread.h" + +// TSList +// TSLinkedNode +// TInstanceId +// TSingletonInstanceId +#define COMMON_INSTANCE_ID(T) \ +STORM_TS_LIST(T) \ +typedef struct TInstanceId_##T TInstanceId_##T; \ +typedef struct TSingletonInstanceId_##T TSingletonInstanceId_##T; \ +struct TInstanceId_##T { \ + TSLinkedNode_##T b_base; \ + uint32_t m_id; \ +}; \ +struct TSingletonInstanceId_##T { \ + TInstanceId_##T b_base; \ +}; + +#define COMMON_INSTANCE_ID_TABLE(T) \ +STORM_TS_LIST(T) \ +typedef struct TInstanceIdTable_##T TInstanceIdTable_##T; \ +struct TInstanceIdTable_##T { \ + SCritSect m_idCritSect; \ + uint32_t m_id; \ + int32_t m_idWrapped; \ + CSRWLock m_idLock[8]; \ + TSList_##T m_idList[8]; \ +}; + +// template +// class TExtraInstanceRecyclable +typedef struct TExtraInstanceRecyclable TExtraInstanceRecyclable; +struct TExtraInstanceRecyclable { + uint32_t m_recycleBytes; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/d3d9/caps.h b/3.3.5a/include/d3d9/caps.h index 062591a..becadc2 100644 --- a/3.3.5a/include/d3d9/caps.h +++ b/3.3.5a/include/d3d9/caps.h @@ -1,7 +1,7 @@ #ifndef D3D9_CAPS_H #define D3D9_CAPS_H -#include +#include "system/types.h" typedef enum D3DDEVTYPE D3DDEVTYPE; typedef struct D3DVSHADERCAPS2_0 D3DVSHADERCAPS2_0; diff --git a/3.3.5a/include/d3d9/device.h b/3.3.5a/include/d3d9/device.h index d36f960..ba6dd7f 100644 --- a/3.3.5a/include/d3d9/device.h +++ b/3.3.5a/include/d3d9/device.h @@ -1,7 +1,7 @@ #ifndef D3D9_DEVICE_H #define D3D9_DEVICE_H -#include +#include "system/types.h" #include "d3d9/caps.h" diff --git a/3.3.5a/include/event/context.h b/3.3.5a/include/event/context.h new file mode 100644 index 0000000..255c7b7 --- /dev/null +++ b/3.3.5a/include/event/context.h @@ -0,0 +1,66 @@ +#ifndef EVENT_CONTEXT_H +#define EVENT_CONTEXT_H + +#include "storm/thread.h" + +#include "common/instance.h" +#include "storm/queue/timer_priority_uint32_t.h" + +#include "event/message.h" +#include "event/handler.h" +#include "event/keydown.h" +#include "event/types.h" +#include "event/timer.h" +#include "event/id_table.h" + +DECLARE_ENUM(SCHEDSTATE); +DECLARE_STRUCT(EvtContext); +DECLARE_STRUCT(EvtTimer); +DECLARE_HANDLE(HPROPCONTEXT); + +// EvtContext::SCHEDSTATE +enum SCHEDSTATE { + SCHEDSTATE_ACTIVE = 0x0, + SCHEDSTATE_CLOSED = 0x1, + SCHEDSTATE_DESTROYED = 0x2, + _UNIQUE_SYMBOL_SCHEDSTATE_96 = 0xFFFFFFFF +}; + +COMMON_INSTANCE_ID(EvtContext); + +// class EvtContext : public TSingletonInstanceId, m_id)> +struct EvtContext { + TSingletonInstanceId_EvtContext b_base; + uint32_t unkA; + // Member variables + SCritSect m_critsect; + uint32_t m_currTime; + SCHEDSTATE m_schedState; + TSTimerPriority_uint32_t m_schedNextWakeTime; + uint32_t m_schedLastIdle; + uint32_t m_schedFlags; + uint32_t m_schedIdleTime; + uint32_t m_schedInitialIdleTime; + uint32_t m_schedWeight; + uint32_t m_schedSmoothWeight; + int32_t m_schedRebalance; + int32_t unkXX; + int32_t unkXY; + int32_t unkXZ; + int32_t unkYY; + int32_t unkYZ; + // TSExplicitList m_queueHandlerList[EVENTIDS]; + TSExplicitList_EvtHandler m_queueHandlerList[36]; + // TSExplicitList m_queueMessageList; + TSExplicitList_EvtMessage m_queueMessageList; + uint32_t m_queueSyncButtonState; + // TSExplicitList m_queueSyncKeyDownList; + TSExplicitList_EvtKeyDown m_queueSyncKeyDownList; + EvtIdTable_pointer_to_EvtTimer m_timerIdTable; + EvtTimerQueue m_timerQueue; + HPROPCONTEXT m_propContext; + void* m_callContext; + uint32_t m_startWatchdog; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/event/handler.h b/3.3.5a/include/event/handler.h new file mode 100644 index 0000000..5fb2e50 --- /dev/null +++ b/3.3.5a/include/event/handler.h @@ -0,0 +1,20 @@ +#ifndef EVENT_HANDLER_H +#define EVENT_HANDLER_H + +#include "system/types.h" + +#include "storm/list.h" + +DECLARE_STRUCT(EvtHandler); + +STORM_TS_LIST(EvtHandler); + +struct EvtHandler { + TSLink_EvtHandler link; + int32_t (*func)(const void*, void*); + void* param; + float priority; + int32_t marker; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/event/id_table.h b/3.3.5a/include/event/id_table.h new file mode 100644 index 0000000..a6b8c2d --- /dev/null +++ b/3.3.5a/include/event/id_table.h @@ -0,0 +1,15 @@ +#ifndef EVENT_ID_TABLE_H +#define EVENT_ID_TABLE_H + +#include "storm/array.h" +#include "storm/array/uint32_t.h" +#include "event/timer.h" + +DECLARE_STRUCT(EvtIdTable_pointer_to_EvtTimer); + +struct EvtIdTable_pointer_to_EvtTimer { + TSGrowableArray_pointer_to_EvtTimer m_allocArray; + TSGrowableArray_uint32_t m_freeArray; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/event/keydown.h b/3.3.5a/include/event/keydown.h new file mode 100644 index 0000000..d99887f --- /dev/null +++ b/3.3.5a/include/event/keydown.h @@ -0,0 +1,16 @@ +#ifndef EVENT_KEY_DOWN_H +#define EVENT_KEY_DOWN_H + +#include "storm/list.h" +#include "event/types.h" + +typedef struct EvtKeyDown EvtKeyDown; + +STORM_TS_LIST(EvtKeyDown); + +struct EvtKeyDown { + TSLink_EvtKeyDown link; + KEY key; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/event/message.h b/3.3.5a/include/event/message.h new file mode 100644 index 0000000..787ed27 --- /dev/null +++ b/3.3.5a/include/event/message.h @@ -0,0 +1,23 @@ +#ifndef EVENT_MESSAGE_H +#define EVENT_MESSAGE_H + +#include "system/types.h" + +#include "common/instance.h" +#include "storm/list.h" + +#include "event/types.h" + +typedef struct EvtMessage EvtMessage; + +STORM_TS_LIST(EvtMessage); + +// class EvtMessage : public TExtraInstanceRecyclable +struct EvtMessage { + TExtraInstanceRecyclable b_base; + TSLink_EvtMessage link; + EVENTID id; + char data[4]; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/event/timer.h b/3.3.5a/include/event/timer.h new file mode 100644 index 0000000..6bc891e --- /dev/null +++ b/3.3.5a/include/event/timer.h @@ -0,0 +1,32 @@ +#ifndef EVENT_TIMER_H +#define EVENT_TIMER_H + +#include "system/types.h" + +#include "storm/queue/timer_priority_uint32_t.h" + +DECLARE_STRUCT(EvtTimer); +DECLARE_STRUCT(EvtTimerQueue); + +// class EvtTimer +struct EvtTimer { + // Member variables + uint32_t id; + TSTimerPriority_uint32_t targetTime; + float timeout; + int32_t (*handler)(const void*, void*); + void* param; + int32_t (*guidHandler)(const void*, uint64_t, void*); + uint64_t guidParam; + void* guidParam2; +}; + +STORM_TS_PRIORITY_QUEUE(EvtTimer); +STORM_TS_GROWABLE_ARRAY_POINTER_TO(EvtTimer); + +// class EvtTimerQueue : public TSPriorityQueue +struct EvtTimerQueue { + TSPriorityQueue_EvtTimer b_base; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/event/types.h b/3.3.5a/include/event/types.h new file mode 100644 index 0000000..76dae16 --- /dev/null +++ b/3.3.5a/include/event/types.h @@ -0,0 +1,277 @@ +#ifndef EVENT_TYPES_H +#define EVENT_TYPES_H + +#include "system/types.h" + +DECLARE_ENUM(EVENTID); +DECLARE_ENUM(KEY); +DECLARE_ENUM(MOUSEBUTTON); +DECLARE_ENUM(MOUSEMODE); +DECLARE_ENUM(OSINPUT); +DECLARE_ENUM(OS_MOUSE_MODE); + +DECLARE_STRUCT(OSEVENT); +DECLARE_STRUCT(EVENT_DATA_CHAR); +DECLARE_STRUCT(EVENT_DATA_FOCUS); +DECLARE_STRUCT(EVENT_DATA_IDLE); +DECLARE_STRUCT(EVENT_DATA_KEY); +DECLARE_STRUCT(EVENT_DATA_MOUSE); +DECLARE_STRUCT(EVENT_DATA_SIZE); + +typedef void* HEVENTCONTEXT; +typedef int32_t (*EVENTHANDLERFUNC)(const void*, void*); + +enum EVENTID { + EVENT_ID_0 = 0, + EVENT_ID_CHAR = 1, + EVENT_ID_FOCUS = 2, + EVENT_ID_3 = 3, + EVENT_ID_DESTROY = 4, + EVENT_ID_5 = 5, + EVENT_ID_IDLE = 6, + EVENT_ID_POLL = 7, + EVENT_ID_INITIALIZE = 8, + EVENT_ID_KEYDOWN = 9, + EVENT_ID_KEYUP = 10, + EVENT_ID_KEYDOWN_REPEATING = 11, + EVENT_ID_MOUSEDOWN = 12, + EVENT_ID_MOUSEMOVE = 13, + EVENT_ID_MOUSEMOVE_RELATIVE = 14, + EVENT_ID_MOUSEUP = 15, + EVENT_ID_MOUSEMODE_CHANGED = 16, + EVENT_ID_MOUSEWHEEL = 17, + EVENT_ID_18 = 18, + EVENT_ID_19 = 19, + EVENT_ID_20 = 20, + EVENT_ID_21 = 21, + EVENT_ID_22 = 22, + EVENT_ID_PAINT = 23, + EVENT_ID_NET_DATA = 24, + EVENT_ID_NET_CONNECT = 25, + EVENT_ID_NET_DISCONNECT = 26, + EVENT_ID_NET_CANTCONNECT = 27, + EVENT_ID_NET_DESTROY = 28, + EVENT_ID_NET_AUTH_CHALLENGE = 29, + EVENT_ID_30 = 30, + EVENT_ID_31 = 31, + EVENT_ID_32 = 32, + EVENT_ID_33 = 33, + EVENT_ID_IME = 34, + EVENT_ID_SIZE = 35, + EVENTIDS = 36 +}; + +enum KEY { + KEY_NONE = 0xFFFFFFFF, + KEY_LSHIFT = 0x0, + KEY_RSHIFT = 0x1, + KEY_LCONTROL = 0x2, + KEY_RCONTROL = 0x3, + KEY_LALT = 0x4, + KEY_RALT = 0x5, + KEY_LASTMETAKEY = 0x5, + KEY_SPACE = 0x20, + KEY_0 = 0x30, + KEY_1 = 0x31, + KEY_2 = 0x32, + KEY_3 = 0x33, + KEY_4 = 0x34, + KEY_5 = 0x35, + KEY_6 = 0x36, + KEY_7 = 0x37, + KEY_8 = 0x38, + KEY_9 = 0x39, + KEY_A = 0x41, + KEY_B = 0x42, + KEY_C = 0x43, + KEY_D = 0x44, + KEY_E = 0x45, + KEY_F = 0x46, + KEY_G = 0x47, + KEY_H = 0x48, + KEY_I = 0x49, + KEY_J = 0x4A, + KEY_K = 0x4B, + KEY_L = 0x4C, + KEY_M = 0x4D, + KEY_N = 0x4E, + KEY_O = 0x4F, + KEY_P = 0x50, + KEY_Q = 0x51, + KEY_R = 0x52, + KEY_S = 0x53, + KEY_T = 0x54, + KEY_U = 0x55, + KEY_V = 0x56, + KEY_W = 0x57, + KEY_X = 0x58, + KEY_Y = 0x59, + KEY_Z = 0x5A, + KEY_TILDE = 0x60, + KEY_NUMPAD0 = 0x100, + KEY_NUMPAD1 = 0x101, + KEY_NUMPAD2 = 0x102, + KEY_NUMPAD3 = 0x103, + KEY_NUMPAD4 = 0x104, + KEY_NUMPAD5 = 0x105, + KEY_NUMPAD6 = 0x106, + KEY_NUMPAD7 = 0x107, + KEY_NUMPAD8 = 0x108, + KEY_NUMPAD9 = 0x109, + KEY_NUMPAD_PLUS = 0x10A, + KEY_NUMPAD_MINUS = 0x10B, + KEY_NUMPAD_MULTIPLY = 0x10C, + KEY_NUMPAD_DIVIDE = 0x10D, + KEY_NUMPAD_DECIMAL = 0x10E, + KEY_NUMPAD_EQUALS = 0x30C, + KEY_PLUS = 0x3D, + KEY_MINUS = 0x2D, + KEY_BRACKET_OPEN = 0x5B, + KEY_BRACKET_CLOSE = 0x5D, + KEY_SLASH = 0x2F, + KEY_BACKSLASH = 0x5C, + KEY_SEMICOLON = 0x3B, + KEY_APOSTROPHE = 0x27, + KEY_COMMA = 0x2C, + KEY_PERIOD = 0x2E, + KEY_ESCAPE = 0x200, + KEY_ENTER = 0x201, + KEY_BACKSPACE = 0x202, + KEY_TAB = 0x203, + KEY_LEFT = 0x204, + KEY_UP = 0x205, + KEY_RIGHT = 0x206, + KEY_DOWN = 0x207, + KEY_INSERT = 0x208, + KEY_DELETE = 0x209, + KEY_HOME = 0x20A, + KEY_END = 0x20B, + KEY_PAGEUP = 0x20C, + KEY_PAGEDOWN = 0x20D, + KEY_CAPSLOCK = 0x20E, + KEY_NUMLOCK = 0x20F, + KEY_SCROLLLOCK = 0x210, + KEY_PAUSE = 0x211, + KEY_PRINTSCREEN = 0x212, + KEY_F1 = 0x300, + KEY_F2 = 0x301, + KEY_F3 = 0x302, + KEY_F4 = 0x303, + KEY_F5 = 0x304, + KEY_F6 = 0x305, + KEY_F7 = 0x306, + KEY_F8 = 0x307, + KEY_F9 = 0x308, + KEY_F10 = 0x309, + KEY_F11 = 0x30A, + KEY_F12 = 0x30B, + KEY_F13 = 0x212, + KEY_F14 = 0x30D, + KEY_F15 = 0x30E, + KEY_F16 = 0x30F, + KEY_F17 = 0x310, + KEY_F18 = 0x311, + KEY_F19 = 0x312, + KEY_LAST = 0x313 +}; + +enum MOUSEBUTTON { + MOUSE_BUTTON_NONE = 0x0, + MOUSE_BUTTON_LEFT = 0x1, + MOUSE_BUTTON_MIDDLE = 0x2, + MOUSE_BUTTON_RIGHT = 0x4, + MOUSE_BUTTON_XBUTTON1 = 0x8, + MOUSE_BUTTON_XBUTTON2 = 0x10, + MOUSE_BUTTON_XBUTTON3 = 0x20, + MOUSE_BUTTON_XBUTTON4 = 0x40, + MOUSE_BUTTON_XBUTTON5 = 0x80, + MOUSE_BUTTON_XBUTTON6 = 0x100, + MOUSE_BUTTON_XBUTTON7 = 0x200, + MOUSE_BUTTON_XBUTTON8 = 0x400, + MOUSE_BUTTON_XBUTTON9 = 0x800, + MOUSE_BUTTON_XBUTTON10 = 0x1000, + MOUSE_BUTTON_XBUTTON11 = 0x2000, + MOUSE_BUTTON_XBUTTON12 = 0x4000, + MOUSE_BUTTON_ALL = 0xFFFFFFFF +}; + +enum MOUSEMODE { + MOUSE_MODE_NORMAL = 0x0, + MOUSE_MODE_RELATIVE = 0x1, + MOUSE_MODES = 0x2 +}; + +enum OSINPUT { + OS_INPUT_CAPTURE_CHANGED = 0, + OS_INPUT_CHAR = 1, + OS_INPUT_STRING = 2, + OS_INPUT_IME = 3, + OS_INPUT_SIZE = 4, + OS_INPUT_CLOSE = 5, + OS_INPUT_FOCUS = 6, + OS_INPUT_KEY_DOWN = 7, + OS_INPUT_KEY_UP = 8, + OS_INPUT_MOUSE_DOWN = 9, + OS_INPUT_MOUSE_MOVE = 10, + OS_INPUT_MOUSE_WHEEL = 11, + OS_INPUT_MOUSE_MOVE_RELATIVE = 12, + OS_INPUT_MOUSE_UP = 13, + OS_INPUT_14 = 14, + OS_INPUT_15 = 15, + OS_INPUT_16 = 16, + OS_INPUT_17 = 17, + OS_INPUT_18 = 18, + OS_INPUT_SHUTDOWN = 19 +}; + +enum OS_MOUSE_MODE { + OS_MOUSE_MODE_NORMAL = 0, + OS_MOUSE_MODE_RELATIVE = 1, + OS_MOUSE_MODES = 2, +}; + +struct OSEVENT { + OSINPUT id; + int32_t param[4]; +}; + +struct EVENT_DATA_CHAR { + int32_t ch; + uint32_t metaKeyState; + uint32_t repeat; +}; + +struct EVENT_DATA_FOCUS { + int32_t focus; +}; + +struct EVENT_DATA_IDLE { + float elapsedSec; + uint32_t time; +}; + +struct EVENT_DATA_KEY { + KEY key; + uint32_t metaKeyState; + uint32_t repeat; + uint32_t time; +}; + +struct EVENT_DATA_MOUSE { + MOUSEMODE mode; + MOUSEBUTTON button; + uint32_t buttonState; + uint32_t metaKeyState; + uint32_t flags; + float x; + float y; + int32_t wheelDistance; + uint32_t time; +}; + +struct EVENT_DATA_SIZE { + int32_t w; + int32_t h; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/framescript/event_object.h b/3.3.5a/include/framescript/event_object.h new file mode 100644 index 0000000..78a2ed3 --- /dev/null +++ b/3.3.5a/include/framescript/event_object.h @@ -0,0 +1,35 @@ +#ifndef FRAMESCRIPT_EVENT_OBJECT_H +#define FRAMESCRIPT_EVENT_OBJECT_H + +#include "storm/hash.h" + +#include "framescript/object.h" + +#include "ui/simpleframe.h" + +DECLARE_STRUCT(FrameScript_EventObject); +DECLARE_STRUCT(SIMPLEFRAMENODE); +DECLARE_STRUCT(EVENTLISTENERNODE); + +STORM_TS_LIST(SIMPLEFRAMENODE); +STORM_TS_LIST(EVENTLISTENERNODE); + +// struct SIMPLEFRAMENODE : TSLinkedNode +struct SIMPLEFRAMENODE { + TSLinkedNode_SIMPLEFRAMENODE b_base; + CSimpleFrame* frame; +}; + +// struct EVENTLISTENERNODE : TSLinkedNode { +struct EVENTLISTENERNODE { + TSLinkedNode_EVENTLISTENERNODE b_base; + FrameScript_Object* listener; +}; + +STORM_TS_HASH(FrameScript_EventObject, HASHKEY_STRI) + +struct FrameScript_EventObject { + TSHashObject_FrameScript_EventObject_HASHKEY_STRI b_base; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/framescript/object.h b/3.3.5a/include/framescript/object.h new file mode 100644 index 0000000..05e6821 --- /dev/null +++ b/3.3.5a/include/framescript/object.h @@ -0,0 +1,15 @@ +#ifndef FRAMESCRIPT_OBJECT_H +#define FRAMESCRIPT_OBJECT_H + +#include "system/types.h" + +DECLARE_STRUCT(FrameScript_Object); + +struct FrameScript_Object { + void** v_vtable; + int32_t lua_registered; + int32_t lua_objectRef; + int32_t m_onEvent; +}; + +#endif diff --git a/3.3.5a/include/gx/buffer.h b/3.3.5a/include/gx/buffer.h index 1eed0c4..3506ecc 100644 --- a/3.3.5a/include/gx/buffer.h +++ b/3.3.5a/include/gx/buffer.h @@ -1,136 +1,136 @@ -#ifndef GX_BUFFER_H -#define GX_BUFFER_H - -#include - -#include "storm/list.h" -#include "tempest/vector.h" - -typedef enum EGxPoolHintBits EGxPoolHintBits; -typedef enum EGxPoolTarget EGxPoolTarget; -typedef enum EGxPoolUsage EGxPoolUsage; -typedef enum EGxVertexAttrib EGxVertexAttrib; -typedef enum EGxVertexBufferFormat EGxVertexBufferFormat; -typedef struct ubyte4 ubyte4; -typedef struct CGxVertexAttrib CGxVertexAttrib; -typedef struct CGxVertexPBNT2 CGxVertexPBNT2; -typedef struct CGxVertexPCT CGxVertexPCT; -typedef struct CGxPool CGxPool; -typedef struct CGxBuf CGxBuf; - -enum EGxPoolHintBits { - GxPoolHintBit_Unk0 = 0, - GxPoolHintBit_Unk1 = 1, - GxPoolHintBit_Unk2 = 2, - GxPoolHintBit_Unk3 = 3 -}; - -enum EGxPoolTarget { - GxPoolTarget_Vertex = 0, - GxPoolTarget_Index = 1, - GxPoolTargets_Last = 2 -}; - -enum EGxPoolUsage { - GxPoolUsage_Static = 0, - GxPoolUsage_Dynamic = 1, - GxPoolUsage_Stream = 2, - GxPoolUsages_Last = 3 -}; - -enum EGxVertexAttrib { - GxVA_Position = 0, - GxVA_BlendWeight = 1, - GxVA_BlendIndices = 2, - GxVA_Normal = 3, - GxVA_Color0 = 4, - GxVA_Color1 = 5, - GxVA_TexCoord0 = 6, - GxVA_TexCoord1 = 7, - GxVA_TexCoord2 = 8, - GxVA_TexCoord3 = 9, - GxVA_TexCoord4 = 10, - GxVA_TexCoord5 = 11, - GxVA_TexCoord6 = 12, - GxVA_TexCoord7 = 13, - GxVAs_Last = 14 -}; - -enum EGxVertexBufferFormat { - GxVBF_P = 0, - GxVBF_PN = 1, - GxVBF_PNC = 2, - GxVBF_PNT = 3, - GxVBF_PNCT = 4, - GxVBF_PNT2 = 5, - GxVBF_PNCT2 = 6, - GxVBF_PC = 7, - GxVBF_PCT = 8, - GxVBF_PCT2 = 9, - GxVBF_PT = 10, - GxVBF_PT2 = 11, - GxVBF_PBNT2 = 12, - GxVBF_PNC2T2 = 13, - GxVertexBufferFormats_Last = 14 -}; - -struct ubyte4 { - union { - uint8_t b[4]; - uint32_t u; - }; -}; - -struct CGxVertexAttrib { - EGxVertexAttrib attrib; - uint32_t type; - uint32_t offset; - uint32_t bufSize; -}; - -struct CGxVertexPBNT2 { - C3Vector p; - ubyte4 bw; - ubyte4 bi; - C3Vector n; - C2Vector tc[2]; -}; - -struct CGxVertexPCT { - C3Vector p; - CImVector c; - C2Vector tc[1]; -}; - -STORM_TS_LIST(CGxBuf); -STORM_TS_LIST(CGxPool); - -// class CGxPool : public TSLinkedNode -struct CGxPool { - TSLinkedNode_CGxPool b_base; - EGxPoolTarget m_target; - EGxPoolUsage m_usage; - int32_t m_size; - void* m_apiSpecific; - void* m_mem; - int32_t unk1C; // TODO - TSList_CGxBuf m_bufList; - EGxPoolHintBits m_hint; - const char* m_name; -}; - -// class CGxBuf : public TSLinkedNode -struct CGxBuf { - TSLinkedNode_CGxBuf b_base; - CGxPool* m_pool; - uint32_t m_itemSize; - uint32_t m_itemCount; - uint32_t m_size; - uint32_t m_index; - uint8_t unk1C; // TODO - uint8_t unk1D; // TODO - uint8_t unk1E; // TODO - uint8_t unk1F; // TODO -}; - +#ifndef GX_BUFFER_H +#define GX_BUFFER_H + +#include "system/types.h" + +#include "storm/list.h" +#include "tempest/vector.h" + +typedef enum EGxPoolHintBits EGxPoolHintBits; +typedef enum EGxPoolTarget EGxPoolTarget; +typedef enum EGxPoolUsage EGxPoolUsage; +typedef enum EGxVertexAttrib EGxVertexAttrib; +typedef enum EGxVertexBufferFormat EGxVertexBufferFormat; +typedef struct ubyte4 ubyte4; +typedef struct CGxVertexAttrib CGxVertexAttrib; +typedef struct CGxVertexPBNT2 CGxVertexPBNT2; +typedef struct CGxVertexPCT CGxVertexPCT; +typedef struct CGxPool CGxPool; +typedef struct CGxBuf CGxBuf; + +enum EGxPoolHintBits { + GxPoolHintBit_Unk0 = 0, + GxPoolHintBit_Unk1 = 1, + GxPoolHintBit_Unk2 = 2, + GxPoolHintBit_Unk3 = 3 +}; + +enum EGxPoolTarget { + GxPoolTarget_Vertex = 0, + GxPoolTarget_Index = 1, + GxPoolTargets_Last = 2 +}; + +enum EGxPoolUsage { + GxPoolUsage_Static = 0, + GxPoolUsage_Dynamic = 1, + GxPoolUsage_Stream = 2, + GxPoolUsages_Last = 3 +}; + +enum EGxVertexAttrib { + GxVA_Position = 0, + GxVA_BlendWeight = 1, + GxVA_BlendIndices = 2, + GxVA_Normal = 3, + GxVA_Color0 = 4, + GxVA_Color1 = 5, + GxVA_TexCoord0 = 6, + GxVA_TexCoord1 = 7, + GxVA_TexCoord2 = 8, + GxVA_TexCoord3 = 9, + GxVA_TexCoord4 = 10, + GxVA_TexCoord5 = 11, + GxVA_TexCoord6 = 12, + GxVA_TexCoord7 = 13, + GxVAs_Last = 14 +}; + +enum EGxVertexBufferFormat { + GxVBF_P = 0, + GxVBF_PN = 1, + GxVBF_PNC = 2, + GxVBF_PNT = 3, + GxVBF_PNCT = 4, + GxVBF_PNT2 = 5, + GxVBF_PNCT2 = 6, + GxVBF_PC = 7, + GxVBF_PCT = 8, + GxVBF_PCT2 = 9, + GxVBF_PT = 10, + GxVBF_PT2 = 11, + GxVBF_PBNT2 = 12, + GxVBF_PNC2T2 = 13, + GxVertexBufferFormats_Last = 14 +}; + +struct ubyte4 { + union { + uint8_t b[4]; + uint32_t u; + }; +}; + +struct CGxVertexAttrib { + EGxVertexAttrib attrib; + uint32_t type; + uint32_t offset; + uint32_t bufSize; +}; + +struct CGxVertexPBNT2 { + C3Vector p; + ubyte4 bw; + ubyte4 bi; + C3Vector n; + C2Vector tc[2]; +}; + +struct CGxVertexPCT { + C3Vector p; + CImVector c; + C2Vector tc[1]; +}; + +STORM_TS_LIST(CGxBuf); +STORM_TS_LIST(CGxPool); + +// class CGxPool : public TSLinkedNode +struct CGxPool { + TSLinkedNode_CGxPool b_base; + EGxPoolTarget m_target; + EGxPoolUsage m_usage; + int32_t m_size; + void* m_apiSpecific; + void* m_mem; + int32_t unk1C; // TODO + TSList_CGxBuf m_bufList; + EGxPoolHintBits m_hint; + const char* m_name; +}; + +// class CGxBuf : public TSLinkedNode +struct CGxBuf { + TSLinkedNode_CGxBuf b_base; + CGxPool* m_pool; + uint32_t m_itemSize; + uint32_t m_itemCount; + uint32_t m_size; + uint32_t m_index; + uint8_t unk1C; // TODO + uint8_t unk1D; // TODO + uint8_t unk1E; // TODO + uint8_t unk1F; // TODO +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/gx/caps.h b/3.3.5a/include/gx/caps.h index 6e571aa..685e395 100644 --- a/3.3.5a/include/gx/caps.h +++ b/3.3.5a/include/gx/caps.h @@ -1,7 +1,7 @@ #ifndef GX_CAPS_H #define GX_CAPS_H -#include +#include "system/types.h" #include "gx/types.h" diff --git a/3.3.5a/include/gx/device.h b/3.3.5a/include/gx/device.h index 2183ae0..90bad4c 100644 --- a/3.3.5a/include/gx/device.h +++ b/3.3.5a/include/gx/device.h @@ -1,7 +1,7 @@ #ifndef GX_DEVICE_H #define GX_DEVICE_H -#include +#include "system/types.h" #include "storm/array.h" #include "storm/array/uint32_t.h" diff --git a/3.3.5a/include/gx/format.h b/3.3.5a/include/gx/format.h index 899f091..9302ff4 100644 --- a/3.3.5a/include/gx/format.h +++ b/3.3.5a/include/gx/format.h @@ -1,8 +1,7 @@ #ifndef GX_FORMAT_H #define GX_FORMAT_H -#include -#include +#include "system/types.h" #include "tempest/vector.h" diff --git a/3.3.5a/include/gx/matrix_stack.h b/3.3.5a/include/gx/matrix_stack.h index 8769c10..6026954 100644 --- a/3.3.5a/include/gx/matrix_stack.h +++ b/3.3.5a/include/gx/matrix_stack.h @@ -1,22 +1,22 @@ -#ifndef GX_MATRIX_STACK_H -#define GX_MATRIX_STACK_H - -#include - -#include "tempest/matrix.h" - -typedef enum CGxMatrixStack__EMatrixFlags CGxMatrixStack__EMatrixFlags; -typedef struct CGxMatrixStack CGxMatrixStack; - -enum CGxMatrixStack__EMatrixFlags { - F_Identity = 0x1 -}; - -struct CGxMatrixStack { - uint32_t m_level; - int8_t m_dirty; - C44Matrix m_mtx[4]; - uint32_t m_flags[4]; -}; - +#ifndef GX_MATRIX_STACK_H +#define GX_MATRIX_STACK_H + +#include "system/types.h" + +#include "tempest/matrix.h" + +typedef enum CGxMatrixStack__EMatrixFlags CGxMatrixStack__EMatrixFlags; +typedef struct CGxMatrixStack CGxMatrixStack; + +enum CGxMatrixStack__EMatrixFlags { + F_Identity = 0x1 +}; + +struct CGxMatrixStack { + uint32_t m_level; + int8_t m_dirty; + C44Matrix m_mtx[4]; + uint32_t m_flags[4]; +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/gx/state_bom.h b/3.3.5a/include/gx/state_bom.h index e31270e..d841a5e 100644 --- a/3.3.5a/include/gx/state_bom.h +++ b/3.3.5a/include/gx/state_bom.h @@ -1,21 +1,21 @@ -#ifndef GX_STATE_BOM_H -#define GX_STATE_BOM_H - -#include -#include "storm/array.h" - -typedef struct CGxStateBom CGxStateBom; - -struct CGxStateBom { - union { - int32_t i[3]; - uint32_t u[3]; - float f[3]; - void* p; - } m_data; - - int32_t filler; -}; -STORM_TS_FIXED_ARRAY(CGxStateBom); - +#ifndef GX_STATE_BOM_H +#define GX_STATE_BOM_H + +#include "system/types.h" +#include "storm/array.h" + +typedef struct CGxStateBom CGxStateBom; + +struct CGxStateBom { + union { + int32_t i[3]; + uint32_t u[3]; + float f[3]; + void* p; + } m_data; + + int32_t filler; +}; +STORM_TS_FIXED_ARRAY(CGxStateBom); + #endif \ No newline at end of file diff --git a/3.3.5a/include/gx/types.h b/3.3.5a/include/gx/types.h index a7d8a7e..f7c9612 100644 --- a/3.3.5a/include/gx/types.h +++ b/3.3.5a/include/gx/types.h @@ -1,7 +1,7 @@ #ifndef GX_TYPES_H #define GX_TYPES_H -#include +#include "system/types.h" #include "storm/array.h" diff --git a/3.3.5a/include/main.h b/3.3.5a/include/main.h index a38c545..18107c2 100644 --- a/3.3.5a/include/main.h +++ b/3.3.5a/include/main.h @@ -1,4 +1,38 @@ +// Defines + +#include "system/detect.h" + // Types + +#include "common/handle.h" +#include "common/instance.h" +#include "common/datarecycler.h" + +#include "d3d9/caps.h" +#include "d3d9/device.h" + +#include "event/types.h" +#include "event/context.h" +#include "event/handler.h" +#include "event/id_table.h" +#include "event/keydown.h" +#include "event/message.h" +#include "event/timer.h" + +#include "framescript/object.h" +#include "framescript/event_object.h" + +#include "gx/buffer.h" +#include "gx/caps.h" +#include "gx/device.h" +#include "gx/format.h" +#include "gx/matrix_stack.h" +#include "gx/shader.h" +#include "gx/state_bom.h" +#include "gx/types.h" +#include "gx/batch.h" +#include "gx/d3d9.h" + #include "storm/array.h" #include "storm/list.h" #include "storm/hash.h" @@ -12,22 +46,17 @@ #include "tempest/sphere.h" #include "tempest/vector.h" -#include "gx/buffer.h" -#include "gx/caps.h" -#include "gx/device.h" -#include "gx/format.h" -#include "gx/matrix_stack.h" -#include "gx/shader.h" -#include "gx/state_bom.h" -#include "gx/types.h" -#include "gx/batch.h" -#include "gx/d3d9.h" +#include "ui/simpleframe.h" // include files that define the use of template classes for standard library types // template classes for whoa types should be entered immediately after where the type is +#include "storm/array/pointer_to_void.h" +#include "storm/array/uint8_t.h" #include "storm/array/uint32_t.h" +#include "storm/queue/timer_priority_uint32_t.h" + // template types that are defined in our headers, should be declared immediately after the base type // and not used anywhere else diff --git a/3.3.5a/include/storm/array.h b/3.3.5a/include/storm/array.h index 1c037d7..41e5e47 100644 --- a/3.3.5a/include/storm/array.h +++ b/3.3.5a/include/storm/array.h @@ -1,7 +1,7 @@ #ifndef STORM_ARRAY_H #define STORM_ARRAY_H -#include +#include "system/types.h" #define STORM_TS_BASE_ARRAY(T) typedef struct TSBaseArray_##T TSBaseArray_##T; \ struct TSBaseArray_##T { \ @@ -25,4 +25,28 @@ struct TSGrowableArray_##T { \ uint32_t m_chunk; \ }; +// "pointer-to" types hack + +#define STORM_TS_BASE_ARRAY_POINTER_TO(T) typedef struct TSBaseArray_pointer_to_##T TSBaseArray_pointer_to_##T; \ +struct TSBaseArray_pointer_to_##T { \ + uint32_t m_alloc; \ + uint32_t m_count; \ + T** m_data; \ +}; + +#define STORM_TS_FIXED_ARRAY_POINTER_TO(T) typedef struct TSFixedArray_pointer_to_##T TSFixedArray_pointer_to_##T; \ +struct TSFixedArray_pointer_to_##T { \ + uint32_t m_alloc; \ + uint32_t m_count; \ + T** m_data; \ +}; + +#define STORM_TS_GROWABLE_ARRAY_POINTER_TO(T) typedef struct TSGrowableArray_pointer_to_##T TSGrowableArray_pointer_to_##T; \ +struct TSGrowableArray_pointer_to_##T { \ + uint32_t m_alloc; \ + uint32_t m_count; \ + T** m_data; \ + uint32_t m_chunk; \ +}; + #endif diff --git a/3.3.5a/include/storm/array/pointer_to_void.h b/3.3.5a/include/storm/array/pointer_to_void.h new file mode 100644 index 0000000..f07eedd --- /dev/null +++ b/3.3.5a/include/storm/array/pointer_to_void.h @@ -0,0 +1,10 @@ +#ifndef STORM_ARRAY_POINTER_TO_VOID_H +#define STORM_ARRAY_POINTER_TO_VOID_H + +#include "system/types.h" + +#include "storm/array.h" + +STORM_TS_GROWABLE_ARRAY_POINTER_TO(void); + +#endif \ No newline at end of file diff --git a/3.3.5a/include/storm/array/uint32_t.h b/3.3.5a/include/storm/array/uint32_t.h index ec11de9..38e2920 100644 --- a/3.3.5a/include/storm/array/uint32_t.h +++ b/3.3.5a/include/storm/array/uint32_t.h @@ -1,10 +1,10 @@ -#ifndef STORM_ARRAY_UINT32_T_H -#define STORM_ARRAY_UINT32_T_H - -#include - -#include "storm/array.h" - -STORM_TS_GROWABLE_ARRAY(uint32_t); - +#ifndef STORM_ARRAY_UINT32_T_H +#define STORM_ARRAY_UINT32_T_H + +#include "system/types.h" + +#include "storm/array.h" + +STORM_TS_GROWABLE_ARRAY(uint32_t); + #endif \ No newline at end of file diff --git a/3.3.5a/include/storm/array/uint8_t.h b/3.3.5a/include/storm/array/uint8_t.h index 5d8f12d..cd35f94 100644 --- a/3.3.5a/include/storm/array/uint8_t.h +++ b/3.3.5a/include/storm/array/uint8_t.h @@ -1,10 +1,10 @@ -#ifndef STORM_ARRAY_UINT8_T_H -#define STORM_ARRAY_UINT8_T_H - -#include - -#include "storm/array.h" - -STORM_TS_GROWABLE_ARRAY(uint8_t); - +#ifndef STORM_ARRAY_UINT8_T_H +#define STORM_ARRAY_UINT8_T_H + +#include "system/types.h" + +#include "storm/array.h" + +STORM_TS_GROWABLE_ARRAY(uint8_t); + #endif \ No newline at end of file diff --git a/3.3.5a/include/storm/hash.h b/3.3.5a/include/storm/hash.h index 811665e..1952edc 100644 --- a/3.3.5a/include/storm/hash.h +++ b/3.3.5a/include/storm/hash.h @@ -1,47 +1,48 @@ -#ifndef STORM_HASH_H -#define STORM_HASH_H - -#include - -#include "storm/array.h" -#include "storm/list.h" - -#define STORM_TS_HASH(T, K) \ -STORM_TS_LIST(T) \ -STORM_TS_GROWABLE_ARRAY(TSList_##T) \ -typedef struct TSHashTable_##T##_##K TSHashTable_##T##_##K; \ -typedef struct TSHashObject_##T##_##K TSHashObject_##T##_##K; \ -struct TSHashTable_##T##_##K { \ - TSList_##T m_fulllist; \ - uint32_t m_fullnessIndicator; \ - TSGrowableArray_TSList_##T m_slotlistarray; \ - uint32_t m_slotmask; \ -}; \ -struct TSHashObject_##T##_##K { \ - uint32_t m_hashval; \ - TSLink_##T m_linktoslot; \ - TSLink_##T m_linktofull; \ - K m_key; \ -}; - -typedef struct HASHKEY_PTR HASHKEY_PTR; -typedef struct HASHKEY_STR HASHKEY_STR; -typedef struct HASHKEY_STRI HASHKEY_STRI; -typedef struct HASHKEY_NONE HASHKEY_NONE; - -struct HASHKEY_PTR { - void* m_key; -}; - -struct HASHKEY_STR { - char* m_str; -}; - -struct HASHKEY_STRI { - char* m_str; -}; - -struct HASHKEY_NONE { -}; - +#ifndef STORM_HASH_H +#define STORM_HASH_H + +#include "system/types.h" + +#include "storm/array.h" +#include "storm/list.h" + +#define STORM_TS_HASH(T, K) \ +STORM_TS_LIST(T) \ +STORM_TS_GROWABLE_ARRAY(TSList_##T) \ +typedef struct TSHashTable_##T##_##K TSHashTable_##T##_##K; \ +typedef struct TSHashObject_##T##_##K TSHashObject_##T##_##K; \ +struct TSHashTable_##T##_##K { \ + TSList_##T m_fulllist; \ + uint32_t m_fullnessIndicator; \ + TSGrowableArray_TSList_##T m_slotlistarray; \ + uint32_t m_slotmask; \ +}; \ +struct TSHashObject_##T##_##K { \ + uint32_t m_hashval; \ + TSLink_##T m_linktoslot; \ + TSLink_##T m_linktofull; \ + K m_key; \ +}; + +DECLARE_STRUCT(HASHKEY_PTR); +DECLARE_STRUCT(HASHKEY_STR); +DECLARE_STRUCT(HASHKEY_STRI); +DECLARE_STRUCT(HASHKEY_NONE); + +struct HASHKEY_PTR { + void* m_key; +}; + +struct HASHKEY_STR { + char* m_str; +}; + +struct HASHKEY_STRI { + char* m_str; +}; + +struct HASHKEY_NONE { + int32_t m_unused; +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/storm/list.h b/3.3.5a/include/storm/list.h index 264d9be..7c64d20 100644 --- a/3.3.5a/include/storm/list.h +++ b/3.3.5a/include/storm/list.h @@ -1,31 +1,33 @@ -#ifndef STORM_LIST_H -#define STORM_LIST_H - -#include - -// to make an object self referential -// forward-declare 'struct Object_type' as 'Object_type' -// then define 'struct Object_type' - -// TSLink -#define STORM_TS_LINK(T) typedef struct TSLink_##T TSLink_##T; \ -struct TSLink_##T { \ - TSLink_##T* m_prevlink; \ - T* m_next; \ -}; - -// TSList -// TSLinkedNode -#define STORM_TS_LIST(T) \ -STORM_TS_LINK(T) \ -typedef struct TSList_##T TSList_##T; \ -typedef struct TSLinkedNode_##T TSLinkedNode_##T; \ -struct TSList_##T { \ - ptrdiff_t m_linkoffset; \ - TSLink_##T m_terminator; \ -}; \ -struct TSLinkedNode_##T { \ - TSLink_##T m_link; \ -}; - +#ifndef STORM_LIST_H +#define STORM_LIST_H + +#include "system/types.h" + +// to make an object self referential +// forward-declare 'struct Object_type' as 'Object_type' +// then define 'struct Object_type' + +// TSLink +#define STORM_TS_LINK(T) typedef struct TSLink_##T TSLink_##T; \ +struct TSLink_##T { \ + TSLink_##T* m_prevlink; \ + T* m_next; \ +}; + +// TSList +// TSExplicitList +// TSLinkedNode +#define STORM_TS_LIST(T) \ +STORM_TS_LINK(T) \ +typedef struct TSList_##T TSList_##T; \ +typedef struct TSList_##T TSExplicitList_##T; \ +typedef struct TSLinkedNode_##T TSLinkedNode_##T; \ +struct TSList_##T { \ + ptrdiff_t m_linkoffset; \ + TSLink_##T m_terminator; \ +}; \ +struct TSLinkedNode_##T { \ + TSLink_##T m_link; \ +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/storm/queue.h b/3.3.5a/include/storm/queue.h new file mode 100644 index 0000000..a4cd764 --- /dev/null +++ b/3.3.5a/include/storm/queue.h @@ -0,0 +1,31 @@ +#ifndef STORM_QUEUE_H +#define STORM_QUEUE_H + +#include "system/types.h" + +#include "storm/array/pointer_to_void.h" + +DECLARE_STRUCT(CSBasePriorityQueue); +DECLARE_STRUCT(CSBasePriority); + +struct CSBasePriorityQueue { + TSGrowableArray_pointer_to_void b_base; + uint32_t m_linkOffset; +}; + +struct CSBasePriority { + CSBasePriorityQueue* m_queue; + uint32_t m_index; +}; + +#define STORM_TS_TIMER_PRIORITY(T) \ +typedef struct TSTimerPriority_##T TSTimerPriority_##T; \ +struct TSTimerPriority_##T { \ + CSBasePriority b_base; \ + T m_val; \ +}; + +#define STORM_TS_PRIORITY_QUEUE(T) \ +typedef CSBasePriorityQueue TSPriorityQueue_##T; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/storm/queue/timer_priority_uint32_t.h b/3.3.5a/include/storm/queue/timer_priority_uint32_t.h new file mode 100644 index 0000000..2c160b7 --- /dev/null +++ b/3.3.5a/include/storm/queue/timer_priority_uint32_t.h @@ -0,0 +1,10 @@ +#ifndef STORM_QUEUE_TIMER_PRIORITY_UINT32_T_H +#define STORM_QUEUE_TIMER_PRIORITY_UINT32_T_H + +#include "system/types.h" + +#include "storm/queue.h" + +STORM_TS_TIMER_PRIORITY(uint32_t); + +#endif \ No newline at end of file diff --git a/3.3.5a/include/storm/thread.h b/3.3.5a/include/storm/thread.h new file mode 100644 index 0000000..fe05e3d --- /dev/null +++ b/3.3.5a/include/storm/thread.h @@ -0,0 +1,17 @@ +#ifndef STORM_THREAD_H +#define STORM_THREAD_H + +#include "system/types.h" + +DECLARE_STRUCT(SCritSect); +typedef struct CSRWLock CSRWLock; + +struct SCritSect { + uint8_t m_critsect[24]; +}; + +struct CSRWLock { + uint8_t m_opaqueData[12]; +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/include/system/detect.h b/3.3.5a/include/system/detect.h new file mode 100644 index 0000000..5b11d1d --- /dev/null +++ b/3.3.5a/include/system/detect.h @@ -0,0 +1,23 @@ +#ifndef SYSTEM_DETECT_H +#define SYSTEM_DETECT_H + +#if !defined(IDA) && !defined(GHIDRA) && !defined(BINANA_GENERATOR) + +#error "Preprocessor mode not detected! You must define either IDA or GHIDRA or BINANA_GENERATOR" + +#endif + +#if defined(IDA) + +// why does this work? +#define DECLARE_ENUM(E) typedef enum E##__ E + +#else + +#define DECLARE_ENUM(E) typedef enum E E + +#endif + +#define DECLARE_STRUCT(T) typedef struct T T + +#endif diff --git a/go/profile/include/stdint.h b/3.3.5a/include/system/types.h similarity index 59% rename from go/profile/include/stdint.h rename to 3.3.5a/include/system/types.h index d944acf..1194c07 100644 --- a/go/profile/include/stdint.h +++ b/3.3.5a/include/system/types.h @@ -1,5 +1,8 @@ -#ifndef SYSTEM_STD_INT_H -#define SYSTEM_STD_INT_H +#ifndef SYSTEM_TYPES_H +#define SYSTEM_TYPES_H + +// stdint +#if defined(IDA) || defined(BINANA_GENERATOR) typedef signed char int8_t; typedef short int16_t; @@ -14,4 +17,24 @@ typedef int32_t ptrdiff_t; typedef uint32_t uintptr_t; typedef int32_t intptr_t; +#else + +#include + +#endif + +// stdbool + +#if defined(BINANA_GENERATOR) + +typedef char bool; + +#endif + +#if defined(GHIDRA) + +#include + +#endif + #endif \ No newline at end of file diff --git a/3.3.5a/include/tempest/box.h b/3.3.5a/include/tempest/box.h index 47f8cb0..664b7cd 100644 --- a/3.3.5a/include/tempest/box.h +++ b/3.3.5a/include/tempest/box.h @@ -1,21 +1,21 @@ -#ifndef TEMPEST_BOX_H -#define TEMPEST_BOX_H - -#include "tempest/vector.h" -#include "tempest/range.h" - -typedef struct CAaBox CAaBox; -typedef struct CBoundingBox CBoundingBox; - -struct CAaBox { - C3Vector b; - C3Vector t; -}; - -struct CBoundingBox { - CRange x; - CRange y; - CRange z; -}; - +#ifndef TEMPEST_BOX_H +#define TEMPEST_BOX_H + +#include "tempest/vector.h" +#include "tempest/range.h" + +DECLARE_STRUCT(CAaBox); +DECLARE_STRUCT(CBoundingBox); + +struct CAaBox { + C3Vector b; + C3Vector t; +}; + +struct CBoundingBox { + CRange x; + CRange y; + CRange z; +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/tempest/matrix.h b/3.3.5a/include/tempest/matrix.h index b7163bf..f0a5fcc 100644 --- a/3.3.5a/include/tempest/matrix.h +++ b/3.3.5a/include/tempest/matrix.h @@ -1,55 +1,55 @@ -#ifndef TEMPEST_MATRIX_H -#define TEMPEST_MATRIX_H - -typedef struct C33Matrix C33Matrix; -typedef struct C34Matrix C34Matrix; -typedef struct C44Matrix C44Matrix; - -struct C33Matrix { - float a0; - float a1; - float a2; - float b0; - float b1; - float b2; - float c0; - float c1; - float c2; -}; - -struct C34Matrix { - float a0; - float a1; - float a2; - float b0; - float b1; - float b2; - float c0; - float c1; - float c2; - float d0; - float d1; - float d2; -}; - -struct C44Matrix { - float a0; - float a1; - float a2; - float a3; - float b0; - float b1; - float b2; - float b3; - float c0; - float c1; - float c2; - float c3; - float d0; - float d1; - float d2; - float d3; -}; - - +#ifndef TEMPEST_MATRIX_H +#define TEMPEST_MATRIX_H + +DECLARE_STRUCT(C33Matrix); +DECLARE_STRUCT(C34Matrix); +DECLARE_STRUCT(C44Matrix); + +struct C33Matrix { + float a0; + float a1; + float a2; + float b0; + float b1; + float b2; + float c0; + float c1; + float c2; +}; + +struct C34Matrix { + float a0; + float a1; + float a2; + float b0; + float b1; + float b2; + float c0; + float c1; + float c2; + float d0; + float d1; + float d2; +}; + +struct C44Matrix { + float a0; + float a1; + float a2; + float a3; + float b0; + float b1; + float b2; + float b3; + float c0; + float c1; + float c2; + float c3; + float d0; + float d1; + float d2; + float d3; +}; + + #endif \ No newline at end of file diff --git a/3.3.5a/include/tempest/plane.h b/3.3.5a/include/tempest/plane.h index 1d479c9..faebe16 100644 --- a/3.3.5a/include/tempest/plane.h +++ b/3.3.5a/include/tempest/plane.h @@ -1,13 +1,13 @@ -#ifndef TEMPEST_PLANE_H -#define TEMPEST_PLANE_H - -#include "tempest/vector.h" - -typedef struct C4Plane C4Plane; - -struct C4Plane { - C3Vector n; - float d; -}; - +#ifndef TEMPEST_PLANE_H +#define TEMPEST_PLANE_H + +#include "tempest/vector.h" + +DECLARE_STRUCT(C4Plane); + +struct C4Plane { + C3Vector n; + float d; +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/tempest/quaternion.h b/3.3.5a/include/tempest/quaternion.h index a31e370..47ab7db 100644 --- a/3.3.5a/include/tempest/quaternion.h +++ b/3.3.5a/include/tempest/quaternion.h @@ -1,13 +1,13 @@ -#ifndef TEMPEST_QUATERNION_H -#define TEMPEST_QUATERNION_H - -typedef struct C4Quaternion C4Quaternion; - -struct C4Quaternion { - float x; - float y; - float z; - float w; -}; - +#ifndef TEMPEST_QUATERNION_H +#define TEMPEST_QUATERNION_H + +DECLARE_STRUCT(C4Quaternion); + +struct C4Quaternion { + float x; + float y; + float z; + float w; +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/tempest/range.h b/3.3.5a/include/tempest/range.h index 6ba9c44..fe076e2 100644 --- a/3.3.5a/include/tempest/range.h +++ b/3.3.5a/include/tempest/range.h @@ -1,19 +1,19 @@ -#ifndef TEMPEST_RANGE_H -#define TEMPEST_RANGE_H - -#include - -typedef struct CRange CRange; -typedef struct CiRange CiRange; - -struct CRange { - float l; - float h; -}; - -struct CiRange { - int32_t l; - int32_t h; -}; - +#ifndef TEMPEST_RANGE_H +#define TEMPEST_RANGE_H + +#include "system/types.h" + +DECLARE_STRUCT(CRange); +DECLARE_STRUCT(CiRange); + +struct CRange { + float l; + float h; +}; + +struct CiRange { + int32_t l; + int32_t h; +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/tempest/rect.h b/3.3.5a/include/tempest/rect.h index 869df5a..f88251a 100644 --- a/3.3.5a/include/tempest/rect.h +++ b/3.3.5a/include/tempest/rect.h @@ -1,23 +1,23 @@ -#ifndef TEMPEST_RECT_H -#define TEMPEST_RECT_H - -#include - -typedef struct CRect CRect; -typedef struct CiRect CiRect; - -struct CRect { - float minY; // t - float minX; // l - float maxY; // b - float maxX; // r -}; - -struct CiRect { - int32_t minY; - int32_t minX; - int32_t maxY; - int32_t maxX; -}; - +#ifndef TEMPEST_RECT_H +#define TEMPEST_RECT_H + +#include "system/types.h" + +DECLARE_STRUCT(CRect); +DECLARE_STRUCT(CiRect); + +struct CRect { + float minY; // t + float minX; // l + float maxY; // b + float maxX; // r +}; + +struct CiRect { + int32_t minY; + int32_t minX; + int32_t maxY; + int32_t maxX; +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/tempest/sphere.h b/3.3.5a/include/tempest/sphere.h index 24f7983..e7b152f 100644 --- a/3.3.5a/include/tempest/sphere.h +++ b/3.3.5a/include/tempest/sphere.h @@ -1,13 +1,13 @@ -#ifndef TEMPEST_SPHERE_H -#define TEMPEST_SPHERE_H - -#include "tempest/vector.h" - -typedef struct CAaSphere CAaSphere; - -struct CAaSphere { - C3Vector n; - float d; -}; - +#ifndef TEMPEST_SPHERE_H +#define TEMPEST_SPHERE_H + +#include "tempest/vector.h" + +DECLARE_STRUCT(CAaSphere); + +struct CAaSphere { + C3Vector n; + float d; +}; + #endif \ No newline at end of file diff --git a/3.3.5a/include/tempest/vector.h b/3.3.5a/include/tempest/vector.h index 86e87f1..233d790 100644 --- a/3.3.5a/include/tempest/vector.h +++ b/3.3.5a/include/tempest/vector.h @@ -1,43 +1,43 @@ -#ifndef TEMPEST_VECTOR_H -#define TEMPEST_VECTOR_H - -#include - -typedef struct C2Vector C2Vector; -typedef struct C2iVector C2iVector; -typedef struct C3Vector C3Vector; -typedef struct C4Vector C4Vector; -typedef struct CImVector CImVector; - -struct C2Vector { - float x; - float y; -}; - -struct C2iVector { - int32_t x; - int32_t y; -}; - -struct C3Vector { - float x; - float y; - float z; -}; - -struct C4Vector { - float x; - float y; - float z; - float w; -}; - -struct CImVector { - uint8_t b; - uint8_t g; - uint8_t r; - uint8_t a; -}; - - +#ifndef TEMPEST_VECTOR_H +#define TEMPEST_VECTOR_H + +#include "system/types.h" + +DECLARE_STRUCT(C2Vector); +DECLARE_STRUCT(C2iVector); +DECLARE_STRUCT(C3Vector); +DECLARE_STRUCT(C4Vector); +DECLARE_STRUCT(CImVector); + +struct C2Vector { + float x; + float y; +}; + +struct C2iVector { + int32_t x; + int32_t y; +}; + +struct C3Vector { + float x; + float y; + float z; +}; + +struct C4Vector { + float x; + float y; + float z; + float w; +}; + +struct CImVector { + uint8_t b; + uint8_t g; + uint8_t r; + uint8_t a; +}; + + #endif \ No newline at end of file diff --git a/3.3.5a/include/ui/simpleframe.h b/3.3.5a/include/ui/simpleframe.h new file mode 100644 index 0000000..1f0357e --- /dev/null +++ b/3.3.5a/include/ui/simpleframe.h @@ -0,0 +1,9 @@ +#ifndef UI_SIMPLE_FRAME_H +#define UI_SIMPLE_FRAME_H + +DECLARE_STRUCT(CSimpleFrame); + +struct CSimpleFrame { +}; + +#endif \ No newline at end of file diff --git a/3.3.5a/symbol/console/label.sym b/3.3.5a/symbol/console/label.sym index 82474a9..a921a59 100644 --- a/3.3.5a/symbol/console/label.sym +++ b/3.3.5a/symbol/console/label.sym @@ -1,35 +1,35 @@ -g_commandHistory 00ca3a28 l ; char[10394] -g_commandHistoryIndex 00caba28 l ; uint32 -g_consoleCommandHash 00caba30 l ; TSHashTable -g_defaultCommand 00caba2c l ; command function pointer -s_active 007649af l ; int32 as boolean -s_baseTextFlags 00adbae4 l ; uint32 -s_batch 00ca1874 l ; CGxStringBatch* -s_caret 00ca1694 l ; int32 -s_caretpixwidth 00ca1718 l -s_caretpixheight 00ca1690 l -s_charSpacing 00ca19a8 l ; float -s_completedCmd 00ca1984 l ; int32 -s_completionMode 00ca1980 l -s_consoleAccessEnabled 00cabcc4 l ; int32 as boolean -s_consoleHeight 00ca19b0 l ; float -s_consoleHotKey 00adbac4 l ; KEY -s_consoleResizeState 00ca1990 l ; CONSOLERESIZESTATE -s_currlineptr 00ca1720 l ; CONSOLELINE* -s_fontHeight 00adbacc l ; float -s_fontName 00ca1768 l ; char[260] -s_highlightState 00ca1994 l ; HIGHLIGHTSTATE -s_highlightLeftCharIndex 00ca19a0 l ; uint32 -s_highlightRightCharIndex 00ca19a4 l ; uint32 -s_historyIndex 00adbac8 l ; int32 -s_hRect 00adbad4 l ; RECTF -s_inputString 00ca171c l ; CGxString* -s_layerBackground 00ca1724 l ; HLAYER -s_layerText 00ca1870 l ; HLAYER -s_partial 00ca1878 l ; char[100] -s_rect 00adbab4 l ; RECTF -s_repeatCount 00ca186c l ; uint32 -s_repeatBuffer 00ca1728 l ; char[64] -carettime 00ca19f0 l ; float -s_NumLines 00ca197c l ; int32 +g_commandHistory 00ca3a28 l ; char[10394] +g_commandHistoryIndex 00caba28 l ; uint32 +g_consoleCommandHash 00caba30 l ; TSHashTable +g_defaultCommand 00caba2c l ; command function pointer +s_active 007649af l ; int32 as boolean +s_baseTextFlags 00adbae4 l ; uint32 +s_batch 00ca1874 l ; CGxStringBatch* +s_caret 00ca1694 l ; int32 +s_caretpixwidth 00ca1718 l +s_caretpixheight 00ca1690 l +s_charSpacing 00ca19a8 l ; float +s_completedCmd 00ca1984 l ; int32 +s_completionMode 00ca1980 l +s_consoleAccessEnabled 00cabcc4 l ; int32 as boolean +s_consoleHeight 00ca19b0 l ; float +s_consoleHotKey 00adbac4 l ; KEY +s_consoleResizeState 00ca1990 l ; CONSOLERESIZESTATE +s_currlineptr 00ca1720 l ; CONSOLELINE* +s_fontHeight 00adbacc l ; float +s_fontName 00ca1768 l ; char[260] +s_highlightState 00ca1994 l ; HIGHLIGHTSTATE +s_highlightLeftCharIndex 00ca19a0 l ; uint32 +s_highlightRightCharIndex 00ca19a4 l ; uint32 +s_historyIndex 00adbac8 l ; int32 +s_hRect 00adbad4 l ; RECTF +s_inputString 00ca171c l ; CGxString* +s_layerBackground 00ca1724 l ; HLAYER +s_layerText 00ca1870 l ; HLAYER +s_partial 00ca1878 l ; char[100] +s_rect 00adbab4 l ; RECTF +s_repeatCount 00ca186c l ; uint32 +s_repeatBuffer 00ca1728 l ; char[64] +carettime 00ca19f0 l ; float +s_NumLines 00ca197c l ; int32 s_textFont 00ca198c l ; HTEXTFONT \ No newline at end of file diff --git a/3.3.5a/symbol/event/func.sym b/3.3.5a/symbol/event/func.sym index 3c4f813..44c3942 100644 --- a/3.3.5a/symbol/event/func.sym +++ b/3.3.5a/symbol/event/func.sym @@ -26,9 +26,9 @@ IEvtQueueCheckSyncMouseState 004804C0 f end=004804E6 IEvtQueueDestroy 004804B0 f end=004804BA IEvtQueueDispatch 00480AD0 f end=00480BCB IEvtQueueDispatchAll 00480BD0 f end=00480D28 -IEvtQueueRegister 004804F0 f end=004805F4 +IEvtQueueRegister 004804F0 f end=004805F4 type="void __cdecl func(EvtContext* context, EVENTID id, void* handler, void* param, float priority)" IEvtQueueUnregister 00480D30 f end=00480DD1 -IEvtQueuePost 004806A0 f end=0048071F +IEvtQueuePost 004806A0 f end=0048071F type="int32_t __cdecl func(EvtContext* context, EVENTID id, void *data, size_t bytes)" IEvtSchedulerCreateContext 0047F5C0 f end=0047F6B9 IEvtSchedulerInitialize 0047F2F0 f end=0047F5BA IEvtSchedulerDestroy 0047DEA0 f end=0047E117 @@ -46,4 +46,5 @@ PropGet 0047CC20 f end=0047CC41 InitializeSchedulerThread 0047E910 f end=0047EA69 SynthesizeIdle 0047DBC0 f end=0047DC14 SynthesizePaint 0047DC50 f end=0047DC8D -SynthesizePoll 0047DC20 f end=0047DC50 \ No newline at end of file +SynthesizePoll 0047DC20 f end=0047DC50 +AttachContextToThread 0047EC10 f \ No newline at end of file diff --git a/3.3.5a/symbol/event/label.sym b/3.3.5a/symbol/event/label.sym index 78d39e5..2b63664 100644 --- a/3.3.5a/symbol/event/label.sym +++ b/3.3.5a/symbol/event/label.sym @@ -1 +1,3 @@ -s_mainThread 00b417c8 l +s_mainThread 00b417c8 l type="uint32_t" +s_messageRecycler 00B41850 l type="CDataRecycler" +s_interactiveCount 00B417D0 l type="int32_t" \ No newline at end of file diff --git a/3.3.5a/symbol/framescript/func.sym b/3.3.5a/symbol/framescript/func.sym new file mode 100644 index 0000000..9158062 --- /dev/null +++ b/3.3.5a/symbol/framescript/func.sym @@ -0,0 +1 @@ +FrameScript_Execute 00819EA0 f end=0081A2B5 type="void __stdcall func(int32_t function, FrameScript_Object* object, int32_t args, char* args_fmt, FrameScript_EventObject* eventObject)" \ No newline at end of file diff --git a/3.3.5a/symbol/lua/func.sym b/3.3.5a/symbol/lua/func.sym new file mode 100644 index 0000000..90e98e0 --- /dev/null +++ b/3.3.5a/symbol/lua/func.sym @@ -0,0 +1,22 @@ +_lua_gettop 0084DBD0 f +_lua_settop 0084DBF0 f +_lua_insert 0084DCC0 f +_lua_type 0084DEB0 f +_lua_isnumber 0084DF20 f +_lua_isstring 0084DF60 f +_lua_tonumber 0084E030 f +_lua_tolstring 0084E0E0 f +_lua_touserdata 0084E1C0 f +_lua_pushnil 0084E280 f +_lua_pushnumber 0084E2A0 f +_lua_pushstring 0084E350 f +_lua_rawget 0084E600 f +_lua_rawgeti 0084E670 f +_lua_rawset 0084E970 f +_luaL_error 0084F280 f +_luaL_unref 0084F7A0 f +_luaG_runerror 00850920 f +_luaD_throw 008562E0 f +_luaD_precall 00856370 f +luaD_call 00856760 f +_luaV_execute 00857CA0 f \ No newline at end of file diff --git a/3.3.5a/symbol/main.sym b/3.3.5a/symbol/main.sym index 3f24899..524496a 100644 --- a/3.3.5a/symbol/main.sym +++ b/3.3.5a/symbol/main.sym @@ -87,6 +87,7 @@ SynthesizePaint 0047DC50 f end=0047DC8D EventForceIdleProcessing 0047DCA0 f end=0047DE09 IEvtSchedulerDestroy 0047DEA0 f end=0047E117 InitializeSchedulerThread 0047E910 f end=0047EA69 +AttachContextToThread 0047EC10 f SchedulerThreadProcProcess 0047EFF0 f end=0047F225 SchedulerThreadProc 0047F230 f end=0047F2C1 ; IEvtSchedulerProcess as an independent function appears to be optimized out EventDoMessageLoop 0047F2D0 f end=0047F2EC @@ -101,8 +102,8 @@ IEvtInputGetMousePosition 004800A0 f end=004800EF IEvtInputProcess 00480410 f end=004804A8 IEvtQueueDestroy 004804B0 f end=004804BA IEvtQueueCheckSyncMouseState 004804C0 f end=004804E6 -IEvtQueueRegister 004804F0 f end=004805F4 -IEvtQueuePost 004806A0 f end=0048071F +IEvtQueueRegister 004804F0 f end=004805F4 type="void __cdecl func(EvtContext* context, EVENTID id, void* handler, void* param, float priority)" +IEvtQueuePost 004806A0 f end=0048071F type="int32_t __cdecl func(EvtContext* context, EVENTID id, void *data, size_t bytes)" IEvtQueueCheckSyncKeyState 00480A50 f end=00480AC2 IEvtQueueDispatch 00480AD0 f end=00480BCB IEvtQueueDispatchAll 00480BD0 f end=00480D28 @@ -2266,15 +2267,16 @@ ConsoleCommandRegister 00769100 f end=007691B3 ConsoleAccessGetEnabled 00769230 f end=00769236 ConsoleDeviceInitialize 0076AB80 f end=0076B287 SMemSetDebugFlags 0076E4A0 f end=0076E4D2 -SMemAlloc 0076E540 f end=0076E59A -SMemFree 0076E5A0 f end=0076E5C4 +SMemAlloc 0076E540 f end=0076E59A type="void* __stdcall func(uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)" +SMemFree 0076E5A0 f end=0076E5C4 type="int32_t __stdcall func(void* ptr, char* filename, int32_t linenumber, uint32_t flags)" +SMemReAlloc 0076E5E0 f end=0076E6D6 type="void* __stdcall func(void* ptr, uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)" SStrChr 0076E6E0 f end=0076E712 SStrCmp 0076E760 f end=0076E77B SStrCmpI 0076E780 f end=0076E79B SStrCopy 0076ED20 f end=0076ED98 SStrLen 0076EE30 f end=0076EE5E SStrPack 0076EF70 f end=0076F001 -SStrPrintf 0076F070 f end=0076F09E +SStrPrintf 0076F070 f end=0076F09E type="int32_t __stdcall func(char* dest, size_t maxchars, char* format, ...)" SStrVPrintf 0076F0A0 f end=0076F0CE SStrTokenize 0076F1E0 f end=0076F331 SStrHashHT 0076F640 f end=0076F6B9 @@ -2289,10 +2291,10 @@ SCmdProcess 00773890 f end=00773986 SCmdProcessCommandLine 00773990 f end=007739AD StormInitialize 007739E0 f end=007739F4 StormSetOption 00773A80 f end=00773C81 -SCritSect__SCritSect 00774620 f end=0077462E -SCritSect__destructor 00774630 f end=00774638 -SCritSect__Enter 00774640 f end=00774648 -SCritSect__Leave 00774650 f end=00774658 +SCritSect__SCritSect 00774620 f end=0077462E type="SCritSect* __thiscall func(SCritSect* this)" +SCritSect__destructor 00774630 f end=00774638 type="void __thiscall func(SCritSect *this)" +SCritSect__Enter 00774640 f end=00774648 type="void __thiscall func(SCritSect *this)" +SCritSect__Leave 00774650 f end=00774658 type="void __thiscall func(SCritSect *this)" CSRWLock__Leave 00774660 f end=00774675 SSyncObject__Wait 00774690 f end=007746A4 SEvent__Set 00774720 f end=0077472A @@ -2325,6 +2327,7 @@ Script_CancelUnitBuff 00804220 f end=00804420 Script_SpellStopTargeting 00809E30 f end=00809E96 Script_SpellStopCasting 00809EA0 f end=00809F7E Script_SpellTargetUnit 0080DC00 f end=0080DCE3 +FrameScript_Execute 00819EA0 f end=0081A2B5 type="void __stdcall func(int32_t function, FrameScript_Object* object, int32_t args, char* args_fmt, FrameScript_EventObject* eventObject)" Script_GetText 0081B720 f end=0081B7AF Script_CreateFont 0081B7B0 f end=0081B81E Script_GetCurrentKeyBoardFocus 0081B820 f end=0081B86C @@ -2332,6 +2335,28 @@ Script_EnumerateFrames 0081B9C0 f end=0081BAAA Script_GetNumFrames 0081BAB0 f end=0081BB15 Script_CreateFrame 0081BB20 f end=0081BE68 Script_GetFramesRegisteredForEvent 0081BE70 f end=0081BF4D +_lua_gettop 0084DBD0 f +_lua_settop 0084DBF0 f +_lua_insert 0084DCC0 f +_lua_type 0084DEB0 f +_lua_isnumber 0084DF20 f +_lua_isstring 0084DF60 f +_lua_tonumber 0084E030 f +_lua_tolstring 0084E0E0 f +_lua_touserdata 0084E1C0 f +_lua_pushnil 0084E280 f +_lua_pushnumber 0084E2A0 f +_lua_pushstring 0084E350 f +_lua_rawget 0084E600 f +_lua_rawgeti 0084E670 f +_lua_rawset 0084E970 f +_luaL_error 0084F280 f +_luaL_unref 0084F7A0 f +_luaG_runerror 00850920 f +_luaD_throw 008562E0 f +_luaD_precall 00856370 f +luaD_call 00856760 f +_luaV_execute 00857CA0 f RestoreMouse 008695B0 f end=008695FB OsInputInitialize 00869720 f end=00869757 ; actually called by IEvtInputInitialize, but this is optimized out OsInputDestroy 00869760 f end=008697D3 @@ -2532,6 +2557,8 @@ nullsub_149 009DE1C0 f nullsub_150 009DE1D0 f CGxDevice__vtable 00A2DDC0 l CGxDeviceOpenGl__vtable 00A2E198 l +s_interactiveCount 00B417D0 l type="int32_t" +s_messageRecycler 00B41850 l type="CDataRecycler" s_cursorImages 00C26DF0 l type="CImVector[54][1024]" g_theGxDevicePtr 00C5DF88 l CGxDevice__s_uiVertexShader 00C5DFDC l @@ -2545,7 +2572,7 @@ s_historyIndex 00adbac8 l ; int32 s_fontHeight 00adbacc l ; float s_hRect 00adbad4 l ; RECTF s_baseTextFlags 00adbae4 l ; uint32 -s_mainThread 00b417c8 l +s_mainThread 00b417c8 l type="uint32_t" s_caretpixheight 00ca1690 l s_caret 00ca1694 l ; int32 s_caretpixwidth 00ca1718 l diff --git a/3.3.5a/symbol/storm/func.sym b/3.3.5a/symbol/storm/func.sym index dfdac45..25b7029 100644 --- a/3.3.5a/symbol/storm/func.sym +++ b/3.3.5a/symbol/storm/func.sym @@ -5,8 +5,9 @@ SErrSetLogTitleString 00771890 f end=007718F2 SErrSetLogTitleCallback 00771900 f end=00771957 SErrRegisterHandler 00771B80 f end=00771C15 SErrCatchUnhandledExceptions 00772B20 f end=00772B2C -SMemAlloc 0076E540 f end=0076E59A -SMemFree 0076E5A0 f end=0076E5C4 +SMemAlloc 0076E540 f end=0076E59A type="void* __stdcall func(uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)" +SMemFree 0076E5A0 f end=0076E5C4 type="int32_t __stdcall func(void* ptr, char* filename, int32_t linenumber, uint32_t flags)" +SMemReAlloc 0076E5E0 f end=0076E6D6 type="void* __stdcall func(void* ptr, uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)" SMemSetDebugFlags 0076E4A0 f end=0076E4D2 SRegLoadValue 00770840 f end=007708E9 SRegSaveValue 007709A0 f end=007709E8 @@ -16,7 +17,7 @@ SStrCmpI 0076E780 f end=0076E79B SStrCopy 0076ED20 f end=0076ED98 SStrLen 0076EE30 f end=0076EE5E SStrPack 0076EF70 f end=0076F001 -SStrPrintf 0076F070 f end=0076F09E +SStrPrintf 0076F070 f end=0076F09E type="int32_t __stdcall func(char* dest, size_t maxchars, char* format, ...)" SStrVPrintf 0076F0A0 f end=0076F0CE SStrTokenize 0076F1E0 f end=0076F331 SStrHashHT 0076F640 f end=0076F6B9 @@ -26,9 +27,9 @@ SSyncObject__Wait 00774690 f end=007746A4 StormInitialize 007739E0 f end=007739F4 StormSetOption 00773A80 f end=00773C81 TSList__LinkNode 004F71A0 f end=004F724D -SCritSect__SCritSect 00774620 f end=0077462E -SCritSect__Enter 00774640 f end=00774648 -SCritSect__Leave 00774650 f end=00774658 -SCritSect__destructor 00774630 f end=00774638 +SCritSect__SCritSect 00774620 f end=0077462E type="SCritSect* __thiscall func(SCritSect* this)" +SCritSect__Enter 00774640 f end=00774648 type="void __thiscall func(SCritSect *this)" +SCritSect__Leave 00774650 f end=00774658 type="void __thiscall func(SCritSect *this)" +SCritSect__destructor 00774630 f end=00774638 type="void __thiscall func(SCritSect *this)" SRgnCreate 00777980 f end=00777A78 SRgnDelete 00777940 f end=00777971 \ No newline at end of file diff --git a/3.3.5a/x32dbg/game.dd32 b/3.3.5a/x32dbg/game.dd32 index 5aa315f..b520200 100644 --- a/3.3.5a/x32dbg/game.dd32 +++ b/3.3.5a/x32dbg/game.dd32 @@ -712,6 +712,14 @@ "icount": "0x0", "parent": "0x7e910" }, + { + "manual": true, + "start": "0x7ec10", + "end": "0x7ec10", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x7ec10" + }, { "manual": true, "start": "0x7eff0", @@ -18152,6 +18160,14 @@ "icount": "0x0", "parent": "0x36e5a0" }, + { + "manual": true, + "start": "0x36e5e0", + "end": "0x36e6d5", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x36e5e0" + }, { "manual": true, "start": "0x36e6e0", @@ -18608,6 +18624,14 @@ "icount": "0x0", "parent": "0x40dc00" }, + { + "manual": true, + "start": "0x419ea0", + "end": "0x41a2b4", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x419ea0" + }, { "manual": true, "start": "0x41b720", @@ -18664,6 +18688,182 @@ "icount": "0x0", "parent": "0x41be70" }, + { + "manual": true, + "start": "0x44dbd0", + "end": "0x44dbd0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44dbd0" + }, + { + "manual": true, + "start": "0x44dbf0", + "end": "0x44dbf0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44dbf0" + }, + { + "manual": true, + "start": "0x44dcc0", + "end": "0x44dcc0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44dcc0" + }, + { + "manual": true, + "start": "0x44deb0", + "end": "0x44deb0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44deb0" + }, + { + "manual": true, + "start": "0x44df20", + "end": "0x44df20", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44df20" + }, + { + "manual": true, + "start": "0x44df60", + "end": "0x44df60", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44df60" + }, + { + "manual": true, + "start": "0x44e030", + "end": "0x44e030", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44e030" + }, + { + "manual": true, + "start": "0x44e0e0", + "end": "0x44e0e0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44e0e0" + }, + { + "manual": true, + "start": "0x44e1c0", + "end": "0x44e1c0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44e1c0" + }, + { + "manual": true, + "start": "0x44e280", + "end": "0x44e280", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44e280" + }, + { + "manual": true, + "start": "0x44e2a0", + "end": "0x44e2a0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44e2a0" + }, + { + "manual": true, + "start": "0x44e350", + "end": "0x44e350", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44e350" + }, + { + "manual": true, + "start": "0x44e600", + "end": "0x44e600", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44e600" + }, + { + "manual": true, + "start": "0x44e670", + "end": "0x44e670", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44e670" + }, + { + "manual": true, + "start": "0x44e970", + "end": "0x44e970", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44e970" + }, + { + "manual": true, + "start": "0x44f280", + "end": "0x44f280", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44f280" + }, + { + "manual": true, + "start": "0x44f7a0", + "end": "0x44f7a0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x44f7a0" + }, + { + "manual": true, + "start": "0x450920", + "end": "0x450920", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x450920" + }, + { + "manual": true, + "start": "0x4562e0", + "end": "0x4562e0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x4562e0" + }, + { + "manual": true, + "start": "0x456370", + "end": "0x456370", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x456370" + }, + { + "manual": true, + "start": "0x456760", + "end": "0x456760", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x456760" + }, + { + "manual": true, + "start": "0x457ca0", + "end": "0x457ca0", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x457ca0" + }, { "manual": true, "start": "0x4695b0", @@ -20784,6 +20984,12 @@ "text": "InitializeSchedulerThread", "address": "0x7e910" }, + { + "manual": true, + "module": "wow.exe", + "text": "AttachContextToThread", + "address": "0x7ec10" + }, { "manual": true, "module": "wow.exe", @@ -33870,6 +34076,12 @@ "text": "SMemFree", "address": "0x36e5a0" }, + { + "manual": true, + "module": "wow.exe", + "text": "SMemReAlloc", + "address": "0x36e5e0" + }, { "manual": true, "module": "wow.exe", @@ -34212,6 +34424,12 @@ "text": "Script_SpellTargetUnit", "address": "0x40dc00" }, + { + "manual": true, + "module": "wow.exe", + "text": "FrameScript_Execute", + "address": "0x419ea0" + }, { "manual": true, "module": "wow.exe", @@ -34254,6 +34472,138 @@ "text": "Script_GetFramesRegisteredForEvent", "address": "0x41be70" }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_gettop", + "address": "0x44dbd0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_settop", + "address": "0x44dbf0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_insert", + "address": "0x44dcc0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_type", + "address": "0x44deb0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_isnumber", + "address": "0x44df20" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_isstring", + "address": "0x44df60" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_tonumber", + "address": "0x44e030" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_tolstring", + "address": "0x44e0e0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_touserdata", + "address": "0x44e1c0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_pushnil", + "address": "0x44e280" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_pushnumber", + "address": "0x44e2a0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_pushstring", + "address": "0x44e350" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_rawget", + "address": "0x44e600" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_rawgeti", + "address": "0x44e670" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_lua_rawset", + "address": "0x44e970" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_luaL_error", + "address": "0x44f280" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_luaL_unref", + "address": "0x44f7a0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_luaG_runerror", + "address": "0x450920" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_luaD_throw", + "address": "0x4562e0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_luaD_precall", + "address": "0x456370" + }, + { + "manual": true, + "module": "wow.exe", + "text": "luaD_call", + "address": "0x456760" + }, + { + "manual": true, + "module": "wow.exe", + "text": "_luaV_execute", + "address": "0x457ca0" + }, { "manual": true, "module": "wow.exe", @@ -35508,6 +35858,18 @@ "text": "s_mainThread", "address": "0x7417c8" }, + { + "manual": true, + "module": "wow.exe", + "text": "s_interactiveCount", + "address": "0x7417d0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "s_messageRecycler", + "address": "0x741850" + }, { "manual": true, "module": "wow.exe", diff --git a/3.3.5a/x32dbg/types.json b/3.3.5a/x32dbg/types.json index c84c2a8..4e13406 100644 --- a/3.3.5a/x32dbg/types.json +++ b/3.3.5a/x32dbg/types.json @@ -128,10 +128,50 @@ "type": "int", "name": "EGxuDrawListCategory" }, + { + "type": "void**", + "name": "EVENTHANDLERFUNC" + }, + { + "type": "int", + "name": "EVENTID" + }, + { + "type": "void*", + "name": "HEVENTCONTEXT" + }, + { + "type": "HPROPCONTEXT__*", + "name": "HPROPCONTEXT" + }, + { + "type": "long long", + "name": "KEY" + }, + { + "type": "long long", + "name": "MOUSEBUTTON" + }, + { + "type": "int", + "name": "MOUSEMODE" + }, + { + "type": "int", + "name": "OSINPUT" + }, + { + "type": "int", + "name": "OS_MOUSE_MODE" + }, { "type": "int", "name": "PIXEL_FORMAT" }, + { + "type": "long long", + "name": "SCHEDSTATE" + }, { "type": "int32_t", "name": "intptr_t" @@ -143,6 +183,50 @@ { "type": "uint32_t", "name": "uintptr_t" + }, + { + "type": "CSBasePriorityQueue", + "name": "TSPriorityQueue_EvtTimer" + }, + { + "type": "TSList_EvtMessage", + "name": "TSExplicitList_EvtMessage" + }, + { + "type": "TSList_EvtHandler", + "name": "TSExplicitList_EvtHandler" + }, + { + "type": "TSList_EvtKeyDown", + "name": "TSExplicitList_EvtKeyDown" + }, + { + "type": "TSList_EvtContext", + "name": "TSExplicitList_EvtContext" + }, + { + "type": "TSList_SIMPLEFRAMENODE", + "name": "TSExplicitList_SIMPLEFRAMENODE" + }, + { + "type": "TSList_EVENTLISTENERNODE", + "name": "TSExplicitList_EVENTLISTENERNODE" + }, + { + "type": "TSList_FrameScript_EventObject", + "name": "TSExplicitList_FrameScript_EventObject" + }, + { + "type": "TSList_CGxBuf", + "name": "TSExplicitList_CGxBuf" + }, + { + "type": "TSList_CGxPool", + "name": "TSExplicitList_CGxPool" + }, + { + "type": "TSList_CGxShader", + "name": "TSExplicitList_CGxShader" } ], "structs": [ @@ -480,6 +564,94 @@ } ] }, + { + "name": "CDataRecycler", + "size": 24, + "members": [ + { + "type": "CDataRecycler__vtable*", + "name": "v_vtable", + "offset": 0 + }, + { + "type": "int32_t", + "name": "m_nodesRecyclable", + "offset": 4 + }, + { + "type": "uint32_t", + "name": "m_nodesPerBlock", + "offset": 8 + }, + { + "type": "CDataRecycler__NodeBlock*", + "name": "m_nodeBlockList", + "offset": 12 + }, + { + "type": "CDataRecycler__Node*", + "name": "m_nodeFullList", + "offset": 16 + }, + { + "type": "CDataRecycler__Node*", + "name": "m_nodeEmptyList", + "offset": 20 + } + ] + }, + { + "name": "CDataRecycler__Node", + "size": 12, + "members": [ + { + "type": "CDataRecycler__Node*", + "name": "m_next", + "offset": 0 + }, + { + "type": "void*", + "name": "m_data", + "offset": 4 + }, + { + "type": "uint32_t", + "name": "m_bytes", + "offset": 8 + } + ] + }, + { + "name": "CDataRecycler__vtable", + "size": 20, + "members": [ + { + "type": "void*", + "name": "v_fn_00", + "offset": 0 + }, + { + "type": "void*", + "name": "v_fn_01", + "offset": 4 + }, + { + "type": "void*", + "name": "v_fn_02", + "offset": 8 + }, + { + "type": "void*", + "name": "v_fn_03", + "offset": 12 + }, + { + "type": "void*", + "name": "v_fn_04", + "offset": 16 + } + ] + }, { "name": "CGxDevice__vtable", "size": 336, @@ -1009,6 +1181,38 @@ } ] }, + { + "name": "CSBasePriority", + "size": 8, + "members": [ + { + "type": "CSBasePriorityQueue*", + "name": "m_queue", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "m_index", + "offset": 4 + } + ] + }, + { + "name": "CSRWLock", + "size": 12, + "members": [ + { + "type": "uint8_t", + "name": "m_opaqueData", + "arrsize": 12, + "offset": 0 + } + ] + }, + { + "name": "CSimpleFrame", + "size": 0 + }, { "name": "CiRange", "size": 8, @@ -1124,9 +1328,106 @@ } ] }, + { + "name": "EVENT_DATA_CHAR", + "size": 12, + "members": [ + { + "type": "int32_t", + "name": "ch", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "metaKeyState", + "offset": 4 + }, + { + "type": "uint32_t", + "name": "repeat", + "offset": 8 + } + ] + }, + { + "name": "EVENT_DATA_FOCUS", + "size": 4, + "members": [ + { + "type": "int32_t", + "name": "focus", + "offset": 0 + } + ] + }, + { + "name": "EVENT_DATA_IDLE", + "size": 8, + "members": [ + { + "type": "float", + "name": "elapsedSec", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "time", + "offset": 4 + } + ] + }, + { + "name": "EVENT_DATA_SIZE", + "size": 8, + "members": [ + { + "type": "int32_t", + "name": "w", + "offset": 0 + }, + { + "type": "int32_t", + "name": "h", + "offset": 4 + } + ] + }, + { + "name": "FrameScript_Object", + "size": 16, + "members": [ + { + "type": "void**", + "name": "v_vtable", + "offset": 0 + }, + { + "type": "int32_t", + "name": "lua_registered", + "offset": 4 + }, + { + "type": "int32_t", + "name": "lua_objectRef", + "offset": 8 + }, + { + "type": "int32_t", + "name": "m_onEvent", + "offset": 12 + } + ] + }, { "name": "HASHKEY_NONE", - "size": 0 + "size": 4, + "members": [ + { + "type": "int32_t", + "name": "m_unused", + "offset": 0 + } + ] }, { "name": "HASHKEY_PTR", @@ -1161,6 +1462,17 @@ } ] }, + { + "name": "HPROPCONTEXT__", + "size": 4, + "members": [ + { + "type": "int32_t", + "name": "unused", + "offset": 0 + } + ] + }, { "name": "IDirect3D9", "size": 4, @@ -1250,6 +1562,29 @@ } ] }, + { + "name": "SCritSect", + "size": 24, + "members": [ + { + "type": "uint8_t", + "name": "m_critsect", + "arrsize": 24, + "offset": 0 + } + ] + }, + { + "name": "TExtraInstanceRecyclable", + "size": 4, + "members": [ + { + "type": "uint32_t", + "name": "m_recycleBytes", + "offset": 0 + } + ] + }, { "name": "TSFixedArray_CGxAppRenderState", "size": 12, @@ -1370,6 +1705,84 @@ } ] }, + { + "name": "TSGrowableArray_TSList_FrameScript_EventObject", + "size": 16, + "members": [ + { + "type": "uint32_t", + "name": "m_alloc", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "m_count", + "offset": 4 + }, + { + "type": "TSList_FrameScript_EventObject*", + "name": "m_data", + "offset": 8 + }, + { + "type": "uint32_t", + "name": "m_chunk", + "offset": 12 + } + ] + }, + { + "name": "TSGrowableArray_pointer_to_EvtTimer", + "size": 16, + "members": [ + { + "type": "uint32_t", + "name": "m_alloc", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "m_count", + "offset": 4 + }, + { + "type": "EvtTimer**", + "name": "m_data", + "offset": 8 + }, + { + "type": "uint32_t", + "name": "m_chunk", + "offset": 12 + } + ] + }, + { + "name": "TSGrowableArray_pointer_to_void", + "size": 16, + "members": [ + { + "type": "uint32_t", + "name": "m_alloc", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "m_count", + "offset": 4 + }, + { + "type": "void**", + "name": "m_data", + "offset": 8 + }, + { + "type": "uint32_t", + "name": "m_chunk", + "offset": 12 + } + ] + }, { "name": "TSGrowableArray_uint32_t", "size": 16, @@ -1470,6 +1883,118 @@ } ] }, + { + "name": "TSLink_EVENTLISTENERNODE", + "size": 8, + "members": [ + { + "type": "TSLink_EVENTLISTENERNODE*", + "name": "m_prevlink", + "offset": 0 + }, + { + "type": "EVENTLISTENERNODE*", + "name": "m_next", + "offset": 4 + } + ] + }, + { + "name": "TSLink_EvtContext", + "size": 8, + "members": [ + { + "type": "TSLink_EvtContext*", + "name": "m_prevlink", + "offset": 0 + }, + { + "type": "EvtContext*", + "name": "m_next", + "offset": 4 + } + ] + }, + { + "name": "TSLink_EvtHandler", + "size": 8, + "members": [ + { + "type": "TSLink_EvtHandler*", + "name": "m_prevlink", + "offset": 0 + }, + { + "type": "EvtHandler*", + "name": "m_next", + "offset": 4 + } + ] + }, + { + "name": "TSLink_EvtKeyDown", + "size": 8, + "members": [ + { + "type": "TSLink_EvtKeyDown*", + "name": "m_prevlink", + "offset": 0 + }, + { + "type": "EvtKeyDown*", + "name": "m_next", + "offset": 4 + } + ] + }, + { + "name": "TSLink_EvtMessage", + "size": 8, + "members": [ + { + "type": "TSLink_EvtMessage*", + "name": "m_prevlink", + "offset": 0 + }, + { + "type": "EvtMessage*", + "name": "m_next", + "offset": 4 + } + ] + }, + { + "name": "TSLink_FrameScript_EventObject", + "size": 8, + "members": [ + { + "type": "TSLink_FrameScript_EventObject*", + "name": "m_prevlink", + "offset": 0 + }, + { + "type": "FrameScript_EventObject*", + "name": "m_next", + "offset": 4 + } + ] + }, + { + "name": "TSLink_SIMPLEFRAMENODE", + "size": 8, + "members": [ + { + "type": "TSLink_SIMPLEFRAMENODE*", + "name": "m_prevlink", + "offset": 0 + }, + { + "type": "SIMPLEFRAMENODE*", + "name": "m_next", + "offset": 4 + } + ] + }, { "name": "CAaBox", "size": 24, @@ -1568,6 +2093,23 @@ } ] }, + { + "name": "CDataRecycler__NodeBlock", + "size": 16, + "members": [ + { + "type": "CDataRecycler__NodeBlock*", + "name": "m_next", + "offset": 0 + }, + { + "type": "CDataRecycler__Node", + "name": "m_nodes", + "arrsize": 1, + "offset": 4 + } + ] + }, { "name": "CGxFormat", "size": 88, @@ -1748,6 +2290,22 @@ } ] }, + { + "name": "TSTimerPriority_uint32_t", + "size": 12, + "members": [ + { + "type": "CSBasePriority", + "name": "b_base", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "m_val", + "offset": 8 + } + ] + }, { "name": "CGxTex", "size": 96, @@ -2546,6 +3104,132 @@ } ] }, + { + "name": "EVENT_DATA_KEY", + "size": 24, + "members": [ + { + "type": "KEY", + "name": "key", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "metaKeyState", + "offset": 8 + }, + { + "type": "uint32_t", + "name": "repeat", + "offset": 12 + }, + { + "type": "uint32_t", + "name": "time", + "offset": 16 + } + ] + }, + { + "name": "EVENT_DATA_MOUSE", + "size": 48, + "members": [ + { + "type": "MOUSEMODE", + "name": "mode", + "offset": 0 + }, + { + "type": "MOUSEBUTTON", + "name": "button", + "offset": 8 + }, + { + "type": "uint32_t", + "name": "buttonState", + "offset": 16 + }, + { + "type": "uint32_t", + "name": "metaKeyState", + "offset": 20 + }, + { + "type": "uint32_t", + "name": "flags", + "offset": 24 + }, + { + "type": "float", + "name": "x", + "offset": 28 + }, + { + "type": "float", + "name": "y", + "offset": 32 + }, + { + "type": "int32_t", + "name": "wheelDistance", + "offset": 36 + }, + { + "type": "uint32_t", + "name": "time", + "offset": 40 + } + ] + }, + { + "name": "OSEVENT", + "size": 20, + "members": [ + { + "type": "OSINPUT", + "name": "id", + "offset": 0 + }, + { + "type": "int32_t", + "name": "param", + "arrsize": 4, + "offset": 4 + } + ] + }, + { + "name": "CSBasePriorityQueue", + "size": 20, + "members": [ + { + "type": "TSGrowableArray_pointer_to_void", + "name": "b_base", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "m_linkOffset", + "offset": 16 + } + ] + }, + { + "name": "EvtIdTable_pointer_to_EvtTimer", + "size": 32, + "members": [ + { + "type": "TSGrowableArray_pointer_to_EvtTimer", + "name": "m_allocArray", + "offset": 0 + }, + { + "type": "TSGrowableArray_uint32_t", + "name": "m_freeArray", + "offset": 16 + } + ] + }, { "name": "TSLinkedNode_CGxBuf", "size": 8, @@ -2605,6 +3289,295 @@ } ] }, + { + "name": "TSLinkedNode_EVENTLISTENERNODE", + "size": 8, + "members": [ + { + "type": "TSLink_EVENTLISTENERNODE", + "name": "m_link", + "offset": 0 + } + ] + }, + { + "name": "TSLinkedNode_EvtContext", + "size": 8, + "members": [ + { + "type": "TSLink_EvtContext", + "name": "m_link", + "offset": 0 + } + ] + }, + { + "name": "EvtHandler", + "size": 24, + "members": [ + { + "type": "TSLink_EvtHandler", + "name": "link", + "offset": 0 + }, + { + "type": "void**", + "name": "func", + "offset": 8 + }, + { + "type": "void*", + "name": "param", + "offset": 12 + }, + { + "type": "float", + "name": "priority", + "offset": 16 + }, + { + "type": "int32_t", + "name": "marker", + "offset": 20 + } + ] + }, + { + "name": "TSLinkedNode_EvtHandler", + "size": 8, + "members": [ + { + "type": "TSLink_EvtHandler", + "name": "m_link", + "offset": 0 + } + ] + }, + { + "name": "EvtKeyDown", + "size": 16, + "members": [ + { + "type": "TSLink_EvtKeyDown", + "name": "link", + "offset": 0 + }, + { + "type": "KEY", + "name": "key", + "offset": 8 + } + ] + }, + { + "name": "TSLinkedNode_EvtKeyDown", + "size": 8, + "members": [ + { + "type": "TSLink_EvtKeyDown", + "name": "m_link", + "offset": 0 + } + ] + }, + { + "name": "EvtMessage", + "size": 20, + "members": [ + { + "type": "TExtraInstanceRecyclable", + "name": "b_base", + "offset": 0 + }, + { + "type": "TSLink_EvtMessage", + "name": "link", + "offset": 4 + }, + { + "type": "EVENTID", + "name": "id", + "offset": 12 + }, + { + "type": "char", + "name": "data", + "arrsize": 4, + "offset": 16 + } + ] + }, + { + "name": "TSLinkedNode_EvtMessage", + "size": 8, + "members": [ + { + "type": "TSLink_EvtMessage", + "name": "m_link", + "offset": 0 + } + ] + }, + { + "name": "TSHashObject_FrameScript_EventObject_HASHKEY_STRI", + "size": 24, + "members": [ + { + "type": "uint32_t", + "name": "m_hashval", + "offset": 0 + }, + { + "type": "TSLink_FrameScript_EventObject", + "name": "m_linktoslot", + "offset": 4 + }, + { + "type": "TSLink_FrameScript_EventObject", + "name": "m_linktofull", + "offset": 12 + }, + { + "type": "HASHKEY_STRI", + "name": "m_key", + "offset": 20 + } + ] + }, + { + "name": "TSLinkedNode_FrameScript_EventObject", + "size": 8, + "members": [ + { + "type": "TSLink_FrameScript_EventObject", + "name": "m_link", + "offset": 0 + } + ] + }, + { + "name": "TSLinkedNode_SIMPLEFRAMENODE", + "size": 8, + "members": [ + { + "type": "TSLink_SIMPLEFRAMENODE", + "name": "m_link", + "offset": 0 + } + ] + }, + { + "name": "TSList_EvtMessage", + "size": 12, + "members": [ + { + "type": "ptrdiff_t", + "name": "m_linkoffset", + "offset": 0 + }, + { + "type": "TSLink_EvtMessage", + "name": "m_terminator", + "offset": 4 + } + ] + }, + { + "name": "TSList_EvtHandler", + "size": 12, + "members": [ + { + "type": "ptrdiff_t", + "name": "m_linkoffset", + "offset": 0 + }, + { + "type": "TSLink_EvtHandler", + "name": "m_terminator", + "offset": 4 + } + ] + }, + { + "name": "TSList_EvtKeyDown", + "size": 12, + "members": [ + { + "type": "ptrdiff_t", + "name": "m_linkoffset", + "offset": 0 + }, + { + "type": "TSLink_EvtKeyDown", + "name": "m_terminator", + "offset": 4 + } + ] + }, + { + "name": "TSList_EvtContext", + "size": 12, + "members": [ + { + "type": "ptrdiff_t", + "name": "m_linkoffset", + "offset": 0 + }, + { + "type": "TSLink_EvtContext", + "name": "m_terminator", + "offset": 4 + } + ] + }, + { + "name": "TSList_SIMPLEFRAMENODE", + "size": 12, + "members": [ + { + "type": "ptrdiff_t", + "name": "m_linkoffset", + "offset": 0 + }, + { + "type": "TSLink_SIMPLEFRAMENODE", + "name": "m_terminator", + "offset": 4 + } + ] + }, + { + "name": "TSList_EVENTLISTENERNODE", + "size": 12, + "members": [ + { + "type": "ptrdiff_t", + "name": "m_linkoffset", + "offset": 0 + }, + { + "type": "TSLink_EVENTLISTENERNODE", + "name": "m_terminator", + "offset": 4 + } + ] + }, + { + "name": "TSList_FrameScript_EventObject", + "size": 12, + "members": [ + { + "type": "ptrdiff_t", + "name": "m_linkoffset", + "offset": 0 + }, + { + "type": "TSLink_FrameScript_EventObject", + "name": "m_terminator", + "offset": 4 + } + ] + }, { "name": "TSList_CGxBuf", "size": 12, @@ -2706,6 +3679,52 @@ } ] }, + { + "name": "EvtTimer", + "size": 48, + "members": [ + { + "type": "uint32_t", + "name": "id", + "offset": 0 + }, + { + "type": "TSTimerPriority_uint32_t", + "name": "targetTime", + "offset": 4 + }, + { + "type": "float", + "name": "timeout", + "offset": 16 + }, + { + "type": "void**", + "name": "handler", + "offset": 20 + }, + { + "type": "void*", + "name": "param", + "offset": 24 + }, + { + "type": "void**", + "name": "guidHandler", + "offset": 28 + }, + { + "type": "uint64_t", + "name": "guidParam", + "offset": 32 + }, + { + "type": "void*", + "name": "guidParam2", + "offset": 40 + } + ] + }, { "name": "CGxBuf", "size": 32, @@ -2838,6 +3857,91 @@ } ] }, + { + "name": "EVENTLISTENERNODE", + "size": 12, + "members": [ + { + "type": "TSLinkedNode_EVENTLISTENERNODE", + "name": "b_base", + "offset": 0 + }, + { + "type": "FrameScript_Object*", + "name": "listener", + "offset": 8 + } + ] + }, + { + "name": "TInstanceId_EvtContext", + "size": 12, + "members": [ + { + "type": "TSLinkedNode_EvtContext", + "name": "b_base", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "m_id", + "offset": 8 + } + ] + }, + { + "name": "FrameScript_EventObject", + "size": 24, + "members": [ + { + "type": "TSHashObject_FrameScript_EventObject_HASHKEY_STRI", + "name": "b_base", + "offset": 0 + } + ] + }, + { + "name": "SIMPLEFRAMENODE", + "size": 12, + "members": [ + { + "type": "TSLinkedNode_SIMPLEFRAMENODE", + "name": "b_base", + "offset": 0 + }, + { + "type": "CSimpleFrame*", + "name": "frame", + "offset": 8 + } + ] + }, + { + "name": "TSHashTable_FrameScript_EventObject_HASHKEY_STRI", + "size": 36, + "members": [ + { + "type": "TSList_FrameScript_EventObject", + "name": "m_fulllist", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "m_fullnessIndicator", + "offset": 12 + }, + { + "type": "TSGrowableArray_TSList_FrameScript_EventObject", + "name": "m_slotlistarray", + "offset": 16 + }, + { + "type": "uint32_t", + "name": "m_slotmask", + "offset": 32 + } + ] + }, { "name": "CGxPool", "size": 52, @@ -3295,6 +4399,28 @@ } ] }, + { + "name": "EvtTimerQueue", + "size": 20, + "members": [ + { + "type": "TSPriorityQueue_EvtTimer", + "name": "b_base", + "offset": 0 + } + ] + }, + { + "name": "TSingletonInstanceId_EvtContext", + "size": 12, + "members": [ + { + "type": "TInstanceId_EvtContext", + "name": "b_base", + "offset": 0 + } + ] + }, { "name": "CGxDeviceD3d", "size": 16048, @@ -3472,6 +4598,148 @@ "offset": 16036 } ] + }, + { + "name": "EvtContext", + "size": 640, + "members": [ + { + "type": "TSingletonInstanceId_EvtContext", + "name": "b_base", + "offset": 0 + }, + { + "type": "uint32_t", + "name": "unkA", + "offset": 12 + }, + { + "type": "SCritSect", + "name": "m_critsect", + "offset": 16 + }, + { + "type": "uint32_t", + "name": "m_currTime", + "offset": 40 + }, + { + "type": "SCHEDSTATE", + "name": "m_schedState", + "offset": 48 + }, + { + "type": "TSTimerPriority_uint32_t", + "name": "m_schedNextWakeTime", + "offset": 56 + }, + { + "type": "uint32_t", + "name": "m_schedLastIdle", + "offset": 68 + }, + { + "type": "uint32_t", + "name": "m_schedFlags", + "offset": 72 + }, + { + "type": "uint32_t", + "name": "m_schedIdleTime", + "offset": 76 + }, + { + "type": "uint32_t", + "name": "m_schedInitialIdleTime", + "offset": 80 + }, + { + "type": "uint32_t", + "name": "m_schedWeight", + "offset": 84 + }, + { + "type": "uint32_t", + "name": "m_schedSmoothWeight", + "offset": 88 + }, + { + "type": "int32_t", + "name": "m_schedRebalance", + "offset": 92 + }, + { + "type": "int32_t", + "name": "unkXX", + "offset": 96 + }, + { + "type": "int32_t", + "name": "unkXY", + "offset": 100 + }, + { + "type": "int32_t", + "name": "unkXZ", + "offset": 104 + }, + { + "type": "int32_t", + "name": "unkYY", + "offset": 108 + }, + { + "type": "int32_t", + "name": "unkYZ", + "offset": 112 + }, + { + "type": "TSExplicitList_EvtHandler", + "name": "m_queueHandlerList", + "arrsize": 36, + "offset": 116 + }, + { + "type": "TSExplicitList_EvtMessage", + "name": "m_queueMessageList", + "offset": 548 + }, + { + "type": "uint32_t", + "name": "m_queueSyncButtonState", + "offset": 560 + }, + { + "type": "TSExplicitList_EvtKeyDown", + "name": "m_queueSyncKeyDownList", + "offset": 564 + }, + { + "type": "EvtIdTable_pointer_to_EvtTimer", + "name": "m_timerIdTable", + "offset": 576 + }, + { + "type": "EvtTimerQueue", + "name": "m_timerQueue", + "offset": 608 + }, + { + "type": "HPROPCONTEXT", + "name": "m_propContext", + "offset": 628 + }, + { + "type": "void*", + "name": "m_callContext", + "offset": 632 + }, + { + "type": "uint32_t", + "name": "m_startWatchdog", + "offset": 636 + } + ] } ], "unions": [ diff --git a/README.md b/README.md index 7c8fdf8..61f8f99 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ This repository hosts some work related to studying the original game binaries. You can use the information here to get a headstart when working on the [Whoa project](https://github.com/whoahq/whoa). +- [Dependencies (optional)](#dependencies--optional-) - [Header files](#header-files) - [Symbol files](#symbol-files) - [Debugging files](#debugging-files) @@ -17,6 +18,24 @@ You can use the information here to get a headstart when working on the [Whoa pr * [Importing database](#importing-database) * [Importing types](#importing-types) +# Dependencies (optional) + +This project can be utilized immediately using files we have already generated. However, if you wish to make modifications to the C header and symbol files, **it may be necessary to refresh the generated files that are based on them**. + +You'll need: + + - Go >= 1.22 + - git + - Make + - Bash shell + +You can regenerate everything to include your changes with: + +```bash +make dependencies +make +``` + # Header files To make looking at the binary easier, C header files to match the original executable's memory layout are provided. They aim to be lightweight and self-contained, so that many tools can make use of them. @@ -34,7 +53,7 @@ FunctionName 00CC00DDEE f To improve the call stack view in x64dbg, you should append an `end` field to every function, with the address where this function ends and another begins (i.e. after the last instruction of the function): -``` +```csv FunctionName 00CC00DDEE f end=00CC00DDFF ``` @@ -79,7 +98,8 @@ To import the main header file into your Ghidra project, 2. Select `clib.prf` as your parse configuration, and clear all source files and input paths. 3. Add the header `/include/main.h` to the `Source files to parse` combo box. 4. Add the path to `/include` to the `Include paths` combo box. - 5. press `Parse to Program`. + 5. Add `-DGHIDRA` to a new line in `Parse Options`. + 6. press `Parse to Program`. If all goes well, Data Type Manager will now contain the data structures from the headers. @@ -91,7 +111,7 @@ To import the symbol file into your Ghidra project, 2. In the table view, lookup `ImportSymbolsScript.py` 3. Run the script 4. Enter the path to `/symbol/main.sym` - + # IDA ## Importing C headers @@ -99,7 +119,7 @@ To import the symbol file into your Ghidra project, To import the main header file into your IDA database, 1. Go to `Options` 🡒 `Compiler` - 2. In `Include directories`, add the path to `/ida/include` and press `OK` + 2. Add `IDA` to the semicolon-separated `Predefined macros` list. 3. Go to `File` 🡒 `Load file` 🡒 `Parse C Header file` 4. Enter the path to `/include/main.h` @@ -108,7 +128,8 @@ To import the main header file into your IDA database, To use the IDC script, 1. Go to `File` 🡒 `Script file...` - 2. Navigate to `/ida/import.idc` + 2. Navigate to `/ida/import_symbols.idc` + 3. Wait for everything to be reanalyzed # x64dbg diff --git a/go.mod b/go.mod index 6d0f679..2f624c0 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( ) require ( + github.com/davecgh/go-spew v1.1.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/spf13/pflag v1.0.5 // indirect diff --git a/go/profile/ida_generate_files.go b/go/profile/ida_generate_files.go index 9f1526e..3bf2962 100644 --- a/go/profile/ida_generate_files.go +++ b/go/profile/ida_generate_files.go @@ -12,49 +12,62 @@ import ( func (profile *Profile) generate_symbols_idc() (err error) { var ( - output_file *os.File + f *os.File ) - output_file, err = os.Create(filepath.Join(profile.Directory, "ida", "import.idc")) + f, err = os.Create(filepath.Join(profile.Directory, "ida", "import_symbols.idc")) if err != nil { return } - fmt.Fprintf(output_file, "#include \n") - fmt.Fprintf(output_file, "\n") - fmt.Fprintf(output_file, "static main() {\n") - fmt.Fprintf(output_file, " // Make names\n") + fmt.Fprintf(f, "#include \n") + fmt.Fprintf(f, "\n") + fmt.Fprintf(f, "#include \"import_data_types.idc\"\n") + fmt.Fprintf(f, "static main() {\n") + fmt.Fprintf(f, " // Make names\n") for _, symbol := range profile.SymbolTable.Entries { quoted_name := strconv.Quote(symbol.Name) address := fmt.Sprintf("0x%08X", symbol.StartAddress) - fmt.Fprintf(output_file, " set_name(%s, %s);\n", address, quoted_name) + fmt.Fprintf(f, " set_name(%s, %s);\n", address, quoted_name) } - fmt.Fprintf(output_file, " // Make functions\n") + fmt.Fprintf(f, " // Make functions\n") for _, function_symbol := range profile.SymbolTable.Entries { if function_symbol.Kind == symfile.Function { address := fmt.Sprintf("0x%08X", function_symbol.StartAddress) - fmt.Fprintf(output_file, " set_func_start(%s, %s);\n", address, address) + fmt.Fprintf(f, " set_func_start(%s, %s);\n", address, address) if function_symbol.EndAddress != 0 { end_address := fmt.Sprintf("0x%08X", function_symbol.EndAddress) - fmt.Fprintf(output_file, " set_func_end(%s, %s);\n", address, end_address) + fmt.Fprintf(f, " set_func_end(%s, %s);\n", address, end_address) } } } - fmt.Fprintf(output_file, " // Apply data types\n") + fmt.Fprintf(f, " // Apply data types\n") + fmt.Fprintf(f, " import_data_types();\n") + fmt.Fprintf(f, "}\n") + + f.Close() + + f, err = os.Create(filepath.Join(profile.Directory, "ida", "import_data_types.idc")) + if err != nil { + return + } + + fmt.Fprintf(f, "#include \n") + fmt.Fprintf(f, "\n") + fmt.Fprintf(f, "static import_data_types() {\n") for _, symbol := range profile.SymbolTable.Entries { if symbol.DataType != "" { quoted_data_type := strconv.Quote(symbol.DataType) address := fmt.Sprintf("0x%08X", symbol.StartAddress) - fmt.Fprintf(output_file, " apply_type(%s, %s);\n", address, quoted_data_type) + fmt.Fprintf(f, " apply_type(%s, %s);\n", address, quoted_data_type) } } - fmt.Fprintf(output_file, "}\n") + fmt.Fprintf(f, "}\n") - output_file.Close() return } diff --git a/go/profile/include/stdbool.h b/go/profile/include/stdbool.h deleted file mode 100644 index 4b11d10..0000000 --- a/go/profile/include/stdbool.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SYSTEM_STD_BOOL_H -#define SYSTEM_STD_BOOL_H - -typedef char bool; - -#endif \ No newline at end of file diff --git a/go/profile/x64dbg_generate_types.go b/go/profile/x64dbg_generate_types.go index 3cb5688..e38ab74 100644 --- a/go/profile/x64dbg_generate_types.go +++ b/go/profile/x64dbg_generate_types.go @@ -79,6 +79,7 @@ loop: arrsize *= int32(t.Len()) case cc.Function: s = "void*" + s + break loop default: s = t.Kind().String() + s break loop @@ -114,6 +115,10 @@ func (profile *Profile) generate_x64dbg_types() (err error) { } cc_sources := []cc.Source{ + cc.Source{ + Name: "pch.h", + Value: `#define BINANA_GENERATOR 1\n`, + }, cc.Source{ Name: filepath.Join(profile.Directory, "include", "main.h"), }, @@ -155,10 +160,10 @@ func (profile *Profile) generate_x64dbg_types() (err error) { for _, node := range scope { if declarator, ok := node.(*cc.Declarator); ok { if declarator.IsTypedefName { - if declarator.Type().Kind() != cc.Struct { - var x64_type x64dbg.AliasType = cc_type_to_typedef(declarator.Type()) - x64_type.Name = scope_id.String() - if !slices.Contains(ignore_types, x64_type.Name) { + var x64_type x64dbg.AliasType = cc_type_to_typedef(declarator.Type()) + x64_type.Name = scope_id.String() + if !slices.Contains(ignore_types, x64_type.Name) { + if x64_type.Name != x64_type.Type { x64_types.Types = append(x64_types.Types, x64_type) } }