Search code examples
c++ida

What's going on here: v5 = *(_Byte *)(this + 4)?


I am looking at a code dump from IDA pro. There is a function which as this layout:

garbled_name(int this...
    unsigned int v5 ;
    v5 = *(_Byte *)(this + 4);
    ...

What I am really curious about is what exactly the '+ 4' is doing? Is this an addition or something else?

Thanks


Solution

  • The code takes the integer 'this', adds 4 to it, casts it to a pointer to a byte, and then sets 'v5' to the value of the byte at that address.