freemyipod r103 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r102‎ | r103 | r104 >
Date:23:18, 11 August 2010
Author:benedikt93
Status:new
Tags:
Comment:
fix some libembios.py stuff again
Modified paths:
  • /embios/trunk/tools/libembios.py (modified) (history)

Diff [purge]

Index: embios/trunk/tools/libembios.py
@@ -565,7 +565,7 @@
566566 response = self.__getbulk(self.handle, self.__cinep, 0x10)
567567 self.__checkstatus(response)
568568
569 - sendbytes = struct.unpack("<I", response[4:8])
 569+ sendbytes = struct.unpack("<I", response[4:8])[0]
570570 if sendbytes < blocklen: # not everything has been written, need to resent some stuff but wait a bit before doing so
571571 time.sleep(0.1)
572572 timeoutcounter += 1
@@ -617,7 +617,7 @@
618618 response = self.__getbulk(self.handle, self.__cinep, blocklen + 0x10)
619619 self.__checkstatus(response)
620620
621 - readbytes = struct.unpack("<III", response[4:8])
 621+ readbytes = struct.unpack("<III", response[4:8])[0]
622622 out_data += response[0x10:0x10+readbytes]
623623 size -= blocklen
624624
@@ -770,39 +770,39 @@
771771 while ptr < len(processinfo):
772772 retval.append({})
773773
774 - retval[process_n]['regs'] = struct.unpack("<IIIIIIIIIIIIIIII", processinfo[ptr:])
 774+ retval[process_n]['regs'] = struct.unpack("<IIIIIIIIIIIIIIII", processinfo[ptr:])[0]
775775 ptr += 16 * 0x4
776 - retval[process_n]['cpsr'] = struct.unpack("<I", processinfo[ptr:])
 776+ retval[process_n]['cpsr'] = struct.unpack("<I", processinfo[ptr:])[0]
777777 ptr += 1 * 0x4
778 - retval[process_n]['state'] = struct.unpack("<I", processinfo[ptr:])
 778+ retval[process_n]['state'] = struct.unpack("<I", processinfo[ptr:])[0]
779779 ptr += 1 * 0x4
780 - retval[process_n]['name_ptr'] = struct.unpack("<I", processinfo[ptr:])
 780+ retval[process_n]['name_ptr'] = struct.unpack("<I", processinfo[ptr:])[0]
781781 ptr += 1 * 0x4
782 - retval[process_n]['cputime_current'] = struct.unpack("<I", processinfo[ptr:])
 782+ retval[process_n]['cputime_current'] = struct.unpack("<I", processinfo[ptr:])[0]
783783 ptr += 1 * 0x4
784 - retval[process_n]['cputime_total'] = struct.unpack("<Q", processinfo[ptr:])
 784+ retval[process_n]['cputime_total'] = struct.unpack("<Q", processinfo[ptr:])[0]
785785 ptr += 1 * 0x8
786 - retval[process_n]['startusec'] = struct.unpack("<I", processinfo[ptr:])
 786+ retval[process_n]['startusec'] = struct.unpack("<I", processinfo[ptr:])[0]
787787 ptr += 1 * 0x4
788 - retval[process_n]['queue_next_ptr'] = struct.unpack("<I", processinfo[ptr:])
 788+ retval[process_n]['queue_next_ptr'] = struct.unpack("<I", processinfo[ptr:])[0]
789789 ptr += 1 * 0x4
790 - retval[process_n]['timeout'] = struct.unpack("<I", processinfo[ptr:])
 790+ retval[process_n]['timeout'] = struct.unpack("<I", processinfo[ptr:])[0]
791791 ptr += 1 * 0x4
792 - retval[process_n]['blocked_since'] = struct.unpack("<I", processinfo[ptr:])
 792+ retval[process_n]['blocked_since'] = struct.unpack("<I", processinfo[ptr:])[0]
793793 ptr += 1 * 0x4
794 - retval[process_n]['blocked_by_ptr'] = struct.unpack("<I", processinfo[ptr:])
 794+ retval[process_n]['blocked_by_ptr'] = struct.unpack("<I", processinfo[ptr:])[0]
795795 ptr += 1 * 0x4
796 - retval[process_n]['stack_ptr'] = struct.unpack("<I", processinfo[ptr:])
 796+ retval[process_n]['stack_ptr'] = struct.unpack("<I", processinfo[ptr:])[0]
797797 ptr += 1 * 0x4
798 - retval[process_n]['err_no'] = struct.unpack("<I", processinfo[ptr:])
 798+ retval[process_n]['err_no'] = struct.unpack("<I", processinfo[ptr:])[0]
799799 ptr += 1 * 0x4
800 - retval[process_n]['block_type'] = struct.unpack("<B", processinfo[ptr:])
 800+ retval[process_n]['block_type'] = struct.unpack("<B", processinfo[ptr:])[0]
801801 ptr += 1 * 0x1
802 - retval[process_n]['thread_type'] = struct.unpack("<B", processinfo[ptr:])
 802+ retval[process_n]['thread_type'] = struct.unpack("<B", processinfo[ptr:])[0]
803803 ptr += 1 * 0x1
804 - retval[process_n]['priority'] = struct.unpack("<B", processinfo[ptr:])
 804+ retval[process_n]['priority'] = struct.unpack("<B", processinfo[ptr:])[0]
805805 ptr += 1 * 0x1
806 - retval[process_n]['cpuload'] = struct.unpack("<B", processinfo[ptr:])
 806+ retval[process_n]['cpuload'] = struct.unpack("<B", processinfo[ptr:])[0]
807807 ptr += 1 * 0x1
808808
809809 process_n += 1