Quote:
Originally Posted by slayer12
hi @ [Only registered and activated users can see links. Click Here To Register...]
Can you help me find the base address of vPos parameter? I've already tried searching write/access opcodes and also used pointer scan but i can't find that green address. Below is a snippet:
Code:
typedef void (__thiscall * SendDropItem_t)(void * client, int nothing, unsigned int itemid, unsigned int DropNum, unsigned int vPos);
SendDropItem_t pSendDropItem ;
uintptr_t p = 0x1999BC;
vPos = *reinterpret_cast<unsigned int *>(p);;
g_DPlay.SendDropItem( 0, m_pItemElem->m_dwObjId, 1, m_vPos );
pSendDropItem = (SendDropItem_t)((DWORD)g_hExeModule+0x1DE30);
if (GetAsyncKeyState(VK_OEM_MINUS)) //drop item id
{
pSendDropItem((void*)g_DPlay, nothing, itemid , DropNum , vPos );
printf_s("DROPPING ID: %x\n", itemid);
}
I was able to drop items but the problem is, it is not being dropped on my location because my vPos values are wrong. The address 0x1999BC always contain the value of vPos even i reopen clients but it contains a hexadecimal value.
Below is the location of the function @ _Interface\WndField.cpp
Code:
BOOL CWndDropConfirm::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
{
if( nID == WIDC_YES || message == EN_RETURN )
{
// add error code so i can find the string in disect CE
Error("CWndDropConfirm::OnChildNotify");
g_DPlay.SendDropItem( 0, m_pItemElem->m_dwObjId, 1, m_vPos );
Destroy();
}
else if( nID == WIDC_NO )
{
Destroy();
}
return CWndNeuz::OnChildNotify( message, nID, pLResult );
}
|
I don't know what you are trying to do but if the issue is related to the
m_vPos you should make sure this variable has the correct type.
It looks like it is a structure so it could be defined like this:
Code:
typedef struct D3DXVECTOR3 {
FLOAT x;
FLOAT y;
FLOAT z;
} D3DXVECTOR3, *LPD3DXVECTOR3;
After that, you need to declare a variable like this:
Code:
D3DXVECTOR3 m_vPos;
and you should fill the structure with the player position so you will need to get the X, Y and Z coordinates and initialize the m_vPos like this:
Code:
m_vPos.x = playerX;
m_vPos.y = playerY;
m_vPos.z = playerZ;
It is better that you put all this in the same struct, something like in this dirty code (I am not sure it will compile even taken part by part but I am sure you understand the idea):
Code:
__inline float ReadFloatPointer(ULONG_PTR* PointerBase, int PointerOffset)
{
if(!IsBadReadPtr((void*)PointerBase, 4))
{
if(!IsBadReadPtr((void*)((*(ULONG_PTR*)PointerBase) + PointerOffset), 4))
{
return *(float*)((*(ULONG_PTR*)PointerBase) + PointerOffset);
}
}
return 0;
}
//.......
unsigned long * LocalPlayer;
const unsigned long ul_PlayerBase = 0x12345678;
const unsigned long ul_XOffset = 0x160;
const unsigned long ul_YOffset = ul_XOffset + 0x4;
const unsigned long ul_ZOffset = ul_XOffset + 0x4 + 0x4;
const unsigned long ulModbase = 0x400000;
//.........
LocalPlayer = (unsigned long*) (ulModbase +ul_PlayerBase);
typedef struct D3DXVECTOR3 {
FLOAT x;
FLOAT y;
FLOAT z;
void readVpos()
{
x = ReadFloatPointer((ULONG_PTR*)LocalPlayer, ul_XOffset) + 10.0;
y = ReadFloatPointer((ULONG_PTR*)LocalPlayer, ul_YOffset);
z = ReadFloatPointer((ULONG_PTR*)LocalPlayer, ul_ZOffset) + 10.0;
}
} D3DXVECTOR3, *LPD3DXVECTOR3;
D3DXVECTOR3 m_vPos;
m_vpos.readVpos();
// TODO call your hack function
//......