From d67e052d757c93c75bc381d4ebf8b20f16f5c2d4 Mon Sep 17 00:00:00 2001 From: superp00t Date: Mon, 30 Sep 2024 23:26:03 -0400 Subject: [PATCH] feat(profile): label CGxDevice callback functions --- .../3.3.5a-windows/ida/import_data_types.idc | 6 + profile/3.3.5a-windows/ida/import_symbols.idc | 27 ++++ .../3.3.5a-windows/symbol/gxdevice/func.sym | 57 ++++---- profile/3.3.5a-windows/symbol/main.sym | 9 ++ profile/3.3.5a-windows/x32dbg/game.dd32 | 126 ++++++++++++++++++ 5 files changed, 201 insertions(+), 24 deletions(-) diff --git a/profile/3.3.5a-windows/ida/import_data_types.idc b/profile/3.3.5a-windows/ida/import_data_types.idc index c35b150..1458cb8 100644 --- a/profile/3.3.5a-windows/ida/import_data_types.idc +++ b/profile/3.3.5a-windows/ida/import_data_types.idc @@ -15,6 +15,12 @@ static import_data_types() { apply_type(0x00681F60, "void __stdcall func(float minX, float maxX, float minY, float maxY, float minZ, float maxZ)"); apply_type(0x00682DC0, "int32_t __thiscall func(CGxDevice* this, int32_t a2)"); apply_type(0x00682E20, "int32_t __thiscall func(CGxDevice* this, int32_t a2)"); + apply_type(0x006853B0, "void __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)"); + apply_type(0x006853D0, "int32_t __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)"); + apply_type(0x00685460, "void __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)"); + apply_type(0x00685480, "int32_t __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)"); + apply_type(0x00685510, "void __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)"); + apply_type(0x00685530, "int32_t __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)"); apply_type(0x006A5A30, "void __thiscall func(CGxDeviceD3d* this)"); apply_type(0x006AA3B0, "int32_t __thiscall func(CTgaFile* this)"); apply_type(0x006AA3E0, "uint32_t __thiscall func(CTgaFile* this)"); diff --git a/profile/3.3.5a-windows/ida/import_symbols.idc b/profile/3.3.5a-windows/ida/import_symbols.idc index 326703c..c5c010d 100644 --- a/profile/3.3.5a-windows/ida/import_symbols.idc +++ b/profile/3.3.5a-windows/ida/import_symbols.idc @@ -2124,6 +2124,9 @@ static main() { set_name(0x006840F0, "CGxDevice__DeviceSetFormat"); set_name(0x00684190, "CGxDevice__DeviceSetGamma"); set_name(0x00684360, "CGxDevice__DeviceSetDefWindow"); + set_name(0x006843B0, "CGxDevice__NotifyOnDeviceRestored"); + set_name(0x006843E0, "CGxDevice__NotifyOnTextureRecreation"); + set_name(0x00684410, "CGxDevice__NotifyOnDisplayChange"); set_name(0x00684440, "CGxDevice__ClipPlaneSet"); set_name(0x006847D0, "CGxDevice__LightSet"); set_name(0x00684850, "CGxDevice__BufStream"); @@ -2135,6 +2138,12 @@ static main() { set_name(0x00684C20, "CGxDevice__Log"); set_name(0x00684C40, "CGxDevice__Log_CGxCaps"); set_name(0x00684D10, "CGxDevice__Log"); + set_name(0x006853B0, "CGxDevice__AddDeviceRestoredCallback"); + set_name(0x006853D0, "CGxDevice__RemoveDeviceRestoredCallback"); + set_name(0x00685460, "CGxDevice__AddTextureRecreationCallback"); + set_name(0x00685480, "CGxDevice__RemoveTextureRecreationCallback"); + set_name(0x00685510, "CGxDevice__AddDisplayChangeCallback"); + set_name(0x00685530, "CGxDevice__RemoveDisplayChangeCallback"); set_name(0x00685970, "CGxDevice__IRsDirty"); set_name(0x006859E0, "CGxDevice__IRsForceUpdate_EGxRenderState"); set_name(0x00685A70, "CGxDevice__IRsForceUpdate"); @@ -6915,6 +6924,12 @@ static main() { set_func_end(0x00684190, 0x006841AF); set_func_start(0x00684360, 0x00684360); set_func_end(0x00684360, 0x006843B0); + set_func_start(0x006843B0, 0x006843B0); + set_func_end(0x006843B0, 0x006843D9); + set_func_start(0x006843E0, 0x006843E0); + set_func_end(0x006843E0, 0x00684409); + set_func_start(0x00684410, 0x00684410); + set_func_end(0x00684410, 0x00684439); set_func_start(0x00684440, 0x00684440); set_func_end(0x00684440, 0x006844B9); set_func_start(0x006847D0, 0x006847D0); @@ -6937,6 +6952,18 @@ static main() { set_func_end(0x00684C40, 0x00684D07); set_func_start(0x00684D10, 0x00684D10); set_func_end(0x00684D10, 0x00684D6C); + set_func_start(0x006853B0, 0x006853B0); + set_func_end(0x006853B0, 0x006853C6); + set_func_start(0x006853D0, 0x006853D0); + set_func_end(0x006853D0, 0x0068545C); + set_func_start(0x00685460, 0x00685460); + set_func_end(0x00685460, 0x00685476); + set_func_start(0x00685480, 0x00685480); + set_func_end(0x00685480, 0x0068550C); + set_func_start(0x00685510, 0x00685510); + set_func_end(0x00685510, 0x00685526); + set_func_start(0x00685530, 0x00685530); + set_func_end(0x00685530, 0x006855BC); set_func_start(0x00685970, 0x00685970); set_func_end(0x00685970, 0x006859DB); set_func_start(0x006859E0, 0x006859E0); diff --git a/profile/3.3.5a-windows/symbol/gxdevice/func.sym b/profile/3.3.5a-windows/symbol/gxdevice/func.sym index 3e211ac..e3e2ad2 100644 --- a/profile/3.3.5a-windows/symbol/gxdevice/func.sym +++ b/profile/3.3.5a-windows/symbol/gxdevice/func.sym @@ -1,58 +1,67 @@ -CGxDevice__CGxDevice 00688690 f end=0068903F -CGxDevice__MasterEnableSet 00685EB0 f end=00685F33 -CGxDevice__NewOpenGl 0068BF20 f end=0068BF44 -CGxDevice__NewD3d 00689EF0 f end=00689F14 -CGxDevice__NewD3d9Ex 0068C220 f end=0068C244 +CGxDevice__RsPush 00409670 f end=004096CC CGxDevice__Caps 00532AF0 f end=00532AF7 ; public: class CGxCaps const & __thiscall CGxDevice::Caps(void)const CGxDevice__DeviceCreate_WindowProc_CGxFormat 00682CB0 f end=00682CCB +CGxDevice__DeviceSetBaseMipLevel 00682D00 f end=00682D10 CGxDevice__DeviceApi 00682D20 f end=00682D27 CGxDevice__IDevIsWindowed 00682D40 f end=00682D48 CGxDevice__DeviceCurWindow 00682D70 f end=00682D76 +CGxDevice__CapsIsWindowVisible 00682DC0 f end=00682DE7 type="int32_t __thiscall func(CGxDevice* this, int32_t a2)" +CGxDevice__CapsHasContext 00682E20 f end=00682E47 type="int32_t __thiscall func(CGxDevice* this, int32_t a2)" CGxDevice__ScenePresent 00682E50 f end=00682E66 CGxDevice__PrimCalcCount 00682F40 f end=00682F66 CGxDevice__LightEnable 00683080 f end=006830A4 CGxDevice__NeedsUpdate 006830B0 f end=006830F9 CGxDevice__MasterEnable 00683100 f end=00683121 +CGxDevice__BufData 00683130 f end=00683142 +CGxDevice__BufLock 00683150 f end=00683171 +CGxDevice__BufUnlock 00683180 f end=006831A0 CGxDevice__ShaderConstantsClear 006833A0 f end=006833DD +CGxDevice__ShaderConstantsSet 006833E0 f end=00683554 CGxDevice__ShaderConstantsLock 00683560 f end=00683577 CGxDevice__ShaderConstantsUnlock 00683580 f end=006835D6 +CGxDevice__ICursorDestroy 006835E0 f end=00683602 CGxDevice__ICursorUpdate 00683610 f end=00683632 +CGxDevice__CursorSetVisible 00683640 f end=00683650 +CGxDevice__CursorLock 00683650 f end=00683657 +CGxDevice__CursorSetDepth 00683660 f end=00683670 CGxDevice__DeviceSetFormat 006840F0 f end=0068416C +CGxDevice__DeviceSetGamma 00684190 f end=006841AF CGxDevice__DeviceSetDefWindow 00684360 f end=006843B0 +CGxDevice__NotifyOnDeviceRestored 006843B0 f end=006843D9 +CGxDevice__NotifyOnTextureRecreation 006843E0 f end=00684409 +CGxDevice__NotifyOnDisplayChange 00684410 f end=00684439 CGxDevice__ClipPlaneSet 00684440 f end=006844B9 CGxDevice__LightSet 006847D0 f end=00684843 CGxDevice__BufStream 00684850 f end=0068489F +CGxDevice__TexMarkForUpdate 006848A0 f end=000684900 +CGxDevice__ITexMarkAsUpdated 00684900 f end=0068492D CGxDevice__IShaderLoad 00684970 f end=00684AC8 +CGxDevice__ICursorCreate 00684AD0 f end=00684B4A +CGxDevice__CursorUnlock 00684B50 f end=00684B99 CGxDevice__Log 00684C20 f end=00684C3E CGxDevice__Log_CGxCaps 00684C40 f end=00684D07 ; CGxDevice::Log(CGxCaps const&) const CGxDevice__Log 00684D10 f end=00684D6C +CGxDevice__AddDeviceRestoredCallback 006853B0 f end=006853C6 type="void __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)" +CGxDevice__RemoveDeviceRestoredCallback 006853D0 f end=0068545C type="int32_t __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)" +CGxDevice__AddTextureRecreationCallback 00685460 f end=00685476 type="void __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)" +CGxDevice__RemoveTextureRecreationCallback 00685480 f end=0068550C type="int32_t __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)" +CGxDevice__AddDisplayChangeCallback 00685510 f end=00685526 type="void __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)" +CGxDevice__RemoveDisplayChangeCallback 00685530 f end=006855BC type="int32_t __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)" CGxDevice__IRsDirty 00685970 f end=006859DB CGxDevice__IRsForceUpdate_EGxRenderState 006859E0 f end=00685A65 ; CGxDevice::IRsForceUpdate(EGxRenderState) CGxDevice__IRsForceUpdate 00685A70 f end=00685B4E ; CGxDevice::IRsForceUpdate() CGxDevice__IRsSync 00685B50 f end=00685BFE -CGxDevice__RsPush 00409670 f end=004096CC +CGxDevice__TexCreate 00685C60 f end=00685CCB +CGxDevice__MasterEnableSet 00685EB0 f end=00685F33 CGxDevice__RsSet 00685F50 f end=00685FB0 CGxDevice__RsPop 00685FB0 f end=00686116 CGxDevice__BufCreate 00687660 f end=006876C9 CGxDevice__PoolCreate 006876D0 f end=0068773F -CGxDevice__ITexWHDStartEnd 006A5EF0 f end=006A5FDF -CGxDevice__TexMarkForUpdate 006848A0 f end=000684900 -CGxDevice__ITexMarkAsUpdated 00684900 f end=0068492D -CGxDevice__ICursorCreate 00684AD0 f end=00684B4A -CGxDevice__ICursorDestroy 006835E0 f end=00683602 CGxDevice__ICursorDraw 00687A90 f end=00687FCA -CGxDevice__DeviceSetBaseMipLevel 00682D00 f end=00682D10 -CGxDevice__DeviceSetGamma 00684190 f end=006841AF CGxDevice__PoolDestroy 00688340 f end=00688372 -CGxDevice__BufLock 00683150 f end=00683171 -CGxDevice__BufUnlock 00683180 f end=006831A0 -CGxDevice__BufData 00683130 f end=00683142 -CGxDevice__TexCreate 00685C60 f end=00685CCB +CGxDevice__CGxDevice 00688690 f end=0068903F CGxDevice__ShaderCreate 006897C0 f end=00689A49 -CGxDevice__ShaderConstantsSet 006833E0 f end=00683554 -CGxDevice__CursorSetVisible 00683640 f end=00683650 -CGxDevice__CursorLock 00683650 f end=00683657 -CGxDevice__CursorSetDepth 00683660 f end=00683670 -CGxDevice__CursorUnlock 00684B50 f end=00684B99 -CGxDevice__CapsHasContext 00682E20 f end=00682E47 type="int32_t __thiscall func(CGxDevice* this, int32_t a2)" -CGxDevice__CapsIsWindowVisible 00682DC0 f end=00682DE7 type="int32_t __thiscall func(CGxDevice* this, int32_t a2)" \ No newline at end of file +CGxDevice__NewD3d 00689EF0 f end=00689F14 +CGxDevice__NewOpenGl 0068BF20 f end=0068BF44 +CGxDevice__NewD3d9Ex 0068C220 f end=0068C244 +CGxDevice__ITexWHDStartEnd 006A5EF0 f end=006A5FDF \ No newline at end of file diff --git a/profile/3.3.5a-windows/symbol/main.sym b/profile/3.3.5a-windows/symbol/main.sym index 2b82b17..2b2ea5a 100644 --- a/profile/3.3.5a-windows/symbol/main.sym +++ b/profile/3.3.5a-windows/symbol/main.sym @@ -2119,6 +2119,9 @@ CGxDevice__CursorSetDepth 00683660 f end=00683670 CGxDevice__DeviceSetFormat 006840F0 f end=0068416C CGxDevice__DeviceSetGamma 00684190 f end=006841AF CGxDevice__DeviceSetDefWindow 00684360 f end=006843B0 +CGxDevice__NotifyOnDeviceRestored 006843B0 f end=006843D9 +CGxDevice__NotifyOnTextureRecreation 006843E0 f end=00684409 +CGxDevice__NotifyOnDisplayChange 00684410 f end=00684439 CGxDevice__ClipPlaneSet 00684440 f end=006844B9 CGxDevice__LightSet 006847D0 f end=00684843 CGxDevice__BufStream 00684850 f end=0068489F @@ -2130,6 +2133,12 @@ CGxDevice__CursorUnlock 00684B50 f end=00684B99 CGxDevice__Log 00684C20 f end=00684C3E CGxDevice__Log_CGxCaps 00684C40 f end=00684D07 ; CGxDevice::Log(CGxCaps const&) const CGxDevice__Log 00684D10 f end=00684D6C +CGxDevice__AddDeviceRestoredCallback 006853B0 f end=006853C6 type="void __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)" +CGxDevice__RemoveDeviceRestoredCallback 006853D0 f end=0068545C type="int32_t __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)" +CGxDevice__AddTextureRecreationCallback 00685460 f end=00685476 type="void __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)" +CGxDevice__RemoveTextureRecreationCallback 00685480 f end=0068550C type="int32_t __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)" +CGxDevice__AddDisplayChangeCallback 00685510 f end=00685526 type="void __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)" +CGxDevice__RemoveDisplayChangeCallback 00685530 f end=006855BC type="int32_t __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)" CGxDevice__IRsDirty 00685970 f end=006859DB CGxDevice__IRsForceUpdate_EGxRenderState 006859E0 f end=00685A65 ; CGxDevice::IRsForceUpdate(EGxRenderState) CGxDevice__IRsForceUpdate 00685A70 f end=00685B4E ; CGxDevice::IRsForceUpdate() diff --git a/profile/3.3.5a-windows/x32dbg/game.dd32 b/profile/3.3.5a-windows/x32dbg/game.dd32 index 2725a10..7847678 100644 --- a/profile/3.3.5a-windows/x32dbg/game.dd32 +++ b/profile/3.3.5a-windows/x32dbg/game.dd32 @@ -16968,6 +16968,30 @@ "icount": "0x0", "parent": "0x284360" }, + { + "manual": true, + "start": "0x2843b0", + "end": "0x2843d8", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x2843b0" + }, + { + "manual": true, + "start": "0x2843e0", + "end": "0x284408", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x2843e0" + }, + { + "manual": true, + "start": "0x284410", + "end": "0x284438", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x284410" + }, { "manual": true, "start": "0x284440", @@ -17056,6 +17080,54 @@ "icount": "0x0", "parent": "0x284d10" }, + { + "manual": true, + "start": "0x2853b0", + "end": "0x2853c5", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x2853b0" + }, + { + "manual": true, + "start": "0x2853d0", + "end": "0x28545b", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x2853d0" + }, + { + "manual": true, + "start": "0x285460", + "end": "0x285475", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x285460" + }, + { + "manual": true, + "start": "0x285480", + "end": "0x28550b", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x285480" + }, + { + "manual": true, + "start": "0x285510", + "end": "0x285525", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x285510" + }, + { + "manual": true, + "start": "0x285530", + "end": "0x2855bb", + "module": "wow.exe", + "icount": "0x0", + "parent": "0x285530" + }, { "manual": true, "start": "0x285970", @@ -33968,6 +34040,24 @@ "text": "CGxDevice__DeviceSetDefWindow", "address": "0x284360" }, + { + "manual": true, + "module": "wow.exe", + "text": "CGxDevice__NotifyOnDeviceRestored", + "address": "0x2843b0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "CGxDevice__NotifyOnTextureRecreation", + "address": "0x2843e0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "CGxDevice__NotifyOnDisplayChange", + "address": "0x284410" + }, { "manual": true, "module": "wow.exe", @@ -34034,6 +34124,42 @@ "text": "CGxDevice__Log", "address": "0x284d10" }, + { + "manual": true, + "module": "wow.exe", + "text": "CGxDevice__AddDeviceRestoredCallback", + "address": "0x2853b0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "CGxDevice__RemoveDeviceRestoredCallback", + "address": "0x2853d0" + }, + { + "manual": true, + "module": "wow.exe", + "text": "CGxDevice__AddTextureRecreationCallback", + "address": "0x285460" + }, + { + "manual": true, + "module": "wow.exe", + "text": "CGxDevice__RemoveTextureRecreationCallback", + "address": "0x285480" + }, + { + "manual": true, + "module": "wow.exe", + "text": "CGxDevice__AddDisplayChangeCallback", + "address": "0x285510" + }, + { + "manual": true, + "module": "wow.exe", + "text": "CGxDevice__RemoveDisplayChangeCallback", + "address": "0x285530" + }, { "manual": true, "module": "wow.exe",