Graphics Programs Reference
In-Depth Information
first instruction is another mov instruction that will write the address 0x8048484
into the memory address contained in the ESP register. But what is ESP
pointing to?
(gdb) i r esp
esp 0xbffff800 0xbffff800
( gdb)
Currently, ESP points to the memory address 0xbffff800 , so when the mov
instruction is executed, the address 0x8048484 is written there. But why? What's
so special about the memory address 0x8048484 ? There's one way to find out.
(gdb) x/2xw 0x8048484
0x8048484: 0x6c6c6548 0x6f57206f
(gdb) x/6xb 0x8048484
0x8048484: 0x48 0x65 0x6c 0x6c 0x6f 0x20
(gdb) x/6ub 0x8048484
0x8048484: 72 101 108 108 111 32
(gdb)
A trained eye might notice something about the memory here, in par-
ticular the range of the bytes. After examining memory for long enough,
these types of visual patterns become more apparent. These bytes fall within
the printable ASCII range. ASCII is an agreed-upon standard that maps
all the characters on your keyboard (and some that aren't) to fixed numbers.
The bytes 0x48 , 0x65 , 0x6c , and 0x6f all correspond to letters in the alphabet on
the ASCII table shown below. This table is found in the man page for ASCII,
available on most Unix systems by typing man ascii .
ASCII Table
Oct Dec Hex Char Oct Dec Hex Char
------------------------------------------------------------
000 0 00 NUL '\0' 100 64 40 @
001 1 01 SOH 101 65 41 A
002 2 02 STX 102 66 42 B
003 3 03 ETX 103 67 43 C
004 4 04 EOT 104 68 44 D
005 5 05 ENQ 105 69 45 E
006 6 06 ACK 106 70 46 F
007 7 07 BEL '\a' 107 71 47 G
010 8 08 BS '\b' 110 72 48 H
011 9 09 HT '\t' 111 73 49 I
012 10 0A LF '\n' 112 74 4A J
013 11 0B VT '\v' 113 75 4B K
014 12 0C FF '\f' 114 76 4C L
015 13 0D CR '\r' 115 77 4D M
016 14 0E SO 116 78 4E N
017 15 0F SI 117 79 4F O
020 16 10 DLE 120 80 50 P
021 17 11 DC1 121 81 51 Q
Search WWH ::




Custom Search