0

I have to translate the following memory contents to ASCII code, using little endian format:

0x6A636162 0x64726177 0x00002173

I got "jcab draw! s", which is wrong (and of course, is complete nonsense). How are you supposed to do this using little endian format?

3
  • 1
    Are you sure the first number isn't meant to be 0x6B636162?
    – huon
    Commented Apr 29, 2012 at 4:19
  • Yeah positive. It doesn't make any sense to me. I guess it would then flip and read "backwards!" if it was 6B? (but its definitely 6A).
    – rfmas3
    Commented Apr 29, 2012 at 4:21
  • possible duplicate of Translating memory contents into a string via ASCII encoding Commented Sep 16, 2012 at 19:23

1 Answer 1

1

It's supposed to be "backwards!" You read the first two rightmost hex values first as one ascii char, and then focus on the pair to the left of that, until you get to the furthest left most hex values.

2
  • 1
    I don't get "backwards" based on what you just wrote. The first rightmost hex values: 73 -> s, then 21 -> !, then 0 -> NULL, then 0 -> NULL. Can you explain how you arrived at "backwards"?
    – Yu Chen
    Commented Jan 30, 2019 at 17:03
  • You read the first 32-bits (0x6A636162): 62 = b, 61 = a ... Then the next 32-bits (0x64726177): 77 = w, 61 = a ... The last 2 pairs are NULL because you only need 10 characters to represent "backwards!" Commented Jan 31, 2019 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.