Hacking R4Toolz Suite

  • Thread starter Thread starter Blazikun
  • Start date Start date
  • Views Views 5,296
  • Replies Replies 13

Blazikun

Well-Known Member
Member
Joined
Apr 12, 2010
Messages
277
Reaction score
0
Trophies
0
Location
51n30, 0w10
Website
Visit site
XP
98
Country
R4Toolz Suite​

Rel 2.0b Dev 4​

R4Toolz is a tools suite for R4 Users, featuring Decrypt/Encrypt Firmware and Cheats (Thanks, Maxconsole), Convert SAVs between WoodR4 and R4, and a full launchable firmware maker, so you can launch WoodR4/YSMenu through Filebrowser! All in one fully-featured BAT.

Code:
Change log (v1.5):

-Added SAV Conversion
-Added launchable firmware device maker
Sources included in download.
Closed source BAT
Copyrighted CHISHM for R4Crypt.exe

Open Spoiler for Download Links
Latest Ver. Ver2.0b Dev3
11155-cmd.png


CREDITS
Credits Section Added:

R4Crypt Chishm
Basic DC/EC Code MaxConsole
Launchable FW hint GBATemp Forum Thread
SAV "Conversion" Pyrosurfer

DISCLAIMER
Disclaimer.
This is NOT a modified version of r4crypt repackaged. It is the original r4Crypt with credits to Chishm on it. The BAT file is the R4Toolz suite. The r4Crypt file is for the DC/EC and L.F/W functions only, and may be put to more use. Credits are in the spoiler above for contributions to the BAT File.

r4crypt is copyright Chishm, whereas the "r4crypt.bat" file, otherwise known as R4TOOLZ is property of Pyrosurfer. files and sources are closed source (r4toolz/r4crypt.bat) and Copyright Chishm respectively. (r4crypt.exe and sources)
 
I think he really wants to get credit for making a .bat file (whereas I would like to have someone else make my ysmenu generator because its probably a mess xD). In any case, I have never felt the need to use any generators for anything (because "I am not a nub" and I have searching abilities apparently), but I'm sure that one day, there will be one program per flashcart that will instantly update everything as you want it and then all forum talk will cease to exist in the flashcart categories. Then people will label GBATemp as a "Once great, but now dead" forum, causing the forums to lose tons of members until finally, everyone relinquishes it altogether and GBATemp becomes no more. So in order to prevent that, help nubs by forcing them to search, and don't give them some cheap easy way out because its obvious that what we all want is for nubs to learn exactly what it is that they are doing, teach it to others, and better the knowledge of the nds community rather than give the option for perpetual nubs that we can get annoyed at and may one day murder.

If anything, I think Pyrosurfer should start from scratch rather than base it off of another's work because because all things are more fun when do something all by yourself.
 
TrolleyDave said:
This is just a modified version of r4crypt isn't it? And it doesn't have a save convert option.

edit : Ignore the last part, download 1.0 instead of 1.5.

edit2 : Just noticed your other topic, this is just a modified version of r4crypt. It's a bit out of order that you haven't mentioned that it's simply a modified version of r4crypt, and very wrong that you've slapped your own name on it without giving credit to the original.
no it isnt modded, TrolleyDave, and i have given credit to MaxConsole in my top post for it. It isn't a modified version, it's a bat file, and i've given credit for it. also, do download 1.5. it has a launchable firmware maker and a save "renamer-converter". implementing more things soon, though

also: to jurassicplayer - it's not based on. It's the original chishm r4crypt with a bat file i made.

edit2: @trolleydave - thanks. i just noticed it was pointing to the wrong file!
 
I think TrolleyDave's point is your .bat is still based off someone else's with minimal changes.


However, your additions seem to be a good idea, though not well implemented.

This will work unreliably:
Code:
:savconvea
msg * This will permanently convert your R4 SAVs to WOODR4 SAVs! Click X to exit NOW if undesirable!
pause
rename *.sav *.nds.sav
Since it will catch -all- ".sav" files including previously converted ".nds.sav" and make them ".nds.nds.sav".

This will NOT work:
Code:
:savconvt
msg * This will permanently convert your WOODR4 SAVs to R4 SAVs! Click X to exit NOW if undesirable!
pause
rename *.nds.sav *.sav
DOS/Windows Shell treats the last '.' as the file extension.
So for example, while "*.nds.sav" will find "New Mario Bros. (U).nds.sav", it will rename ".sav" to ".sav".

It's not too hard to get those right, just read up on 'for /f ... in ... do'.

Here are some examples of 'for /f ... in ... do' that I have used for backing up:
Archive Images in Year-Month format (from Filename)
Code:
@echo off
md monthly
for /f "tokens=1-7 delims=/-[] " %%i in ('dir/b *.png') do C:\Progra~1\WinRAR\rar.exe a monthly\%%i-%%j.rar "[%%i-%%j-%%k] %%l %%m %%n %%o"
@echo.
@echo.
@echo Files archived by month.
pause

Simple Game Save Backup in Folder
Code:
@echo off
for /f "tokens=1-6 delims=/: " %%i in ('echo %%DATE%% %%TIME%%') do md "save\%%l-%%j-%%k %%m.%%n" && copy "save\*.*" "save\%%l-%%j-%%k %%m.%%n"
@echo.
@echo.
@echo Eastern Sun Save folder has been backed up.
pause

Game Save Backup in RAR Archive
Code:
@echo off
md save\backup
for /f "tokens=1-6 delims=/: " %%i in ('echo %%DATE%% %%TIME%%') do C:\Progra~1\WinRAR\rar.exe a save\backup\%%l-%%j-%%k_%%m.%%n.rar save\*.*
@echo.
@echo.
@echo Eastern Sun Save folder has been backed up.
pause
And here is the code I used to remove the extension from the Moonshell2 Skin Packer:
Code:
set /p skin=Enter the name of the skin: 
set skin=%skin:.skn=%
skins\makeskin.exe "%skin%.skn" "%skin%"
It replaces ".skn" with ""

Despite what you may think... I'm not trying to start problems with you.
I just have zero tolerance for people who steal code and call it their own and will not hesitate to call people out on it.
 
twiztidsinz said:
I think TrolleyDave's point is your .bat is still based off someone else's with minimal changes.


However, your additions seem to be a good idea, though not well implemented.

This will work unreliably:
Code:
:savconvea
msg * This will permanently convert your R4 SAVs to WOODR4 SAVs! Click X to exit NOW if undesirable!
pause
rename *.sav *.nds.sav
Since it will catch -all- ".sav" files including previously converted ".nds.sav" and make them ".nds.nds.sav".

This will NOT work:
Code:
:savconvt
msg * This will permanently convert your WOODR4 SAVs to R4 SAVs! Click X to exit NOW if undesirable!
pause
rename *.nds.sav *.sav
DOS/Windows Shell treats the last '.' as the file extension.
So for example, while "*.nds.sav" will find "New Mario Bros. (U).nds.sav", it will rename ".sav" to ".sav".

It's not too hard to get those right, just read up on 'for /f ... in ... do'.

Here are some examples of 'for /f ... in ... do' that I have used for backing up:
Archive Images in Year-Month format (from Filename)
Code:
@echo off
md monthly
for /f "tokens=1-7 delims=/-[] " %%i in ('dir/b *.png') do C:\Progra~1\WinRAR\rar.exe a monthly\%%i-%%j.rar "[%%i-%%j-%%k] %%l %%m %%n %%o"
@echo.
@echo.
@echo Files archived by month.
pause

Simple Game Save Backup in Folder
Code:
@echo off
for /f "tokens=1-6 delims=/: " %%i in ('echo %%DATE%% %%TIME%%') do md "save\%%l-%%j-%%k %%m.%%n" && copy "save\*.*" "save\%%l-%%j-%%k %%m.%%n"
@echo.
@echo.
@echo Eastern Sun Save folder has been backed up.
pause

Game Save Backup in RAR Archive
Code:
@echo off
md save\backup
for /f "tokens=1-6 delims=/: " %%i in ('echo %%DATE%% %%TIME%%') do C:\Progra~1\WinRAR\rar.exe a save\backup\%%l-%%j-%%k_%%m.%%n.rar save\*.*
@echo.
@echo.
@echo Eastern Sun Save folder has been backed up.
pause
And here is the code I used to remove the extension from the Moonshell2 Skin Packer:
Code:
set /p skin=Enter the name of the skin: 
set skin=%skin:.skn=%
skins\makeskin.exe "%skin%.skn" "%skin%"
It replaces ".skn" with ""

Despite what you may think... I'm not trying to start problems with you.
I just have zero tolerance for people who steal code and call it their own and will not hesitate to call people out on it.

thanks, twizt. i will clean it up soon. version 3 is coming out, and i think i might build a program for it

edit: the .nds.sav to .sav doesnt work, as labelled in the bat. I will fix this. do you know how to rename .nds.sav to .sav without it ignoring the .nds part?
 
This should work... I've tested it and it worked on my saves, however there is two small problems:
1). It drops the "!" in files, so that any file with "!" in their names fail.
2). It's "dumb". There's no check to skip files not of the proper type, but they'll just fail and it will continue.
1). Replace :savconvea and :savconvt with the code below.
2). Direct 1 and 2 to :savconvert
3). Might want to change the second menu's %input% variable to something like "%savopt%"

Code:
:savconvert
msg * This will permanently convert your R4 SAVs to WOODR4 SAVs! Click X to exit NOW if undesirable!
setLocal EnableDelayedExpansion
for /f "tokens=* delims=:" %%i in ('dir/b *.sav') do (
set filename=%%i
set filename=!filename:.sav=!
set filename=!filename:.nds=!
IF %input%="1" rename "!filename!.sav" "!filename!.nds.sav"
IF %input%="2" rename "!filename!.nds.sav" "!filename!.sav"
)
SETLOCAL DisableExtensions
Quick breakdown of what it does
Line 1: Your line to escape renaming operation
Line 2: Enables variables to be refreshed on each iteration of the code.
Line 3: Run the code for all files ending with ".sav", including ".nds.sav".
Line 4: Convert filename to variable.
Line 5: Strip ".sav" from the variable.
Line 6: Strip ".nds" from the variable.
Line 7: Rename ".sav" to ".nds.sav" (R4 -> Wood)
Line 8: Rename ".nds.sav" to ".sav" (Wood -> R4)
Line 9: Closing operations from Line 3
Line 10: Disabled variables from being refreshed on each iteration (default).
 
twiztidsinz said:
This should work... I've tested it and it worked on my saves, however there is two small problems:
1). It drops the "!" in files, so that any file with "!" in their names fail.
2). It's "dumb". There's no check to skip files not of the proper type, but they'll just fail and it will continue.
1). Replace :savconvea and :savconvt with the code below.
2). Direct 1 and 2 to :savconvert
3). Might want to change the second menu's %input% variable to something like "%savopt%"

Code:
:savconvert
msg * This will permanently convert your R4 SAVs to WOODR4 SAVs! Click X to exit NOW if undesirable!
setLocal EnableDelayedExpansion
for /f "tokens=* delims=:" %%i in ('dir/b *.sav') do (
set filename=%%i
set filename=!filename:.sav=!
set filename=!filename:.nds=!
IF %input%="1" rename "!filename!.sav" "!filename!.nds.sav"
IF %input%="2" rename "!filename!.nds.sav" "!filename!.sav"
)
SETLOCAL DisableExtensions
Quick breakdown of what it does
Line 1: Your line to escape renaming operation
Line 2: Enables variables to be refreshed on each iteration of the code.
Line 3: Run the code for all files ending with ".sav", including ".nds.sav".
Line 4: Convert filename to variable.
Line 5: Strip ".sav" from the variable.
Line 6: Strip ".nds" from the variable.
Line 7: Rename ".sav" to ".nds.sav" (R4 -> Wood)
Line 8: Rename ".nds.sav" to ".sav" (Wood -> R4)
Line 9: Closing operations from Line 3
Line 10: Disabled variables from being refreshed on each iteration (default).

thanks, twizt. it's made my code a lot cleaner. i'm working on a few things ; should be done v2 by next week!
 
pyrosurfer said:
Sources included in download.
Closed source BAT

Isn't that completely contradictory? Anyway, how can you have a closed source bat? They are by definition open source. BTW, no i haven't downloaded it (but will do in a minute), so maybe I'm missing something here.

EDIT: OK I downloaded it, don't see how its closed source in anyway, I'm looking at source right now. Also realised when you said "Sources included" you meant r4crypt sources. I have a question about this part:

CODE:lnchfwmk
msg * remember to copy the DAT Firmware folder on your SD First!
pause
r4crypt.exe -d _DS_MENU.DAT FIRMWARE.LFK
rename *.lfk *.fwd
rename *.fwd *.nds

Why name it FIRMWARE.LFK, then rename it from lfk to fwd then rename it from fwd to nds? Why not just name it FIRMWARE.nds it begin with? If you're only renaming it, the file is identical after the two renames as it was to begin with, only with a different name.
 
SifJar said:
pyrosurfer said:
Sources included in download.
Closed source BAT

Isn't that completely contradictory? Anyway, how can you have a closed source bat? They are by definition open source. BTW, no i haven't downloaded it (but will do in a minute), so maybe I'm missing something here.

EDIT: OK I downloaded it, don't see how its closed source in anyway, I'm looking at source right now. Also realised when you said "Sources included" you meant r4crypt sources. I have a question about this part:

CODE:lnchfwmk
msg * remember to copy the DAT Firmware folder on your SD First!
pause
r4crypt.exe -d _DS_MENU.DAT FIRMWARE.LFK
rename *.lfk *.fwd
rename *.fwd *.nds

Why name it FIRMWARE.LFK, then rename it from lfk to fwd then rename it from fwd to nds? Why not just name it FIRMWARE.nds it begin with? If you're only renaming it, the file is identical after the two renames as it was to begin with, only with a different name.

meh... i got bored. that code is being trimmed from the next version
mellow.gif
 
Seems pointless to me

I've had a batch file on filetrip for ages, which will rename *.nds.sav to *.sav, *.sav to *.sav.nds (it will not rename *.nds.sav to *.nds.nds.sav), *.SAV to *.sav and it performs this in all subdirectories too. It also will backup all the saves to My Documents\DS-Saves\[date]\[time]

http://filetrip.net/file.php?id=10322

twiztidsinz may as well write the thing himself.
 
It's strange, but this batch file looks almost identical to triassic911's post which has been sticked at the to of this forum http://gbatemp.net/t164359-guide-to-instal...smenu-on-the-r4

triassic911 said:
14. Open notepad and copy & paste this:
@echo off
cls
:menu
echo ---------------------
echo Action Menu
echo ---------------------
echo [1] Decrypt Firmware
echo [2] Encrypt Firmware
echo [3] Decrypt Cheats
echo [4] Encrypt Cheats
echo [5] Close
echo ---------------------
echo.
set INPUT=
Set /P INPUT= Action:


if "%input%" =="" goto menu
if "%input%" =="1" goto decryptf
if "%input%" =="2" goto encryptf
if "%input%" =="3" goto decryptc
if "%input%" =="4" goto encryptc
if "%input%" =="5" goto close

:decryptf
r4crypt.exe -d _DS_MENU.DAT OUTPUT.DAT
goto close

:encryptf
r4crypt.exe -e YSMenu.nds _DS_MENU.DAT
goto close


:decryptc
r4crypt.exe -d CHEAT.DAT USRCHEAT.DAT
goto close

:encryptc
r4crypt.exe -e USRCHEAT.DAT CHEAT.DAT
goto close

:close
cls

Compare that to the batch linked to in this thread and you'll see what I mean.

QUOTE@echo off
cls
:menu
echo ========================================
echo R4Toolz Suite v1.5 :-Menu
echo ========================================
echo [1] Decrypt Firmware DAT
echo [2] Encrypt Firmware DAT
echo [3] Decrypt Cheats DAT
echo [4] Encrypt Cheats DAT
echo [5] Enter SAV Tools Sub-Menu
echo [6] Launchable Firmware Maker Sub-Menu
echo [7] Credits and Instructions
echo [8] Exit
echo ========================================
echo.
set INPUT=
Set /P INPUT= Action:


if "%input%" =="" goto menu
if "%input%" =="1" goto decrypsd
if "%input%" =="2" goto encrypsd
if "%input%" =="3" goto decrypsd
if "%input%" =="4" goto encrypsd
if "%input%" =="5" goto savconvl
if "%input%" =="6" goto lnchfwmk
if "%input%" =="7" goto credinstr
if "%input%" =="8" goto close



:decrypsd
r4crypt.exe -d _DS_MENU.DAT OUTPUT.DAT
goto close

:encrypsd
r4crypt.exe -e OUTPUT.DAT _DS_MENU.DAT
goto close

:decrypsd
r4crypt.exe -d CHEAT.DAT USRCHEAT.DAT
goto close

:encrypsd
r4crypt.exe -e USRCHEAT.DAT CHEAT.DAT
goto close

:savconvl
cls
echo =================================
echo R4Toolz Suite v1.5 :-SAV Tool
echo =================================
echo [1] Convert R4 SAV to WoodR4 SAV
echo [2] Convert WoodR4 SAV to R4 SAV
echo -Does not work yet.
echo [3] Back to main menu
echo [4] Exit
echo =================================
echo.
set INPUT=
Set /P INPUT= Action:


if "%input%" =="" goto menu
if "%input%" =="1" goto savconvea
if "%input%" =="2" goto savconvt
if "%input%" =="3" goto menu
if "%input%" =="4" goto close

close


:savconvea
msg * This will permanently convert your R4 SAVs to WOODR4 SAVs! Click X to exit NOW if undesirable!
pause
rename *.sav *.nds.sav
goto close

:savconvt
msg * This will permanently convert your WOODR4 SAVs to R4 SAVs! Click X to exit NOW if undesirable!
pause
rename *.sav *.mirc
rename *.mirc *.sav

goto close

:lnchfwmk
cls
echo =======================================
echo R4Toolz Suite v1.5 :-F/W Maker
echo =======================================
echo [1] Convert _DS_MENU.DAT into NDS File
echo [2] Convert NDS F/W into _DS_MENU.DAT
echo [3] Back to main menu
echo [4] Exit
echo =======================================
echo.
set INPUT=
Set /P INPUT= Action:


if "%input%" =="1" goto lnchfwmkdat
if "%input%" =="2" goto lnchfwmknds
if "%input%" =="3" goto menu
if "%input%" =="4" goto close

close

:lnchfwmkdat
msg * remember to copy the DAT Firmware folder on your SD/TF First!
pause
r4crypt.exe -d _DS_MENU.DAT FIRMWARE.NDS
goto close

:lnchfwmknds
msg * remember to copy the DAT Firmware folder on your SD/TF First!
pause
r4crypt.exe -e FIRMWARE.NDS _DS_MENU.DAT
goto close

:credinstr
cls
echo ========================================
echo R4Toolz Suite v1.5 :-Credits
echo ========================================
echo R4Crypt Chishm
echo Basic DC/EC Code MaxConsole
echo Launchable FW Pyrosurfer
echo Launchable FW Hint GBATemp
echo SAV Conversion Pyrosurfer
echo ========================================
echo -= INSTRUCTIONS =-
echo Instructions can be found in the same
echo directory as "r4toolz.bat"
echo ========================================
echo -= OFFICIAL URL =-
echo http://gbatemp.net/t225760-r4toolz-suite
echo http://bit.ly/d6AWkJ
echo ========================================
echo Press [1] to go back to the main menu
echo Press [2] to close R4Toolz
echo.
set INPUT=
Set /P INPUT= Action:


if "%input%" =="1" goto menu
if "%input%" =="1" goto close




:close
cls
 

Site & Scene News

Popular threads in this forum