This repository has been archived by the owner on Jun 5, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from jhoenicke/unit
Update Unit Tests, added SetU2FCounter and debug mem functions
- Loading branch information
Showing
25 changed files
with
323 additions
and
702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
|
||
from trezorlib.debuglink import DebugLink | ||
from trezorlib.client import TrezorClient, TrezorDebugClient | ||
from trezorlib.transport_hid import HidTransport | ||
import binascii | ||
import sys | ||
|
||
def main(): | ||
# List all connected TREZORs on USB | ||
devices = HidTransport.enumerate() | ||
|
||
# Check whether we found any | ||
if len(devices) == 0: | ||
print('No TREZOR found') | ||
return | ||
|
||
# Use first connected device | ||
transport = HidTransport(devices[0]) | ||
|
||
# Creates object for manipulating TREZOR | ||
debug_transport = HidTransport(devices[0], **{'debug_link': True}) | ||
client = TrezorClient(transport) | ||
debug = DebugLink(debug_transport) | ||
|
||
mem = debug.memory_read(int(sys.argv[1],16), int(sys.argv[2],16)) | ||
f = open('memory.dat', 'w') | ||
f.write(mem) | ||
f.close() | ||
|
||
client.close() | ||
|
||
if __name__ == '__main__': | ||
main() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.