Skip to content

Commit

Permalink
Version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Flumpster committed Dec 17, 2018
1 parent 7651646 commit 3053a5f
Show file tree
Hide file tree
Showing 12 changed files with 1,450 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode/
__pycache__/
dist/
build/
app.spec
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
fusee-interfacee-tk
![A cute rocket in outerspace!](icon.png)
# Fusée Launcher Interfacée (Nintendo Homebrew Version)
A very simple GUI for applying [Team {Re}Switched Fusée Launcher script](https://github.com/reswitched/fusee-launcher) onto your Nintendo Switch.


## Disclaimer
* As always, use at your own discretion. I take no reponsibility for any damages caused to your device.
* I'm assuming you understand how the exploit is done and the setup needed, this README is to help you run this specific app.
* Although Fusée is able to exploit any Tegra X1 device, this app is designed to work with Nintendo Switches only.
* The Fusée Launcher script included in this project is slightly modified to be used as a module.
* Binaries built and tested on Ubuntu 17.10 and Windows 10 in a 64 bit machine. If your platform is older you probably won't be able to run the executables.


## Running this app
You can run this app as a simple python script or by executing the binary file for your platform.

### Running as a script
* Have latest [python 3](https://www.python.org/downloads/) and [pyusb](https://github.com/pyusb/pyusb) installed.
* __On Windows__ have [libusbk](http://libusbk.sourceforge.net/UsbK3/index.html) as the device driver.
* __On Linux__ have libusb1 installed (you probably already have).
* Download/clone this repo and simply run `app.py` like you would any python script.


### Running the binary file
### Linux
* You need to have `libc ver. 2.61` or higher (if you use a modern distro you probably already have).
* Download the linux binary from the [releases page](https://github.com/falquinho/fusee-interfacee-tk/releases) and run it. It *should* simply work.

### Windows
* Download the Windows binary from the [releases page](https://github.com/falquinho/fusee-interfacee-tk/releases) and run it. It *should* simply work.

## Using Fusée Launcher Interfacée
The app is very simple, it should be very intuitive to use:

![App looking for a device.](https://image.ibb.co/n1CEv8/fusee_interfacee_ss0.png) ![App found a device and is ready!](https://image.ibb.co/ep6ra8/fusee_interfacee_ss1.png)
* Click the `Select Payload` button to browse your files and select the desired payload.
* Connect your Switch in RCM mode to the computer. The progress bar will stop and fill up when the device is detected.
* When the `Launch Fusée!` button activate simply click it.


## Freezing
If the binary executable won't run in your machine you can build it yourself. The tool I used was [pyinstaller](https://www.pyinstaller.org/).

### A note on freezing on Linux:
If you want to freeze using `pyinstaller` on linux there's a bug on the pip version of it that prevents the `libusb` to
be bundled. You need to donwload [the develop branch of pyinstaller](https://github.com/pyinstaller/pyinstaller/tree/develop) and use it as a script.

## Special Thanks
### To the Team {Re}Switched and contributors. You are awesome. Thanks for your hard work.
130 changes: 130 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import sys
import os
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.filedialog import askopenfilename
import fusee_launcher as fusee
import mock_arguments



class App(tk.Frame):

def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.grid()
self.build_widgets()

self.payload_path = ''
self.device_found = False
self.lbl_length = 22
self.usb_backend = fusee.HaxBackend.create_appropriate_backend()

root = self.winfo_toplevel()
root.update()
root.resizable(0, 0)

self.do_update()



def build_widgets(self):
style = ttk.Style()
style.configure('Horizontal.TProgressbar', background='#5eba21')
self.progress = ttk.Progressbar(self, mode='indeterminate', maximum=50)
self.progress.grid(row=0, columnspan=2, sticky=tk.W+tk.E)
self.progress.start(30)

self.lbl_look = ttk.Label(self, text="Looking for Device...")
self.lbl_look.grid(row=1, column=0, columnspan=2, pady=8)

self.btn_open = ttk.Button(self, text="Select Payload", command=self.btn_open_pressed)
self.btn_open.grid(row=2, column=0, padx=8)

self.lbl_file = ttk.Label(self, text="No Payload Selected. ", justify=tk.LEFT)
self.lbl_file.grid(row=2, column=1, padx=8)

self.btn_send = ttk.Button(self, text="Send Payload!", command=self.btn_send_pressed)
self.btn_send.grid(row=3, column=0, columnspan=2, sticky=tk.W+tk.E, pady=8, padx=8)
self.btn_send.state(('disabled',)) # trailing comma to define single element tuple

self.btn_mountusb = ttk.Button(self, text="Mount SD on PC", command=self.btn_mountusb_pressed)
self.btn_mountusb.grid(row=4, column=0, columnspan=2, sticky=tk.W+tk.E, pady=8, padx=8)
self.btn_mountusb.state(('disabled',)) # trailing comma to define single element tuple


def do_update(self):
device = self.usb_backend.find_device(0x0955, 0x7321)
if device and not self.device_found:
self.device_found = True
self.lbl_look.configure(text='Device found!')
self.progress.stop()
self.progress.configure(mode='determinate', maximum=1000)
self.progress.step(999)

elif not device and self.device_found:
self.device_found = False
self.lbl_look.configure(text='Looking for device...')
self.progress.configure(mode='indeterminate', maximum=50)
self.progress.start(30)

self.validate_form()
self.after(333, self.do_update)



def btn_open_pressed(self):
path = askopenfilename(filetypes=[('Binary', '*.bin')], title='Select Payload')
if path:
excess = len(path)-self.lbl_length
self.payload_path = path
self.lbl_file.configure(text='..'+path[max(0, excess):])

self.validate_form()



def btn_send_pressed(self):
args = mock_arguments.MockArguments()
args.payload = self.payload_path
args.relocator = self.build_relocator_path()
fusee.do_hax(args)


def btn_mountusb_pressed(self):
args = mock_arguments.MockArguments()
args.payload = self.build_mountusb_path()
args.relocator = self.build_relocator_path()
fusee.do_hax(args)


def validate_form(self):
if self.payload_path and self.device_found:
self.btn_send.state(('!disabled',))
self.btn_mountusb.state(('!disabled',))
elif self.device_found:
self.btn_mountusb.state(('!disabled',))
else:
self.btn_send.state(('disabled',))
self.btn_mountusb.state(('disabled',))


def build_mountusb_path(self):
try:
path = sys._MEIPASS
except Exception:
path = os.path.abspath('.')

return os.path.join(path, 'memloader.bin')

def build_relocator_path(self):
try:
path = sys._MEIPASS
except Exception:
path = os.path.abspath('.')

return os.path.join(path, 'intermezzo.bin')

my_app = App()
my_app.master.title('Payload Injector')
my_app.mainloop()
Loading

0 comments on commit 3053a5f

Please sign in to comment.