Beispiel #1
0
            )  # Now that scope is armed we send the newline, i guess we're triggering on serial

            response = target.read(16)  # Get the encrypted data
            if len(response) != 16:
                raise Exception("Timeout in target response: " +
                                response.hex())

            print(dataIn.hex(), end=' ')
            print(response.hex(), hexAscii(response), end=' ')
            print('\n', end=' ')

            if scope.waitForCompletion() == False:
                print("Missed the trigger, let's try again")
                time.sleep(0.01)
                continue  # missed the trigger try again
            samples = scope.getSamples()

            #data = list(map(ord,dataIn+response))
            data = dataIn + response

            ts.addTrace(Trace(b'', data, samples))  # save the trace
        except Exception as e:
            print(e)
            print(traceback.format_exc())

            #try to re-sync target and scope
            scope.reconnect()
            testTarget(target)

scope.close()