Arduino Uno simple LED example with pointers
You made two small mistakes:


The addresses of the I/O registers are 0x24 for DDRB and 0x25
for PORTB. The numbers you used are I/O port numbers, but since
pointers are supposed to point to memory, you have to use the
memory-mapped addresses instead.
Pin 13 is PB5, not PB6.


With these two mistakes fixed, your code works as expected. There are
still two issues however:


Under some circumstances, the compiler can optimize away some writes
to these registers. You have to qualify the pointers as “pointer to
volatile data” in order to avoid this. Even if your simple example
does not show this problem, it is always safer to use the qualifier.
The compiler generates inefficient code. Not as inefficient as
digitalWrite(), but still... It knows how to optimize, but it is
prevented to do so by the fact that your pointers are modifiable. You
should qualify them as const if you want to benefit from compiler
optimizations.


With those fixes, your pointer definitions would look like:

volatile uint8_t * const data = (uint8_t *) 0x25;
volatile uint8_t * const dir  = (uint8_t *) 0x24;


and access to them gets compiled into efficient in ans out assembly
instructions.

That being said, if you want to do direct port access, I would recommend
doing it the avr-libc way:

void setup() {
    DDRB  = _BV(PB5);
    PORTB = _BV(PB5);
}

void loop() {
    PORTB = _BV(PB5);
}


The way the AVR-libc defines the I/O registers is roughly equivalent to

#define PORTB (* (volatile uint8_t *) 0x25)