Hello folks,
Jesus - this caused me quite a headache - I tested so many ways ... and this is how I found a working solution:
There is a function zCVob_GetVobInfo:
Code:
FUNC STRING zCVob_GetVobInfo (var int vobPtr)
{
//005D6AE0 .text Debug data ?GetVobInfo@zCVob@@QAE?AVzSTRING@@XZ
const int zCVob__GetVobInfo_G1 = 6122208;
//0x00602100 public: class zSTRING __thiscall zCVob::GetVobInfo(void)
const int zCVob__GetVobInfo_G2 = 6299904;
CALL_RetValIszString();
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCVob__GetVobInfo_G1, zCVob__GetVobInfo_G2));
return CALL_RetValAszstring ();
};
Which returns string with several details for zcVob. When called on this anvil this is what it returned:
"ocMobInter, id: 1, name: BS_ANVIL, visual: zCModel, leafs: 1, refCtr: 6, sector"
From "visual: zCModel" I hoped that I have to get zCModel of oCMob first of all to get to visual name itself.
Then I searched through all oCMob functions and found oCMOB__GetModel (returns zCModel), then searched through all zCModel functions and found zCModel_GetVisualName.
Long story short - when combined they give me finally name of visual for ocMobInter objects. So finally I can work on another useful hook - stay tuned
Code:
FUNC INT oCMob_GetModel (var int mobPtr)
{
if (!mobPtr) { return 0; };
//0067AD00 .text Debug data ?GetModel@oCMOB@@UAEPAVzCModel@@XZ
const int oCMOB__GetModel_G1 = 6794496;
//0x0071BEE0 public: virtual class zCModel * __thiscall oCMOB::GetModel(void)
const int oCMOB__GetModel_G2 = 7454432;
CALL__thiscall (mobPtr, MEMINT_SwitchG1G2 (oCMOB__GetModel_G1, oCMOB__GetModel_G2));
return CALL_RetValAsInt();
};
FUNC STRING zCModel_GetVisualName (var int modelPtr)
{
if (!modelPtr) { return ""; };
//00563EF0 .text Debug data ?GetVisualName@zCModel@@UAE?AVzSTRING@@XZ
const int zCModel__GetVisualName_G1 = 5652208;
//0x0057DF60 public: virtual class zSTRING __thiscall zCModel::GetVisualName(void)
const int zCModel__GetVisualName_G2 = 5758816;
CALL_RetValIszString();
CALL__thiscall (modelPtr, MEMINT_SwitchG1G2 (zCModel__GetVisualName_G1, zCModel__GetVisualName_G2));
return CALL_RetValAszstring ();
};
FUNC STRING Mob_GetVisualName (var int mobPtr)
{
return zCModel_GetVisualName (oCMob_GetModel (mobPtr));
};