It is quite straightforward to write ints or hexadecimals to a memory address with gdb:
(gdb) set {int}0x08040000 = 42 (gdb) set {int}0x08040000 = 0xffffffff
Use strcpy()
strcpy()
(gdb) p malloc(20) $3 = (void *) 0x6ce81808 (gdb) p strcpy($3, "my string") $4 = 1827149832 (gdb) x/s $3 0x6ce81808: "my string"