# Trying to understand *((_DWORD *) in IDA pro

Hi I am trying to understand pseudocode from this game I'm currently modifying.

``````if ( v11 == 501736410 )                       // case 0x1DE7E3DA: //"Weapon"
{
*((_DWORD *)v6 + 326) = 3;
}
else if ( v11 == 731299553 )                  // case 0x2B96BEE1: // "Speed"
{
*((_DWORD *)v6 + 326) = 2;
}
``````

I don't understand what *((_DWORD *)v6 + 326) = 3; does I get it's changing it into a 3 but what is being changed?

`v6 is void *v6; // esi@1`

convert v6 into a struct
(create a dummy if you are not sure what the members are ) look around and create a struct that is greater than the maximum accessed offset

suppose you notice *(dword *) v6 + 830 is accessed or modified then create a struct like (see the declaration of MyDStruct below)

You know 326 is being accessed so start with xxx = 326 ida deciphered the member at offset 326 as a DWORD *

you also noticed 830 is accessed and it is an int so the size of second unknown is 830-326-4 == 500;

please be aware I am using 4 bytes for a pointer wrt 32 bit architecture if it is a 64 bit binary pointers will be of 8bytes wide so keep that in mind when calculating the fake counts

``````struct _MYDUMMYSTRUCT  {
byte/char  unknown1;  xxx == 326 see above
PDWORD Weapon;
byte/char  unknown2; yyy = (830- 326+4)  see above
int someint;
}MyDStruct,*PmyDstruct;
``````

apply this struct to v6

the pseudo code will be more clearer

some thing along the line of

``````switch (v11)
{
case 501xx:
MyDStruct.Weapon = 3;
case 731yy:
MyDstruct.Speed = 2;
……
case Default
DoDefault
}
``````