| View previous topic :: View next topic |
| Author |
Message |
TrayShade How do I cheat?
Reputation: 0
Joined: 26 Jul 2015 Posts: 4
|
Posted: Sun Jul 26, 2015 8:43 am Post subject: Hexadecimal representation of decimal numbers. Please help. |
|
|
I am currently changing a bunch of values in a game called Breath of Fire IV.
It is going well, but i encountered a small problem.
Basically i do not understand the 'conversion' (Wrong word?) of Hex to Dec with different amounts of bytes.
For example, in the memory viewer a byte shows the Hex value of 43, when double clicked it shows the decimal value of 67 in 1 byte, but with 2 bytes it shows the value 1347 instead.
When using the windows calculator in programmer mode to convert Hex to Dec, 43 equals 67 both in 'byte' and 'word' (which is 2 bytes right?).
I get the feeling i am missing something and i was hoping you could point out what it is exactly.
Thank you.
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Jul 26, 2015 9:02 am Post subject: |
|
|
Lets say an address contains the following four bytes.
43 05 00 01
Values are stored in a little-endian manner. This means the bytes are stored in a reverse order.
Byte (1-byte) = bytes: [43] = hex: 43 = decimal: 67
Word (2-bytes) = bytes: [43, 05] = hex: 0543 = decimal: 1347
DWord (4-bytes) = bytes: [43, 05, 00, 01] = hex: 01000543 = decimal: 16778563
|
|
| Back to top |
|
 |
TrayShade How do I cheat?
Reputation: 0
Joined: 26 Jul 2015 Posts: 4
|
Posted: Sun Jul 26, 2015 1:31 pm Post subject: |
|
|
Thanks a lot.
Turns out i was simply ignorant as to how the information was stored.
Perfect answer.
|
|
| Back to top |
|
 |
|