GoobyCorp / Retron_5_Toolkit

A script to make unpacking and packing Retron 5 updates easier (or actually possible)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I am I doing it wrong?

amoore2600 opened this issue · comments

amoore@amoore-OptiPlex-7010:~$ /home/amoore/Downloads/RetroFreakROM.py -h Traceback (most recent call last): File "/home/amoore/Downloads/RetroFreakROM.py", line 108, in <module> main() File "/home/amoore/Downloads/RetroFreakROM.py", line 88, in main REQUEST_PUB_KEY = RSA.import_key(read_file(join("Keys", REQUEST_PUB_KEY_FILE))) File "/home/amoore/Downloads/RetroFreakROM.py", line 26, in read_file with open(filename, "rb") as f: FileNotFoundError: [Errno 2] No such file or directory: 'Keys/request.pub'

what do I need to do?

Sorry about that, put this next to the script

This is the wrong repo for this issue.

Sill does not work:

amoore@amoore-OptiPlex-7010:~/Downloads/RF-tools$ ./RetroFreakROM.py -o ~/test.rom -k /media/amoore/6538-3632/retrofreak-update-request.dat '/media/amoore/6538-3632/RetroFreak/Games/After_Burner_II.PCE'
Traceback (most recent call last):
File "./RetroFreakROM.py", line 108, in
main()
File "./RetroFreakROM.py", line 102, in main
write_file(args.o if args.o else args.ifile, decrypt_rom(dna, rom_data))
File "./RetroFreakROM.py", line 65, in decrypt_rom
cipher = AES.new(key, AES.MODE_CBC, iv)
File "/usr/lib/python3/dist-packages/Cryptodome/Cipher/AES.py", line 202, in new
return _create_cipher(sys.modules[name], key, mode, *args, **kwargs)
File "/usr/lib/python3/dist-packages/Cryptodome/Cipher/init.py", line 55, in _create_cipher
return modes[mode](factory, **kwargs)
File "/usr/lib/python3/dist-packages/Cryptodome/Cipher/_mode_cbc.py", line 232, in _create_cbc_cipher
cipher_state = factory._create_base_cipher(kwargs)
File "/usr/lib/python3/dist-packages/Cryptodome/Cipher/AES.py", line 89, in _create_base_cipher
expect_byte_string(key)
File "/usr/lib/python3/dist-packages/Cryptodome/Util/_raw_api.py", line 194, in expect_byte_string
raise TypeError("Only byte strings can be passed to C code")
TypeError: Only byte strings can be passed to C code

Which version of python 3 are you using?

amoore@amoore-OptiPlex-7010:$ python -V
Python 2.7.15+
amoore@amoore-OptiPlex-7010:
$ python
Python 2.7.15+ (default, Oct 7 2019, 17:39:04)
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

help("modules")

Please wait a moment while I gather a list of all available modules...

DEBUG:pip.utils:lzma module is not available
DEBUG:pip.vcs:Registered VCS backend: git
DEBUG:pip.vcs:Registered VCS backend: hg
DEBUG:pip.vcs:Registered VCS backend: svn
DEBUG:pip.vcs:Registered VCS backend: bzr
BaseHTTPServer asn1crypto htmlentitydefs sched
Bastion ast htmllib secretstorage
CDROM asynchat httplib select
CGIHTTPServer asyncore idna serial
Canvas atexit ihooks sets
ConfigParser atk imaplib setuptools
Cookie audiodev imghdr sgmllib
Crypto audioop imp sha
Cryptodome base64 importlib shelve
DLFCN bdb imputil shlex
Dialog binascii inspect shutil
DocXMLRPCServer binhex io signal
FileDialog bisect ipaddress signatures
FixTk bsddb itertools site
HTMLParser bz2 json sitecustomize
IN cPickle keyring six
MimeWriter cProfile keyrings smtpd
Queue cStringIO keyword smtplib
ScrolledText cairo ldb sndhdr
SimpleDialog calendar lib2to3 socket
SimpleHTTPServer certifi linecache spwd
SimpleXMLRPCServer cgi linuxaudiodev sqlite3
SocketServer cgitb locale sre
StringIO chardet lockfile sre_compile
TYPES chunk logging sre_constants
Tix cli lsb_release sre_parse
Tkconstants cmath macpath ssl
Tkdnd cmd macurl2path stat
Tkinter code mailbox statvfs
UserDict codecs mailcap string
UserList codeop markupbase stringold
UserString collections marshal stringprep
_LWPCookieJar colorama math strop
_MozillaCookieJar colorsys md5 struct
builtin command mhlib subprocess
future commands mimetools sunau
_abcoll compileall mimetypes sunaudio
_ast compiler mimify symbol
_backport contextlib mmap symtable
_bisect cookielib modulefinder sys
_bsddb copy multifile sysconfig
_cffi_backend copy_reg multiprocessing syslog
_codecs crypt mutex tabnanny
_codecs_cn cryptography netrc talloc
_codecs_hk csv new tarfile
_codecs_iso2022 ctypes nis tdb
_codecs_jp curses nntplib telnetlib
_codecs_kr datetime ntpath tempfile
_codecs_tw dbhash nturl2path termios
_collections dbm numbers test
_csv dbus opcode textwrap
_ctypes decimal operator this
_ctypes_test difflib optparse thread
_curses dircache os threading
_curses_panel dis os2emxpath time
_dbus_bindings distlib ossaudiodev timeit
_dbus_glib_bindings distutils packaging tkColorChooser
_elementtree doctest pango tkCommonDialog
_functools dsextras pangocairo tkFileDialog
_hashlib dumbdbm parser tkFont
_heapq dummy_thread pdb tkMessageBox
_hotshot dummy_threading pickle tkSimpleDialog
_io easy_install pickletools toaiff
_json email pip token
_ldb_text encodings pipes tokenize
_locale ensurepip pkg_resources tool
_lsprof enum pkgutil trace
_md5 errno platform traceback
_multibytecodec exceptions plistlib treeadapters
_multiprocessing extern popen2 treebuilders
_osx_support fcntl poplib treewalkers
_pyio filecmp posix ttk
_random fileinput posixfile tty
_sha filters posixpath turtle
_sha256 fnmatch pprint types
_sha512 formatter profile unicodedata
_socket fpformat progress unittest
_sqlite3 fractions pstats urllib
_sre ftplib pty urllib2
_ssl functools pwd urlparse
_strptime future_builtins py_compile user
_struct gc pyclbr uu
_symtable genericpath pydoc uuid
_sysconfigdata getopt pydoc_data warnings
_sysconfigdata_nd getpass pyexpat wave
_tdb_text gettext pygtk weakref
_testcapi gi pygtkcompat webbrowser
_threading_local gio quopri webencodings
_trie glib random wheel
_vendor glob re whichdb
_warnings gobject readline wsgiref
_weakref grp repr xdg
_weakrefset gtk resource xdrlib
abc gtkunixprint retrying xml
aifc gzip rexec xmllib
antigravity hashlib rfc822 xmlrpclib
anydbm heapq rlcompleter xxsubtype
appdirs hmac robotparser zipfile
argparse hotshot runpy zipimport
array html5lib samba zlib

Enter any module name to get more help. Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".

Sorry, gave you the wrong version of python
amoore@amoore-OptiPlex-7010:~$ which python3
/usr/bin/python3
amoore@amoore-OptiPlex-7010:~$ /usr/bin/python3 -V
Python 3.6.8
amoore@amoore-OptiPlex-7010:~$ /usr/bin/python3
Python 3.6.8 (default, Oct 7 2019, 12:59:55)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

help("modules")

Please wait a moment while I gather a list of all available modules...

AptUrl antigravity hpmudext rlcompleter
CommandNotFound apport html runpy
Crypto apport_python_hook http scanext
Cryptodome apt httplib2 sched
DistUpgrade apt_inst idna secrets
HweSupportStatus apt_pkg imaplib secretstorage
LanguageSelector aptdaemon imghdr select
NvidiaDetector aptsources imp selectors
PIL argparse importlib shelve
Quirks array inspect shlex
ScreenResolution asn1crypto io shutil
UbuntuDrivers ast ipaddress signal
UbuntuSystemService asynchat itertools simplejson
UpdateManager asyncio janitor site
future asyncore json sitecustomize
_ast atexit keyring six
_asyncio audioop keyword smtpd
_bisect base64 language_support_pkgs smtplib
_blake2 bdb launchpadlib sndhdr
_bootlocale binascii lib2to3 socket
_bz2 binhex linecache socketserver
_cffi_backend bisect locale softwareproperties
_codecs brlapi logging speechd
_codecs_cn builtins louis speechd_config
_codecs_hk bz2 lsb_release spwd
_codecs_iso2022 cProfile lzma sqlite3
_codecs_jp cairo macaroonbakery sre_compile
_codecs_kr calendar macpath sre_constants
_codecs_tw certifi macurl2path sre_parse
_collections cgi mailbox ssh_import_id
_collections_abc cgitb mailcap ssl
_compat_pickle chardet mako stat
_compression chunk markupsafe statistics
_crypt cmath marshal string
_csv cmd math stringprep
_ctypes code mimetypes struct
_ctypes_test codecs mmap subprocess
_curses codeop modulefinder sunau
_curses_panel collections multiprocessing symbol
_datetime colorsys nacl symtable
_dbm compileall netifaces sys
_dbus_bindings concurrent netrc sysconfig
_dbus_glib_bindings configparser nis syslog
_decimal contextlib nntplib systemd
_dummy_thread copy ntpath tabnanny
_elementtree copyreg nturl2path tarfile
_functools crypt numbers telnetlib
_gdbm cryptography oauth tempfile
_hashlib csv olefile termios
_heapq ctypes opcode test
_imp cups operator textwrap
_io cupsext optparse this
_json cupshelpers orca threading
_locale curses os time
_lsprof datetime ossaudiodev timeit
_lzma dateutil parser token
_markupbase dbm pathlib tokenize
_md5 dbus pcardext trace
_multibytecodec deb822 pdb traceback
_multiprocessing debconf pexpect tracemalloc
_opcode debian pickle tty
_operator debian_bundle pickletools turtle
_osx_support decimal pipes types
_pickle defer pkg_resources typing
_posixsubprocess difflib pkgutil ufw
_pydecimal dis platform unicodedata
_pyio distro_info plistlib unittest
_random distro_info_test poplib uno
_sha1 distutils posix unohelper
_sha256 doctest posixpath urllib
_sha3 dummy_threading pprint urllib3
_sha512 email problem_report usbcreator
_signal encodings profile uu
_sitebuiltins enum pstats uuid
_socket errno pty venv
_sqlite3 faulthandler ptyprocess wadllib
_sre fcntl pwd warnings
_ssl filecmp py_compile wave
_stat fileinput pyatspi weakref
_string fnmatch pyclbr webbrowser
_strptime formatter pydoc wsgiref
_struct fractions pydoc_data xdg
_symtable ftplib pyexpat xdrlib
_sysconfigdata_m_linux_x86_64-linux-gnu functools pygtkcompat xkit
_testbuffer gc pymacaroons xml
_testcapi genericpath pyrfc3339 xmlrpc
_testimportmultiple getopt pytz xxlimited
_testmultiphase getpass queue xxsubtype
_thread gettext quopri yaml
_threading_local gi random zipapp
_tracemalloc glob re zipfile
_warnings grp readline zipimport
_weakref gtweak reportlab zlib
_weakrefset gzip reprlib zope
_yaml hashlib requests
abc heapq requests_unixsocket
aifc hmac resource

Enter any module name to get more help. Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".

I've updated the script to be a bit more verbose, does it at least print your serial number?

From what I'm seeing it's having an issue with the key or the IV.

The new version of the script works!!

Nice Work!!! Can I share your github page?

Here is my testing from today: https://youtu.be/iBhwlWjU_yU

You're welcome to share it anywhere you'd like, just make sure to link me to the posts if you could be so kind.

I have a forms application that can do ROM's in bulk if you're interested in that too.

RetroFreak ROM Converter

You may want to add these to your tool kit. They allow for SRAM files to be decrypted/encrypted. https://github.com/amoore2600/rfdumper/tree/master/SRAM-Utilites These are not mine.

Do you have an SRAM file I can use for testing my script after I write it? Also, do you have a better way for me to contact you than an issue on github? Maybe email?

Here are 2 RF zip files, see attached.

Roms must be named to match.
SRAM.zip

This look right?
SMW

Yes, this is correct.

Checksum in the header matched, right?

Yes the checksum matched.
Should I add it to this?
converter