[RESOLVED] How is hex 35 01 dec 309?
Hello,
I'm probably just being really dumb, but how can hex 35 01 be decimal 309?
A quick check in Calculator shows hex 35 01 to be 13569, yet when I use a hex editor on a value of "35 01", it shows "35 01 as integer: 309". The actual value I want it to be is 309, so it is correct, but I'm wondering how it reached that answer?
Any advice would be appreciated - maths certainly isn't my strong point :)
Re: How is hex 35 01 dec 309?
0x3501 = 13569 as you said, but 309 = 0x0135.
Re: How is hex 35 01 dec 309?
Just to clear it up a little..
Your hex editor is reading the value as "little endian", basically backwards. Instead of 35 01, it is seeing it as 01 35 (=309)
Re: How is hex 35 01 dec 309?
Thanks a lot, that makes sense now :D
Re: [RESOLVED] How is hex 35 01 dec 309?
All intel-based hardware uses little endian storage by default. But when you write numbers on paper it is by definition big endian. Intel does this because its a bit more efficient for the computer to work this way. Some other architectures (RISC for example) use big endian storage which looks a lot more sensible when you hex edit a file.
Swings and roundabouts really.