-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pull in Windows Bootstrap Loader Python Package #249
base: master
Are you sure you want to change the base?
Conversation
Added setup.cfg entry points as well as skeleton application code.
Moved to createtiscript.py and also created new folder classes in the faraday folder.
Imported createtiscript.py as a module from the bootstrap loader application.
I can get to the end of creating TI scripts. This required some hard coding of file locations and moving some .txt files into /etc/faraday.
Removed file that is created everytime bootstrap loader is used. Then I added it to the .gitignore file so we won't accidentally add it later.
revamped a decent amount of .gitignore for all applications. Also updated filenames in bootstrap.py
importing faradyFTDI class now after moving it into the project.
First time completely working through load of firware with new packaged command. Still need to correct loading of files from setup.cfg. Also updated .gitignore to remove a filename error.
Also added sample INI file. This now completes obtaining most data from the package. Including a prior commit that added an EXE file (oh god...). A must for now. Still need to automate obtaining latest firmware file and starting to use the INI configuration to remove the hard-coding.
Boostrap.py now reads in the filename and com port from bsl.ini.
Most of the filenames needed are now pulled in from the configuration INI file.
Didn't want it to be test so I changed it to script.
Indicated required FTDI drivers.
The getMaster command option downloads the latest master firmware and places it in <user>/.faraday/firmware/master.txt
Updated bsl.sample.ini with all fields currently in use. Also started using downloaded firmware located in <user>/.faraday/firmware/master.txt
Now using --port to set the UART port in bsl.ini. Also, changed the ini file to match proxy terminology for ports in INI file.
Added a try/except for firmware master.txt opening.
Cleaned up commented out code, updated comments, and added a try/except statement for the FTDI drivers.
Removed commented out code, commented where appropriate, and generally cleaned up the file. Also added docstrings.
Quick docstring fix on createtiscript.py and a big commenting/cleanup of faradayFTDI.py. Ideally there were no functional changes in this commit.
Passes pytest after these commits.
Try and excepts now work better and the package is cleaned up from a command line and config operational flow.
It won't work for me (com port setup earlier): Brent@Brent-surface MINGW64 ~/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software (bsl)
$ faraday-bsl --getmaster --start
2017-07-20 01:03:23,871 - BSL - INFO - Downloading latest Master firmware...
2017-07-20 01:03:24,503 - BSL - INFO - Download complete
2017-07-20 01:03:24,503 - BSL - INFO - Starting Faraday Bootstrap Loader application
---------------------------------------------------------
BSL Scripter 3.1.0.0
PC software for BSL programming
2017-Jul-20 01:03:30
---------------------------------------------------------
Input file script is : C:/Users/Brent/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software/etc/faraday/faradayFirmwareUpgradeScript.txt
MODE 6xx UART 9600 com112 PARITY
CHANGE_BAUD_RATE 115200
BSL ACK is received.
VERBOSE
RX_PASSWORD pass32_wrong.txt
Brent@Brent-surface MINGW64 ~/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software (bsl)
|
Is there any other info? What you posted doesn't tell me much unless I'm missing something. |
Yeah @kb1lqd we will need to figure out what you're doing. I uninstalled all Faraday software from my computer and cleaned out config/file directories followed by installing with a wheel file (same as installing from PyPI). Bootstrap loading worked for me fine. I did notice that I still had some issues with having to run it from the github directory but that is not the issue you seem to be having. In order for this to move forward I need more info from you on what isn't working. |
@kb1lqc Below is a BSL test from a clean install: Brent@Brent-surface MINGW64 ~/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software (bsl)
$ ls
Applications/ etc/ LICENSE.md setup.cfg
CONTRIBUTING.md faraday/ Proxy/ setup.py*
Debug/ faraday.egg-info/ README Tutorials/
Device_Test/ Firmware_Bootstrap_Loader/ README.md
docs/ images/ requirements.txt
Brent@Brent-surface MINGW64 ~/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software (bsl)
$ faraday-bsl --init-config
2017-07-20 08:55:48,802 - BSL - INFO - Initializing BSL
2017-07-20 08:55:48,818 - BSL - INFO - Initialization complete
Brent@Brent-surface MINGW64 ~/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software (bsl)
$ faraday-bsl --help
usage: faraday-bsl [-h] [--init-config] [--start] [--getmaster] [--port PORT]
BSL will Boostrap load firmware onto Faraday via USB connection. Requires
http://www.ftdichip.com/Drivers/D2XX.htm
optional arguments:
-h, --help show this help message and exit
--init-config Initialize BSL configuration file
--start Start Boostrap loader
--getmaster Download newest firmware from master firmware repository
--port PORT Set UART port to bootstrap load firmware
Brent@Brent-surface MINGW64 ~/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software (bsl)
$ faraday-bsl --port COM21 --getmaster
2017-07-20 08:56:18,016 - BSL - INFO - Downloading latest Master firmware...
2017-07-20 08:56:18,737 - BSL - INFO - Download complete
2017-07-20 08:56:18,737 - BSL - WARNING - --start option not present, exiting BSL server!
Brent@Brent-surface MINGW64 ~/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software (bsl)
$ faraday-bsl --start
2017-07-20 08:56:31,440 - BSL - INFO - Starting Faraday Bootstrap Loader application
---------------------------------------------------------
BSL Scripter 3.1.0.0
PC software for BSL programming
2017-Jul-20 08:56:37
---------------------------------------------------------
Input file script is : C:/Users/Brent/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software/etc/faraday/faradayFirmwareUpgradeScript.txt
MODE 6xx UART 9600 COM21 PARITY
CHANGE_BAUD_RATE 115200
BSL ACK is received.
VERBOSE
RX_PASSWORD pass32_wrong.txt
Brent@Brent-surface MINGW64 ~/Documents/Faraday_GIthub_Software/Pull_Request_Reviews/firmwareinstall/Faraday-Software (bsl) |
Strange @kb1lqd I tried this on my Microsoft Surface Pro 4 and it worked fine. Can you try installing from a fresh git? Have you rebooted your computer and tried? |
Oh snap the problem maybe that my |
This PR creates a
faraday-bsl
program which pulls in a lot of @kb1lqd code used to bootstrap load the FaradayRF hardware. This ONLY works in windows and please be sure to have the FTDI drivers installed (http://www.ftdichip.com/Drivers/D2XX.htm). This whole operation isn't ideal but it's what works for the time being.Changes
faraday-bsl
packagefaraday-help
menu to indicate possible command line operations--getmaster
operation, saves to /.faraday/firmware/master.txt--port PORT
using USB cableOperation
After configuring the config files, updating the master firmware from the internet, it's as simple as...
@el-iso @reillyeon @jbemenheiser