freemyipod r922 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r921‎ | r922 | r923 >
Date:21:39, 6 May 2014
Author:theseven
Status:new
Tags:
Comment:
emCORE tools: Some minor fixes
Modified paths:
  • /emcore/trunk/tools/libemcore.py (modified) (history)
  • /emcore/trunk/tools/libemcoreldr.py (modified) (history)
  • /emcore/trunk/tools/tlsfanalyze.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/tlsfanalyze.py
@@ -136,12 +136,12 @@
137137 try:
138138 nfa = block.get_next_free().get_address()
139139 if nfa >= prev_addr and nfa < prev_addr + block.get_size() + 4:
140 - print("%08X: Next free block (%08X) lies within the block itself" % (prev_addr, nfa))
 140+ print("%08X: Next free block (%08X) is within the block itself" % (prev_addr, nfa))
141141 except: print("%08X: Invalid next free block pointer: %08X" % (prev_addr, block.next_free))
142142 try:
143143 pfa = block.get_prev_free().get_address()
144144 if pfa >= prev_addr and pfa < prev_addr + block.get_size() + 4:
145 - print("%08X: Previous free block (%08X) lies within the block itself" % (prev_addr, pfa))
 145+ print("%08X: Previous free block (%08X) is within the block itself" % (prev_addr, pfa))
146146 except:
147147 print("%08X: Invalid previous free block pointer: %08X" % (prev_addr, block.prev_free))
148148 print("%08X: %08X bytes free" % (prev_addr + 4, block.get_size() + 4))
@@ -255,7 +255,7 @@
256256 try:
257257 nfa = block.get_next_free().get_address()
258258 if nfa >= addr and nfa < addr + size + 4:
259 - print("[%d:%d:%08X] Next free block (%08X) lies within the block itself" % (i, j, addr, nfa))
 259+ print("[%d:%d:%08X] Next free block (%08X) is within the block itself" % (i, j, addr, nfa))
260260 fatal = True
261261 except:
262262 print("[%d:%d:%08X] Invalid next free block pointer: %08X" % (i, j, addr, block.next_free))
@@ -263,7 +263,7 @@
264264 try:
265265 pfa = block.get_prev_free().get_address()
266266 if pfa >= addr and pfa < addr + size + 4:
267 - print("[%d:%d:%08X] Previous free block (%08X) lies within the block itself" % (i, j, addr, pfa))
 267+ print("[%d:%d:%08X] Previous free block (%08X) is within the block itself" % (i, j, addr, pfa))
268268 if prev == None and not block.get_prev_free().is_null():
269269 print("[%d:%d:%08X] Previous free block pointer is broken: %08X (should be NULL)" % (i, j, addr, pfa))
270270 if prev != None and prev != pfa:
Index: emcore/trunk/tools/libemcore.py
@@ -1088,6 +1088,7 @@
10891089 self.logger.debug("Looking for emCORE device\n")
10901090 devs = usb.core.find(find_all=True, idVendor=self.idVendor)
10911091 for dev in devs:
 1092+ self.logger.debug("%04x:%04x\n" % (dev.idVendor, dev.idProduct))
10921093 if dev.idProduct & self.idProductMask == self.idProduct:
10931094 self.dev = dev
10941095 break
@@ -1097,6 +1098,7 @@
10981099 self.logger.debug("Searching for device interface:\n")
10991100 for cfg in self.dev:
11001101 for intf in cfg:
 1102+ self.logger.debug("%02x:%02x:%02x\n" % (intf.bInterfaceClass, intf.bInterfaceSubClass, intf.bInterfaceProtocol))
11011103 if intf.bInterfaceClass == 0xff and intf.bInterfaceSubClass == 0 and intf.bInterfaceProtocol == 0:
11021104 self.interface = intf.bInterfaceNumber
11031105 break
Index: emcore/trunk/tools/libemcoreldr.py
@@ -119,7 +119,7 @@
120120
121121 maxblk = self.maxin - 0x10
122122
123 - data = ""
 123+ data = b""
124124
125125 while True:
126126 blocklen = size