NAS: Support multiple Stage1 versions

This commit is contained in:
Palapeli 2026-01-04 01:14:19 -05:00
parent c6cae968fb
commit e6172fa941
No known key found for this signature in database
GPG Key ID: 1FFE8F556A474925

View File

@ -9,17 +9,21 @@ import (
"crypto/x509"
"encoding/hex"
"encoding/pem"
"github.com/logrusorgru/aurora/v3"
"net/http"
"net/url"
"os"
"strconv"
"wwfc/logging"
"github.com/logrusorgru/aurora/v3"
)
func downloadStage1(w http.ResponseWriter, stage1Ver int) {
// TODO: Actually use the stage 1 version
dat, err := os.ReadFile("payload/stage1.bin")
path := "payload/stage1.bin"
if stage1Ver != 0 {
path = "payload/stage1v" + strconv.Itoa(stage1Ver) + ".bin"
}
dat, err := os.ReadFile(path)
if err != nil {
panic(err)
}