freemyipod r577 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r576‎ | r577 | r578 >
Date:16:01, 9 February 2011
Author:theseven
Status:new
Tags:
Comment:
emcore.py: hexdump: fix endianness
Modified paths:
  • /emcore/trunk/tools/emcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcore.py
@@ -293,7 +293,7 @@
294294 if i >= 0 and i < size:
295295 w = 0
296296 for b in range(wordsize):
297 - w = (w << 8) | struct.unpack("B", data[i + b])[0]
 297+ w = w | (struct.unpack("B", data[i + b])[0] << (8 * b))
298298 sys.stdout.write((" %%0%dX" % (wordsize * 2)) % w)
299299 else: sys.stdout.write(" " * (wordsize * 2 + 1))
300300 if ascii: