The original DescFunc table located at D2CLIENT + 0x2DAD4
Copy the original table to construct new one.
Code: Select all
//new table
void* NewDescFuncTable[DESCFUNC_MAX_SIZE]
//copy from old one
std::copy(D2CLIENT_pDescFuncTable, D2CLIENT_pDescFuncTable + 28, NewDescFuncTable);
//new descfunc
NewDescFuncTable[28] = &ItemDesc29;
Code: Select all
//patch switch case size
{D2DLL_D2CLIENT, 0x2CFA7, (DWORD)DESCFUNC_MAX_SIZE, FALSE, 0x01},
//patch original using
{D2DLL_D2CLIENT, 0x2CFB7, (DWORD)NewDescFuncTable, FALSE, 0x00},
Code: Select all
__declspec(naked) void ItemDesc29();