Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

No-node version? #20

Open
clbr opened this issue Sep 29, 2021 · 4 comments
Open

No-node version? #20

clbr opened this issue Sep 29, 2021 · 4 comments

Comments

@clbr
Copy link

clbr commented Sep 29, 2021

Do you know if anybody's made a version that runs without node.js? Running on any http server would make it easier to self-host.

Specifically, I'm looking to use caffeine on a local temporary wlan with no internet access.

I checked all the forks and googled, but didn't find anything.

@noahc3
Copy link
Owner

noahc3 commented Sep 29, 2021

It's been something I've wanted to do for a long time but I can't find time to do it.

It's been done before for other PegaSwitch exploits, namely nx-hbexploit300 for the original 3.0.0 homebrew entrypoint. In theory it shouldn't be too hard to mimic, just load all the scripts statically client-side rather than pass them over a websocket. But unfortunately I don't have time right now.

@clbr
Copy link
Author

clbr commented Sep 30, 2021

Managed to get a minimal version running. The most painful part was, unsurprisingly, node.js :P
I used an Ubuntu 18.04 VM to get node, browserify and the bundle generated, but hit lots of snags with the version of node in the repo.

My steps:

  • copy caffeine, minmain and gadgetcache for my switch, named appropriately
  • add a local str2ab function to caffeine.js since it can't access utils
  • edit bundle.js to load caffeine.js right before setupListener(sc), using the same approach as in loadRun in minmain.js

index.html

<html><head><title>Hello Cafe</title></head>
<body>

Hello Cafe

<script src="minmain.js"></script>
<script>
window.showAlbumMessage = function showAlbumMessage() {
}
window.showExitMessage = function showExitMessage() {
}

window.minmain();
</script>

</body></html>

With this, I have caffeine working on a 2.3.0 switch. Using busybox httpd, so no websocket support etc. I used busybox dnsd to get the captive portal popup (direct conntest.nintendowifi.net to your IP) - I read that fake news can be detected, so wanted the safer option just in case I ever go online on the pristine main nand.

@devingDev
Copy link

Managed to get a minimal version running. The most painful part was, unsurprisingly, node.js :P I used an Ubuntu 18.04 VM to get node, browserify and the bundle generated, but hit lots of snags with the version of node in the repo.

My steps:

  • copy caffeine, minmain and gadgetcache for my switch, named appropriately
  • add a local str2ab function to caffeine.js since it can't access utils
  • edit bundle.js to load caffeine.js right before setupListener(sc), using the same approach as in loadRun in minmain.js

index.html

<html><head><title>Hello Cafe</title></head>
<body>

Hello Cafe

<script src="minmain.js"></script>
<script>
window.showAlbumMessage = function showAlbumMessage() {
}
window.showExitMessage = function showExitMessage() {
}

window.minmain();
</script>

</body></html>

With this, I have caffeine working on a 2.3.0 switch. Using busybox httpd, so no websocket support etc. I used busybox dnsd to get the captive portal popup (direct conntest.nintendowifi.net to your IP) - I read that fake news can be detected, so wanted the safer option just in case I ever go online on the pristine main nand.

is there a way to run this on a ESP8266?
For a switch on 4.1.0 using Caffeine (since RCM payload injection isn't working on this device)

Could you release this as a repo?

@clbr
Copy link
Author

clbr commented Aug 29, 2022

No, what I did won't work on an esp8266 directly. Probably possible to port it with some effort, if someone with such hw does the work. My steps are for a Linux host, so a RPi could work.

Repo - sorry, not interested.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants