help with pointer+offset

11/28/2010 14:45 korzon123#1
this is my code in c++

Code:
__inline ULONG_PTR ReadPointer(ULONG_PTR* ulBase, INT nOffset)
{
   if (!IsBadReadPtr((VOID*)ulBase, sizeof(ULONG_PTR)))
    {
        if (!IsBadReadPtr((VOID*)((*(ULONG_PTR*)ulBase)+nOffset), sizeof(ULONG_PTR)))
        {
            return *(ULONG_PTR*)((*(ULONG_PTR*)ulBase)+nOffset);
        }
    }
    return 0;
}
Code:
	int AttSpeed = (int)ReadPointer((ULONG_PTR*)((((0x106656F8)+ 0x1C)+ 0x10)+ 0x4), 0xDDC);
	label4->Text = AttSpeed.ToString();
this not working
when i login in LC USA this is 0
hp mp exp working but this no why?
this code is wrong?