Index: embios/trunk/tools/libembios.py |
— | — | @@ -565,7 +565,7 @@ |
566 | 566 | response = self.__getbulk(self.handle, self.__cinep, 0x10)
|
567 | 567 | self.__checkstatus(response)
|
568 | 568 |
|
569 | | - sendbytes = struct.unpack("<I", response[4:8])
|
| 569 | + sendbytes = struct.unpack("<I", response[4:8])[0]
|
570 | 570 | if sendbytes < blocklen: # not everything has been written, need to resent some stuff but wait a bit before doing so
|
571 | 571 | time.sleep(0.1)
|
572 | 572 | timeoutcounter += 1
|
— | — | @@ -617,7 +617,7 @@ |
618 | 618 | response = self.__getbulk(self.handle, self.__cinep, blocklen + 0x10)
|
619 | 619 | self.__checkstatus(response)
|
620 | 620 |
|
621 | | - readbytes = struct.unpack("<III", response[4:8])
|
| 621 | + readbytes = struct.unpack("<III", response[4:8])[0]
|
622 | 622 | out_data += response[0x10:0x10+readbytes]
|
623 | 623 | size -= blocklen
|
624 | 624 |
|
— | — | @@ -770,39 +770,39 @@ |
771 | 771 | while ptr < len(processinfo):
|
772 | 772 | retval.append({})
|
773 | 773 |
|
774 | | - retval[process_n]['regs'] = struct.unpack("<IIIIIIIIIIIIIIII", processinfo[ptr:])
|
| 774 | + retval[process_n]['regs'] = struct.unpack("<IIIIIIIIIIIIIIII", processinfo[ptr:])[0]
|
775 | 775 | ptr += 16 * 0x4
|
776 | | - retval[process_n]['cpsr'] = struct.unpack("<I", processinfo[ptr:])
|
| 776 | + retval[process_n]['cpsr'] = struct.unpack("<I", processinfo[ptr:])[0]
|
777 | 777 | ptr += 1 * 0x4
|
778 | | - retval[process_n]['state'] = struct.unpack("<I", processinfo[ptr:])
|
| 778 | + retval[process_n]['state'] = struct.unpack("<I", processinfo[ptr:])[0]
|
779 | 779 | 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]
|
781 | 781 | 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]
|
783 | 783 | 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]
|
785 | 785 | ptr += 1 * 0x8
|
786 | | - retval[process_n]['startusec'] = struct.unpack("<I", processinfo[ptr:])
|
| 786 | + retval[process_n]['startusec'] = struct.unpack("<I", processinfo[ptr:])[0]
|
787 | 787 | 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]
|
789 | 789 | ptr += 1 * 0x4
|
790 | | - retval[process_n]['timeout'] = struct.unpack("<I", processinfo[ptr:])
|
| 790 | + retval[process_n]['timeout'] = struct.unpack("<I", processinfo[ptr:])[0]
|
791 | 791 | 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]
|
793 | 793 | 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]
|
795 | 795 | 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]
|
797 | 797 | 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]
|
799 | 799 | 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]
|
801 | 801 | 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]
|
803 | 803 | ptr += 1 * 0x1
|
804 | | - retval[process_n]['priority'] = struct.unpack("<B", processinfo[ptr:])
|
| 804 | + retval[process_n]['priority'] = struct.unpack("<B", processinfo[ptr:])[0]
|
805 | 805 | ptr += 1 * 0x1
|
806 | | - retval[process_n]['cpuload'] = struct.unpack("<B", processinfo[ptr:])
|
| 806 | + retval[process_n]['cpuload'] = struct.unpack("<B", processinfo[ptr:])[0]
|
807 | 807 | ptr += 1 * 0x1
|
808 | 808 |
|
809 | 809 | process_n += 1
|