feat(binana): improve documentation, add a way to import information into IDA

This commit is contained in:
phaneron 2024-08-03 00:45:27 -04:00
parent 063790577d
commit 061609ed2c
19 changed files with 8072 additions and 20 deletions

5
.gitignore vendored
View file

@ -1,2 +1,3 @@
jest jest
.vscode .vscode
bin

7445
3.3.5a/ida/import.idc Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,4 @@
#ifndef IDA_STD_BOOL_H
#define IDA_STD_BOOL_H
#endif

View file

@ -0,0 +1,17 @@
#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

View file

@ -13,6 +13,9 @@ typedef struct IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9;
typedef struct IDirect3DSurface9 IDirect3DSurface9; typedef struct IDirect3DSurface9 IDirect3DSurface9;
typedef struct IDirect3DIndexBuffer9 IDirect3DIndexBuffer9; typedef struct IDirect3DIndexBuffer9 IDirect3DIndexBuffer9;
typedef struct IDirect3DVertexBuffer9 IDirect3DVertexBuffer9; typedef struct IDirect3DVertexBuffer9 IDirect3DVertexBuffer9;
typedef struct IDirect3DTexture9 IDirect3DTexture9;
typedef struct D3DLOCKED_RECT D3DLOCKED_RECT;
struct D3DDISPLAYMODE { struct D3DDISPLAYMODE {
uint32_t Width; uint32_t Width;
@ -45,4 +48,13 @@ struct IDirect3DVertexBuffer9 {
void** v_vtable; void** v_vtable;
}; };
struct IDirect3DTexture9 {
void** v_vtable;
};
struct D3DLOCKED_RECT {
int32_t Pitch;
void* pBits;
};
#endif #endif

View file

@ -30,9 +30,9 @@ struct CGxDeviceD3d {
IDirect3DSurface9* m_defDepthSurface; IDirect3DSurface9* m_defDepthSurface;
uint32_t unk3B44; uint32_t unk3B44;
uint32_t unk3B48; uint32_t unk3B48;
uint32_t unk3B4C; int32_t m_hwCursorNeedsUpdate;
uint32_t unk3B50; IDirect3DTexture9* m_hwCursorTexture;
uint32_t unk3B54; IDirect3DSurface9* m_hwCursorBitmap;
uint32_t unk3B58; uint32_t unk3B58;
IDirect3DVertexDeclaration9* m_d3dCurrentVertexDecl; IDirect3DVertexDeclaration9* m_d3dCurrentVertexDecl;
IDirect3DIndexBuffer9* m_d3dCurrentIndexBuf; IDirect3DIndexBuffer9* m_d3dCurrentIndexBuf;

View file

@ -0,0 +1 @@
CursorInitialize 006163B0 f end=006164A5

View file

@ -0,0 +1 @@
CGameUI__Initialize 0052A980 f end=0052AEC6

View file

@ -0,0 +1,18 @@
CGlueMgr__SetCurrentAccount 004D7F60 f end=004D7F82
CGlueMgr__DisplayLoginStatus 004D80C0 f end=004D8200
CGlueMgr__SetScreen 004D82A0 f end=004D82B8
CGlueMgr__UpdateCurrentScreen 004D82C0 f end=004D834D
CGlueMgr__HandleDisplaySizeChanged 004D8860 f end=004D8924
CGlueMgr__Suspend 004D8930 f end=004D8A2D
CGlueMgr__LoginServerLogin 004D8A30 f end=004D8B9C
CGlueMgr__ChangeRealm 004D8BD0 f end=004D8C56
CGlueMgr__OnKickReasonMsg 004D9500 f end=004D9582
CGlueMgr__GetCharacterList 004D95C0 f end=004D960D
CGlueMgr__StatusDialogClick 004D98D0 f end=004D99D4
CGlueMgr__LogConnectionStatus 004DA3D0 f end=004DA4A8
CGlueMgr__SetLoginStateAndResult 004DA4B0 f end=004DA50D
CGlueMgr__Resume 004DA5F0 f end=004DA9C4
CGlueMgr__NetDisconnectHandler 004DA9D0 f end=004DAB3D
CGlueMgr__Idle 004DAB40 f end=004DB9E4
CGlueMgr__Initialize 004DB9F0 f end=004DBBBF
CGlueMgr__SurveyDownloadCancel 004E4A40 f end=004E4A9E

View file

@ -17,4 +17,6 @@ GxDraw 00482A40 f end=00482A5D
GxShaderConstantsSet 00408210 f end=0040823B GxShaderConstantsSet 00408210 f end=0040823B
GxBufLock 004829D0 f end=004829E9 GxBufLock 004829D0 f end=004829E9
GxBufUnlock 004829F0 f end=00482A13 GxBufUnlock 004829F0 f end=00482A13
GxBufStream 00482A20 f end=00482A3C GxBufStream 00482A20 f end=00482A3C
GxScenePresent 00682A00 f end=00682A33
GxSceneClear 006813B0 f end=006813CD

View file

@ -13,6 +13,7 @@ CGxDeviceD3d__DeviceCreate_WindowProc_CGxFormat 00690750 f end=00690821
CGxDeviceD3d__ICursorDestroy 006A00C0 f end=006A0102 CGxDeviceD3d__ICursorDestroy 006A00C0 f end=006A0102
CGxDeviceD3d__ITexMarkAsUpdated 006A3070 f end=006A30CF CGxDeviceD3d__ITexMarkAsUpdated 006A3070 f end=006A30CF
CGxDeviceD3d__ISceneBegin 006A3350 f end=006A3417 CGxDeviceD3d__ISceneBegin 006A3350 f end=006A3417
CGxDeviceD3d__ISceneEnd 006A3420 f end=006A3449
CGxDeviceD3d__ScenePresent 006A3450 f end=006A3611 CGxDeviceD3d__ScenePresent 006A3450 f end=006A3611
CGxDeviceD3d__Draw 006A3620 f end=006A3716 CGxDeviceD3d__Draw 006A3620 f end=006A3716
CGxDeviceD3d__IStateSyncEnables 006A3810 f end=006A386E CGxDeviceD3d__IStateSyncEnables 006A3810 f end=006A386E

View file

@ -153,12 +153,30 @@ C44Matrix__Rotate 004C33C0 f
C3Vector__Normalize_1 004C3420 f C3Vector__Normalize_1 004C3420 f
C3Vector__Normalize_2 004C3600 f C3Vector__Normalize_2 004C3600 f
C33Matrix__operator_assign_C33Matrix 004C51B0 f C33Matrix__operator_assign_C33Matrix 004C51B0 f
CGlueMgr__SetCurrentAccount 004D7F60 f end=004D7F82
CGlueMgr__DisplayLoginStatus 004D80C0 f end=004D8200
CGlueMgr__SetScreen 004D82A0 f end=004D82B8
CGlueMgr__UpdateCurrentScreen 004D82C0 f end=004D834D
CGlueMgr__HandleDisplaySizeChanged 004D8860 f end=004D8924
CGlueMgr__Suspend 004D8930 f end=004D8A2D
CGlueMgr__LoginServerLogin 004D8A30 f end=004D8B9C
CGlueMgr__ChangeRealm 004D8BD0 f end=004D8C56
CGlueMgr__OnKickReasonMsg 004D9500 f end=004D9582
CGlueMgr__GetCharacterList 004D95C0 f end=004D960D
CGlueMgr__StatusDialogClick 004D98D0 f end=004D99D4
CGlueMgr__LogConnectionStatus 004DA3D0 f end=004DA4A8
CGlueMgr__SetLoginStateAndResult 004DA4B0 f end=004DA50D
CGlueMgr__Resume 004DA5F0 f end=004DA9C4
CGlueMgr__NetDisconnectHandler 004DA9D0 f end=004DAB3D
CGlueMgr__Idle 004DAB40 f end=004DB9E4
CGlueMgr__Initialize 004DB9F0 f end=004DBBBF
Script_GetLocale 004DBFD0 f end=004DBFF3 ; thanks namreeb :^) Script_GetLocale 004DBFD0 f end=004DBFF3 ; thanks namreeb :^)
Script_IsWindowsClient 004DCE40 f end=004DCE5E Script_IsWindowsClient 004DCE40 f end=004DCE5E
Script_RestartGx 004DD400 f end=004DD412 Script_RestartGx 004DD400 f end=004DD412
Script_RestoreVideoStereoDefaults 004DD420 f end=004DD42D Script_RestoreVideoStereoDefaults 004DD420 f end=004DD42D
Script_GetMovieResolution 004DD610 f end=004DD671 Script_GetMovieResolution 004DD610 f end=004DD671
Script_GetExpansionLevel 004DDC20 f end=004DDC51 Script_GetExpansionLevel 004DDC20 f end=004DDC51
CGlueMgr__SurveyDownloadCancel 004E4A40 f end=004E4A9E
TSList__LinkNode 004F71A0 f end=004F724D TSList__LinkNode 004F71A0 f end=004F724D
Script_LoggingChat 004FBD00 f end=004FBD13 Script_LoggingChat 004FBD00 f end=004FBD13
Script_LoggingCombat 004FBD20 f end=004FBD36 Script_LoggingCombat 004FBD20 f end=004FBD36
@ -535,6 +553,7 @@ Script_AcceptAreaSpiritHeal 005262D0 f end=005262D8
Script_TargetTotem 005262E0 f end=00526362 Script_TargetTotem 005262E0 f end=00526362
Script_InteractUnit 00527F00 f end=00527FD4 Script_InteractUnit 00527F00 f end=00527FD4
Script_LoadAddOn 00528920 f end=00528AE1 Script_LoadAddOn 00528920 f end=00528AE1
CGameUI__Initialize 0052A980 f end=0052AEC6
Script_RegisterForSave 0052B470 f end=0052B4D4 Script_RegisterForSave 0052B470 f end=0052B4D4
Script_RegisterForSavePerCharacter 0052B4E0 f end=0052B544 Script_RegisterForSavePerCharacter 0052B4E0 f end=0052B544
Script_GetNumPartyMembers 0052C110 f end=0052C187 Script_GetNumPartyMembers 0052C110 f end=0052C187
@ -2031,10 +2050,12 @@ Script_UnitDebuff 00614CF0 f end=00614D3F
Script_UnitAura 00614D40 f end=00614D83 Script_UnitAura 00614D40 f end=00614D83
Script_GetVehicleUIIndicator 00614E60 f end=00614EEE Script_GetVehicleUIIndicator 00614E60 f end=00614EEE
Script_GetVehicleUIIndicatorSeat 00614EF0 f end=00614FC6 Script_GetVehicleUIIndicatorSeat 00614EF0 f end=00614FC6
CursorInitialize 006163B0 f end=006164A5
GxXformPush_EGxXform_C44Matrix 00616AD0 f end=00616AE8 GxXformPush_EGxXform_C44Matrix 00616AD0 f end=00616AE8
nullsub_4 00632050 f nullsub_4 00632050 f
nullsub_5 00653A10 f nullsub_5 00653A10 f
GxDevCreate 00681290 f end=00681301 GxDevCreate 00681290 f end=00681301
GxSceneClear 006813B0 f end=006813CD
GxTexUpdate 006813D0 f end=006813EC GxTexUpdate 006813D0 f end=006813EC
GxLog 006817E0 f end=006817F5 GxLog 006817E0 f end=006817F5
GxPrimIndexPtr 00681AB0 f end=00681AFB GxPrimIndexPtr 00681AB0 f end=00681AFB
@ -2044,6 +2065,7 @@ GxTexCreate 00681CB0 f end=00681D87
GxDrawLockedElements 00682340 f end=0068239E GxDrawLockedElements 00682340 f end=0068239E
GxPrimVertexPtr_FFP 00682400 f end=00682781 ; this is one of the functions named 'GxPrimVertexPtr' that uses the fixed-function pipeline GxPrimVertexPtr_FFP 00682400 f end=00682781 ; this is one of the functions named 'GxPrimVertexPtr' that uses the fixed-function pipeline
GxPrimLockVertexPtrs 006828C0 f end=006828FE GxPrimLockVertexPtrs 006828C0 f end=006828FE
GxScenePresent 00682A00 f end=00682A33
CGxDevice__DeviceCreate_WindowProc_CGxFormat 00682CB0 f end=00682CCB CGxDevice__DeviceCreate_WindowProc_CGxFormat 00682CB0 f end=00682CCB
CGxDevice__DeviceSetBaseMipLevel 00682D00 f end=00682D10 CGxDevice__DeviceSetBaseMipLevel 00682D00 f end=00682D10
CGxDevice__DeviceApi 00682D20 f end=00682D27 CGxDevice__DeviceApi 00682D20 f end=00682D27
@ -2116,6 +2138,7 @@ CGxDeviceD3d__ICursorDestroy 006A00C0 f end=006A0102
CGxDeviceD3d9Ex__CGxDeviceD3d9Ex 006A1A90 f end=006A1C24 CGxDeviceD3d9Ex__CGxDeviceD3d9Ex 006A1A90 f end=006A1C24
CGxDeviceD3d__ITexMarkAsUpdated 006A3070 f end=006A30CF CGxDeviceD3d__ITexMarkAsUpdated 006A3070 f end=006A30CF
CGxDeviceD3d__ISceneBegin 006A3350 f end=006A3417 CGxDeviceD3d__ISceneBegin 006A3350 f end=006A3417
CGxDeviceD3d__ISceneEnd 006A3420 f end=006A3449
CGxDeviceD3d__ScenePresent 006A3450 f end=006A3611 CGxDeviceD3d__ScenePresent 006A3450 f end=006A3611
CGxDeviceD3d__Draw 006A3620 f end=006A3716 CGxDeviceD3d__Draw 006A3620 f end=006A3716
CGxDeviceD3d__IStateSyncEnables 006A3810 f end=006A386E CGxDeviceD3d__IStateSyncEnables 006A3810 f end=006A386E

View file

@ -1240,6 +1240,142 @@
"icount": "0x0", "icount": "0x0",
"parent": "0xc51b0" "parent": "0xc51b0"
}, },
{
"manual": true,
"start": "0xd7f60",
"end": "0xd7f81",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd7f60"
},
{
"manual": true,
"start": "0xd80c0",
"end": "0xd81ff",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd80c0"
},
{
"manual": true,
"start": "0xd82a0",
"end": "0xd82b7",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd82a0"
},
{
"manual": true,
"start": "0xd82c0",
"end": "0xd834c",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd82c0"
},
{
"manual": true,
"start": "0xd8860",
"end": "0xd8923",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd8860"
},
{
"manual": true,
"start": "0xd8930",
"end": "0xd8a2c",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd8930"
},
{
"manual": true,
"start": "0xd8a30",
"end": "0xd8b9b",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd8a30"
},
{
"manual": true,
"start": "0xd8bd0",
"end": "0xd8c55",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd8bd0"
},
{
"manual": true,
"start": "0xd9500",
"end": "0xd9581",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd9500"
},
{
"manual": true,
"start": "0xd95c0",
"end": "0xd960c",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd95c0"
},
{
"manual": true,
"start": "0xd98d0",
"end": "0xd99d3",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xd98d0"
},
{
"manual": true,
"start": "0xda3d0",
"end": "0xda4a7",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xda3d0"
},
{
"manual": true,
"start": "0xda4b0",
"end": "0xda50c",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xda4b0"
},
{
"manual": true,
"start": "0xda5f0",
"end": "0xda9c3",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xda5f0"
},
{
"manual": true,
"start": "0xda9d0",
"end": "0xdab3c",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xda9d0"
},
{
"manual": true,
"start": "0xdab40",
"end": "0xdb9e3",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xdab40"
},
{
"manual": true,
"start": "0xdb9f0",
"end": "0xdbbbe",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xdb9f0"
},
{ {
"manual": true, "manual": true,
"start": "0xdbfd0", "start": "0xdbfd0",
@ -1288,6 +1424,14 @@
"icount": "0x0", "icount": "0x0",
"parent": "0xddc20" "parent": "0xddc20"
}, },
{
"manual": true,
"start": "0xe4a40",
"end": "0xe4a9d",
"module": "wow.exe",
"icount": "0x0",
"parent": "0xe4a40"
},
{ {
"manual": true, "manual": true,
"start": "0xf71a0", "start": "0xf71a0",
@ -4296,6 +4440,14 @@
"icount": "0x0", "icount": "0x0",
"parent": "0x128920" "parent": "0x128920"
}, },
{
"manual": true,
"start": "0x12a980",
"end": "0x12aec5",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x12a980"
},
{ {
"manual": true, "manual": true,
"start": "0x12b470", "start": "0x12b470",
@ -16264,6 +16416,14 @@
"icount": "0x0", "icount": "0x0",
"parent": "0x214ef0" "parent": "0x214ef0"
}, },
{
"manual": true,
"start": "0x2163b0",
"end": "0x2164a4",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x2163b0"
},
{ {
"manual": true, "manual": true,
"start": "0x216ad0", "start": "0x216ad0",
@ -16296,6 +16456,14 @@
"icount": "0x0", "icount": "0x0",
"parent": "0x281290" "parent": "0x281290"
}, },
{
"manual": true,
"start": "0x2813b0",
"end": "0x2813cc",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x2813b0"
},
{ {
"manual": true, "manual": true,
"start": "0x2813d0", "start": "0x2813d0",
@ -16368,6 +16536,14 @@
"icount": "0x0", "icount": "0x0",
"parent": "0x2828c0" "parent": "0x2828c0"
}, },
{
"manual": true,
"start": "0x282a00",
"end": "0x282a32",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x282a00"
},
{ {
"manual": true, "manual": true,
"start": "0x282cb0", "start": "0x282cb0",
@ -16944,6 +17120,14 @@
"icount": "0x0", "icount": "0x0",
"parent": "0x2a3350" "parent": "0x2a3350"
}, },
{
"manual": true,
"start": "0x2a3420",
"end": "0x2a3448",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x2a3420"
},
{ {
"manual": true, "manual": true,
"start": "0x2a3450", "start": "0x2a3450",
@ -20996,6 +21180,108 @@
"text": "C33Matrix__operator_assign_C33Matrix", "text": "C33Matrix__operator_assign_C33Matrix",
"address": "0xc51b0" "address": "0xc51b0"
}, },
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__SetCurrentAccount",
"address": "0xd7f60"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__DisplayLoginStatus",
"address": "0xd80c0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__SetScreen",
"address": "0xd82a0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__UpdateCurrentScreen",
"address": "0xd82c0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__HandleDisplaySizeChanged",
"address": "0xd8860"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__Suspend",
"address": "0xd8930"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__LoginServerLogin",
"address": "0xd8a30"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__ChangeRealm",
"address": "0xd8bd0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__OnKickReasonMsg",
"address": "0xd9500"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__GetCharacterList",
"address": "0xd95c0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__StatusDialogClick",
"address": "0xd98d0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__LogConnectionStatus",
"address": "0xda3d0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__SetLoginStateAndResult",
"address": "0xda4b0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__Resume",
"address": "0xda5f0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__NetDisconnectHandler",
"address": "0xda9d0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__Idle",
"address": "0xdab40"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__Initialize",
"address": "0xdb9f0"
},
{ {
"manual": true, "manual": true,
"module": "wow.exe", "module": "wow.exe",
@ -21032,6 +21318,12 @@
"text": "Script_GetExpansionLevel", "text": "Script_GetExpansionLevel",
"address": "0xddc20" "address": "0xddc20"
}, },
{
"manual": true,
"module": "wow.exe",
"text": "CGlueMgr__SurveyDownloadCancel",
"address": "0xe4a40"
},
{ {
"manual": true, "manual": true,
"module": "wow.exe", "module": "wow.exe",
@ -23288,6 +23580,12 @@
"text": "Script_LoadAddOn", "text": "Script_LoadAddOn",
"address": "0x128920" "address": "0x128920"
}, },
{
"manual": true,
"module": "wow.exe",
"text": "CGameUI__Initialize",
"address": "0x12a980"
},
{ {
"manual": true, "manual": true,
"module": "wow.exe", "module": "wow.exe",
@ -32264,6 +32562,12 @@
"text": "Script_GetVehicleUIIndicatorSeat", "text": "Script_GetVehicleUIIndicatorSeat",
"address": "0x214ef0" "address": "0x214ef0"
}, },
{
"manual": true,
"module": "wow.exe",
"text": "CursorInitialize",
"address": "0x2163b0"
},
{ {
"manual": true, "manual": true,
"module": "wow.exe", "module": "wow.exe",
@ -32288,6 +32592,12 @@
"text": "GxDevCreate", "text": "GxDevCreate",
"address": "0x281290" "address": "0x281290"
}, },
{
"manual": true,
"module": "wow.exe",
"text": "GxSceneClear",
"address": "0x2813b0"
},
{ {
"manual": true, "manual": true,
"module": "wow.exe", "module": "wow.exe",
@ -32342,6 +32652,12 @@
"text": "GxPrimLockVertexPtrs", "text": "GxPrimLockVertexPtrs",
"address": "0x2828c0" "address": "0x2828c0"
}, },
{
"manual": true,
"module": "wow.exe",
"text": "GxScenePresent",
"address": "0x282a00"
},
{ {
"manual": true, "manual": true,
"module": "wow.exe", "module": "wow.exe",
@ -32774,6 +33090,12 @@
"text": "CGxDeviceD3d__ISceneBegin", "text": "CGxDeviceD3d__ISceneBegin",
"address": "0x2a3350" "address": "0x2a3350"
}, },
{
"manual": true,
"module": "wow.exe",
"text": "CGxDeviceD3d__ISceneEnd",
"address": "0x2a3420"
},
{ {
"manual": true, "manual": true,
"module": "wow.exe", "module": "wow.exe",

View file

@ -1051,6 +1051,22 @@
} }
] ]
}, },
{
"name": "D3DLOCKED_RECT",
"size": 8,
"members": [
{
"type": "int32_t",
"name": "Pitch",
"offset": 0
},
{
"type": "void*",
"name": "pBits",
"offset": 4
}
]
},
{ {
"name": "D3DPSHADERCAPS2_0", "name": "D3DPSHADERCAPS2_0",
"size": 20, "size": 20,
@ -1189,6 +1205,17 @@
} }
] ]
}, },
{
"name": "IDirect3DTexture9",
"size": 4,
"members": [
{
"type": "void**",
"name": "v_vtable",
"offset": 0
}
]
},
{ {
"name": "IDirect3DVertexBuffer9", "name": "IDirect3DVertexBuffer9",
"size": 4, "size": 4,
@ -3385,18 +3412,18 @@
"offset": 15184 "offset": 15184
}, },
{ {
"type": "uint32_t", "type": "int32_t",
"name": "unk3B4C", "name": "m_hwCursorNeedsUpdate",
"offset": 15188 "offset": 15188
}, },
{ {
"type": "uint32_t", "type": "IDirect3DTexture9*",
"name": "unk3B50", "name": "m_hwCursorTexture",
"offset": 15192 "offset": 15192
}, },
{ {
"type": "uint32_t", "type": "IDirect3DSurface9*",
"name": "unk3B54", "name": "m_hwCursorBitmap",
"offset": 15196 "offset": 15196
}, },
{ {

16
Makefile Normal file
View file

@ -0,0 +1,16 @@
all: generate
compile-symbols:
./script/compile-symbols 3.3.5a
ida-gen:
./bin/binana ida-gen --game 3.3.5a
x64dbg-gen:
./bin/binana x64dbg-gen --game 3.3.5a --base-address=00400000 --module-name=wow.exe
generate: compile-symbols x64dbg-gen ida-gen
dependencies:
mkdir -p bin
go build -v -o bin/binana github.com/thunderbrewhq/binana/go/cmd/binana

View file

@ -4,14 +4,39 @@ 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). You can use the information here to get a headstart when working on the [Whoa project](https://github.com/whoahq/whoa).
- [Header files](#header-files)
- [Symbol files](#symbol-files)
- [Debugging files](#debugging-files)
- [Ghidra](#ghidra)
* [Importing C headers](#importing-c-headers)
* [Importing symbols](#importing-symbols)
- [IDA](#ida)
* [Importing C headers](#importing-c-headers-1)
- [x64dbg](#x64dbg)
* [Importing database](#importing-database)
* [Importing types](#importing-types)
# Header files # Header files
To make reverse engineering easier, C header files to match the original executable's memory layout are provided. 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.
# Symbol files # Symbol files
Symbol files are text files that map addresses to functions and variables/data labels. Symbol files are text files that map addresses to functions and variables/data labels.
The format is based on the one used in the stock Ghidra script `ImportSymbolsScript.py`:
```
DataLabel 00DDAA77AA l
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):
```
FunctionName 00CC00DDEE f end=00CC00DDFF
```
In this repo, `script/compile-symbols` is used to concatenate our organized symbol files into one big file (`<game version>/symbol/main.sym`). In this repo, `script/compile-symbols` is used to concatenate our organized symbol files into one big file (`<game version>/symbol/main.sym`).
To refresh the gigantic `main.sym` file after changing one of the source symbol files: To refresh the gigantic `main.sym` file after changing one of the source symbol files:
@ -20,13 +45,36 @@ To refresh the gigantic `main.sym` file after changing one of the source symbol
script/compile-symbols <game version> script/compile-symbols <game version>
``` ```
# Loading information into Ghidra Or just
```
make
```
## Importing headers # Debugging files
The best way to know what a particular routine does is to use a debugger.
With our [x64dbg](https://x64dbg.com/) files, you can easily navigate to various functions, read the call stack, play with variables, and explore data structures.
These files are autogenerated from the C header and symbol files, using our `binana` tool written in Go. You can install it like so:
```bash
make dependencies
```
To regenerate:
```bash
make
```
# Ghidra
## Importing C headers
To import the main header file into your Ghidra project, To import the main header file into your Ghidra project,
1. go to `File` > `Parse C Source...`. 1. go to `File` 🡒 `Parse C Source...`.
2. Select `clib.prf` as your parse configuration, and clear all source files and input paths. 2. Select `clib.prf` as your parse configuration, and clear all source files and input paths.
3. Add the header `<game version>/include/main.h` to the `Source files to parse` combo box. 3. Add the header `<game version>/include/main.h` to the `Source files to parse` combo box.
4. Add the path to `<game version>/include` to the `Include paths` combo box. 4. Add the path to `<game version>/include` to the `Include paths` combo box.
@ -38,12 +86,30 @@ If all goes well, Data Type Manager will now contain the data structures from th
To import the symbol file into your Ghidra project, To import the symbol file into your Ghidra project,
1. go to `Window` > `Script Manager` 1. go to `Window` 🡒 `Script Manager`
2. In the table view, lookup `ImportSymbolsScript.py` 2. In the table view, lookup `ImportSymbolsScript.py`
3. Run the script 3. Run the script
4. Enter the path to `<game version>/symbol/main.sym` 4. Enter the path to `<game version>/symbol/main.sym`
# Loading information into x64dbg (x32dbg) # IDA
## Importing C headers
To import the main header file into your IDA database,
1. Go to `Options` 🡒 `Compiler`
2. In `Include directories`, add the path to `<game version>/ida/include` and press `OK`
3. Go to `File` 🡒 `Load file` 🡒 `Parse C Header file`
4. Enter the path to `<game version>/include/main.h`
## Importing symbols
To use the IDC script,
1. Go to `File` 🡒 `Script file...`
2. Navigate to `<game version>/ida/import.idc`
# x64dbg
For ease of debugging, we provide x64dbg databases (generated by the Go tool from symbol maps), as well as x64dbg type information (generated by the same Go tool from the C headers). For ease of debugging, we provide x64dbg databases (generated by the Go tool from symbol maps), as well as x64dbg type information (generated by the same Go tool from the C headers).
@ -53,7 +119,7 @@ To load the database information into x64dbg:
1. Open x96dbg.exe or x32dbg.exe directly 1. Open x96dbg.exe or x32dbg.exe directly
2. Load your game binary 2. Load your game binary
3. Go to `File` > `Database` > `Import database` 3. Go to `File` 🡒 `Database` 🡒 `Import database`
4. Navigate to `<game version>/x32dbg/game.dd32`. 4. Navigate to `<game version>/x32dbg/game.dd32`.
## Importing types ## Importing types
@ -61,5 +127,5 @@ To load the database information into x64dbg:
To load the type information JSON file: To load the type information JSON file:
1. Open the binary in x32dbg.exe 1. Open the binary in x32dbg.exe
2. in the console, type: `LoadTypes <full path to local binana repository>\x32dbg\types.json` 2. in the console, type: `LoadTypes <full path to local binana repository>\<game version>\x32dbg\types.json`

View file

@ -0,0 +1,38 @@
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/thunderbrewhq/binana/go/profile"
)
var ida_gen = &cobra.Command{
Use: "ida-gen",
Short: "Generate IDC file using symbol file",
Run: ida_gen_func,
}
func ida_gen_func(cmd *cobra.Command, args []string) {
// get command line arguments
// module_name, err := cmd.Flags().GetString("module-name")
// if err != nil {
// panic(err)
// }
game_profile_directory, err := cmd.Flags().GetString("game")
if err != nil {
panic(err)
}
game_profile, err := profile.Open(game_profile_directory)
if err != nil {
panic(err)
}
if err = game_profile.CreateIDAFiles(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}

View file

@ -35,6 +35,9 @@ func init() {
// when this action is called directly. // when this action is called directly.
// rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") // rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
ida_gen.Flags().StringP("game", "g", "3.3.5a", "the game profile")
rootCmd.AddCommand(ida_gen)
x64dbg_gen.Flags().StringP("game", "g", "3.3.5a", "the game profile") x64dbg_gen.Flags().StringP("game", "g", "3.3.5a", "the game profile")
x64dbg_gen.Flags().StringP("module-name", "m", "wow.exe", "the name of the module") x64dbg_gen.Flags().StringP("module-name", "m", "wow.exe", "the name of the module")
x64dbg_gen.Flags().StringP("base-address", "b", "00400000", "the base address of the module") x64dbg_gen.Flags().StringP("base-address", "b", "00400000", "the base address of the module")

View file

@ -0,0 +1,55 @@
package profile
import (
"fmt"
"os"
"path/filepath"
"strconv"
"github.com/thunderbrewhq/binana/go/symfile"
)
func (profile *Profile) generate_symbols_idc() (err error) {
var (
output_file *os.File
)
output_file, err = os.Create(filepath.Join(profile.Directory, "ida", "import.idc"))
if err != nil {
return
}
fmt.Fprintf(output_file, "#include <idc.idc>\n")
fmt.Fprintf(output_file, "\n")
fmt.Fprintf(output_file, "static main() {\n")
fmt.Fprintf(output_file, " // 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(output_file, " // 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)
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(output_file, "}\n")
output_file.Close()
return
}
func (profile *Profile) CreateIDAFiles() (err error) {
err = profile.generate_symbols_idc()
return
}