Yes, nothing more.So you just create a CPU1 thread for RPC?
It can still crash the loader if the connection is ended on computer side.
For the dump_mem function, I'm sure it's not working good. So I made another function, here it is:
Code:
def dump(self, address, num_words, filename):
total_words = 0
mem = open(filename, 'wb')
step = 100
while total_words < num_words:
data = []
words_to_read = step
if ((total_words + words_to_read) > num_words):
words_to_read = num_words - total_words
# Build an RPC request and send it
request = struct.pack(">III", 0, address, words_to_read)
self.conn[0].sendall(request)
# Block for a reply
reply = self.conn[0].recv(512)
fmt = '>' + str(words_to_read) + 'I'
data.extend(struct.unpack(fmt, reply[4:4+(words_to_read*4)]))
address += (4 * words_to_read)
total_words += (4 * words_to_read)
for word in data:
mem.write(struct.pack(">I", word))
print "%d/%d" % (total_words, num_words)
print("Dumped to " + filename)
mem.close()
Last edited by golden45,