Hacking how to compile red nand fw.img?

D

Deleted User

Guest
What if you set it up so that you put the script and the otp.bin file in the same folder it uses the otp.bin and then places the fw.img in the folder with the otp.bin and the script

Oh, yeah, that's a good idea! I'll just have the user put the otp.bin on the desktop (for ultimate simplicity), and have the keys be read from there.

you are right, script to download latest ghithub is better instead of providing a fixed release and having to update the VM manually.

I don't know linux, so I can't help you with the commands, but there are probably a way to ask input from the user.
Another way is like tunip3 said. You could ask the user to dump its OTP (it will be useful in the future anyway, why not doing it?).

So, step 1 : get your keys ! launch HBL OTP dumper, put otp.bin somewhere in your script's folder. a place where both Fix94 and Dimok branch (and maybe future branch) can use it at the same time.
step 2 : retrieve git repository
step 3 : when launching the compilation, copy the otp.bin from the "user's place" into the correct branch's folder so the user will not have to edit the .py file, right?
it's easier to make your script copy the bin to the correct folder, so the user always keep its single file at the same place, outside the git sources.

Now the only thing left to do is figure out how to read hex from a file and copy it into another file as text... sounds complicated.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
why read hex?
the python should already use OTP.bin automatically, no ?

maybe I'm mistaking it with the key file generated and cached for later use.
if you look at the recent changes, fix94 added a way to store the keys, I thought it used otp too, but I'm maybe wrong.

edit:
https://github.com/FIX94/iosuhax/commit/99388e9a8135ad5c183699cb319ea87f1108880f
this commit is "clean up OTP.bin read code", so it's reading it automatically, you don't need to extract hex from it.
the otp.bin should be on a parent folder, so it's read from fix or dimok's branch without copying it anywhere else.

and plus : You see how to do it for your own learning ;)
 

tunip3

[debugger active]
OP
Banned
Joined
Oct 31, 2016
Messages
1,675
Trophies
0
XP
1,661
Country
United Kingdom
If you added aa selection menu between fix 94s fw.img and dimoks rednand it would be next level but it would be perfect if the was also for windows
 
D

Deleted User

Guest
why read hex?
the python should already use OTP.bin automatically, no ?

Ah, I thought the otp.bin had the keys in hex, as in they could only be read in a hex editor.

maybe I'm mistaking it with the key file generated and cached for later use.
if you look at the recent changes, fix94 added a way to store the keys, I thought it used otp too, but I'm maybe wrong.

edit:
https://github.com/FIX94/iosuhax/commit/99388e9a8135ad5c183699cb319ea87f1108880f
this commit is "clean up OTP.bin read code", so it's reading it automatically, you don't need to extract hex from it.
the otp.bin should be on a parent folder, so it's read from fix or dimok's branch without copying it anywhere else.

and plus : You see how to do it for your own learning ;)

Great! That means less work for me ;)
But there's still the problem of dimok's compiler, isn't there...? Ah well, maybe I could just fork it, add FIX94's code, test it out, and push it to master...? That's how Github works, right?


If you added aa selection menu between fix 94s fw.img and dimoks rednand it would be next level but it would be perfect if the was also for windows

A selection menu should be fairly easy to do; heck, I can even do it on my calculator (just a few GOTO's here and there...) :)

I was thinking about making a batch file for Windows too, but it would be a bit more complicated as I don't know how to run GUI executables and install them without any user input. But when there's a will, there's a way!
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
Fix94 already harmonized both Fix94 and dimok branches to compile the exact same way :)
he made a thread for compilation help and made an effort to modified both his and dimok's sources at the same time so his tutorial work on both!

batch for windows is not as easy, as people need to install programs (python, pycrypto, devkit, armips, etc.) with proper environment variables
 
D

Deleted User

Guest
Fix94 already harmonized both Fix94 and dimok branches to compile the exact same way :)
he made a thread for compilation help and made an effort to modified both his and dimok's sources at the same time so his tutorial work on both!

Fantastic! I barely even have to do any work now! Except, you know, actually learning how to make scripts (probably about as difficult as making a Windows batch, though).

batch for windows is not as easy, as people need to install programs (python, pycrypto, devkit, armips, etc.) with proper environment variables

Yeah, that would be pretty difficult; looks like beggars can't be choosers, so to speak. I think PATH variables can be set via a command line, though, and couldn't a full build environment be downloaded to C:\ instead of having an installer do it? Python might be a bit more difficult, though.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
you can set environment variable temporarily in a command line window, but you will have to know where all the programs are installed.
if the user already installed python, it's best to not reinstall it, providing an already unpacked python is maybe not good either (I don't know if portable version works, but it's best to let the user install it).

Provide a way to run the VM easily, that's better I think.
 
D

Deleted User

Guest
you can set environment variable temporarily in a command line window, but you will have to know where all the programs are installed.
if the user already installed python, it's best to not reinstall it, providing an already unpacked python is maybe not good either (I don't know if portable version works, but it's best to let the user install it).

Provide a way to run the VM easily, that's better I think.

Alright, I suppose a VM would be better in the end; I don't want to brick any Wii U's. I might be able to check if Python is installed, though (but it would probably have to be by listing every file on the computer to check if Python is there, which would take a very long time).
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
Can't you verify if python is installed by launching it?
if it's correctly installed and set in the env variable you will have a python prompt, if you don't it's not correctly installed.
I don't know if a batch can detect this.

I tried this :
Code:
C:\Users\Cyan>python /?
python: can't open file '/?': [Errno 22] Invalid argument
it means it's installed, or else it would be "unknown command".

there's probably a better way to check, like "echo %PATH%" and check if you find python inside
I have python27 x86 and script folders in my %PATH%:
C:\Program Files (x86)\Python\Python27\;
C:\Program Files (x86)\Python\Python27\Scripts;

same with "devkitPro\msys\bin" inside %PATH%
and if you add armips.exe, be sure to set the path to that exe in %PATH% too.

then also check %DEVKITPRO% and %DEVKITARM%

And I' not sure, but I think Java is required sometime too !
C:\ProgramData\Oracle\Java\javapath;

Well, maybe a VM is easier, but I don't know if lot of users will use it.
most users probably prefer installing the programs themselves and trying to compile it on their own. that's why fix94 made a thread, but users still don't manage to install or run the commands correctly. They get python errors and don't know why.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Lol +1