Hacking NForwarder IOS 58

Narolez

Well-Known Member
OP
Member
Joined
Apr 10, 2009
Messages
369
Trophies
0
Location
<LAB#257>
XP
50
Country
Gambia, The
NForwarder 58 - USB 2.0 forwarder, supports FAT32 and NTFS partitions
Best device compatibility and the fastest way to load a dol!

CODE**********************************************************************
*
* NForwarder IOS 58 [USB 2.0] v1 with FAT32- and NTFS-Support
* Narolez 2010
*
* Based on WiiMC-Forwarder by Tantric 2009-2010
*
* Modifications:
*
*ÂÂ - Second search path for boot.dol added.
*
*ÂÂ - Only mount USB partitions and search for boot.dol on USB if dol
*ÂÂÂÂ was not found on SD card. Eliminates unnecessary USB mounting.
*
*ÂÂ - USB wake-up for better drive detection added, useful for drives
*ÂÂÂÂ with long spin-up times. With this modification, these drives can
*ÂÂÂÂ be mounted on Wii startup. For example, if you use the forwarder
*ÂÂÂÂ dol with Priiloader to load boot.dol on Wii startup.
*
*ÂÂ - For first found partition, pass mountname without device number.
*ÂÂÂÂ For example "usb:" instead of "usb1:". Some USB loaders can't
*ÂÂÂÂ handle mountpoint names with device number in it correctly.
*ÂÂÂÂ
* Requirements:
*
*ÂÂÂÂ- Installed IOS 58, use http://wiibrew.org/wiki/IOS58_Installer
*ÂÂÂÂÂÂfor installation.
*
***********************************************************************

* Included forwarder dols [/dol]:

ÂÂUSB Loader CFG: CFGForwarder58.dol
ÂÂUSB Loader GX:ÂÂGXForwarder58.dol
ÂÂWiiFlow:ÂÂÂÂÂÂÂÂWiiflowForwarder58.dol
ÂÂNeogamma:ÂÂÂÂÂÂ NeogammaForwarder58.dol

ÂÂFor use with Priiloader or for channel injection.


* Included channel forwarder wads [/wad]:

ÂÂCFG USB Loader - 58CF.wadÂÂ[11 Blocks]
ÂÂNeoGamma Loader - 58NG.wad [10 Blocks]
ÂÂUSBLoader GX - 58GX.wadÂÂÂÂ[11 Blocks]
ÂÂWiiFlow Loader - 58WF.wadÂÂ[10 Blocks]

ÂÂAnimated Black Edition channels by pepxl, pimped with NForwarder dol.
ÂÂSee http://gbatemp.net/t215364-animated-forwarders-black-edition for
ÂÂchannel details.


* Search paths for boot.dol (SD/SDHC and USB)

ÂÂUSB Loader CFG: /apps/usbloader_cfg/ | /apps/usbloadercfg/
ÂÂUSB Loader GX:ÂÂ/apps/usbloader_gx/ÂÂ| /apps/usbloadergx/
ÂÂWiiFlow:ÂÂÂÂÂÂÂÂ/apps/wiiflow/ÂÂÂÂÂÂ | /wiiflow/
ÂÂNeogamma:ÂÂÂÂÂÂ /apps/neogamma/ÂÂÂÂÂÂ| /neogamma/


* Included source code [/src]

ÂÂCode license: GNU General Public License v3
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂhttp://www.gnu.org/licenses/gpl-3.0.html


* Official download links [6.55 MB]
ÂÂ
ÂÂMediafire:ÂÂÂÂhttp://www.mediafire.com/?zsd08pv56v78mab
ÂÂMultiupload:ÂÂhttp://www.multiupload.com/1SH2AKAAGC
Download

Download (dols, wads, source) [6.55 mb]
Download mirror (dols, wads, source) [6.55 mb]

FAQ


How to compile?

1. Download devkitPro Windows Installer here
2. Install devkitPro PPC with downloaded devkitProUpdater (only Minimal System, devkitPPC and Programmer's Notepad are needed)
3. Download required libogc from here
4. Extract the downloaded libogc to your devkitPro libogc directory (c:\devkitpro\libogc), overwrite existing files
5. Double click on NForwarder58.pnproj in the forwarder src directory
6. In Programmer's Notepad, run Tools > make or press Alt+1

How to change the loading picture?

1. Make a picture with a size of 640 x 480 pixel
2. Save it as /src/source/images/backround.png
3. Double click on NForwarder58.pnproj in the forwarder src directory
4. In Programmer's Notepad, run Tools > clean or press Alt+2
5. In Programmer's Notepad, run Tools > make or press Alt+1

Miscellaneous


Feel free to use NForwarder for your channels or something else. But, mention it's powered by NForwarder 58!
wink.gif
 

mgrimmenator

Well-Known Member
Member
Joined
Sep 12, 2009
Messages
235
Trophies
0
Age
52
XP
86
Country
United States
spidy1000 said:
thanks narolez

would it be possible to show some video's on how the wiiflow channel forwarder looks?


nice job, ? would this forwarder load faster than the nforwarder that we have been using for sometime now?
 

LyndonW

New Member
Newbie
Joined
Sep 13, 2009
Messages
1
Trophies
0
XP
25
Country
Canada
this is what it looks like while loading currently, and it does seem to load quicker then other one's i've tried.

ctmnh.png



i'm no good at this programming stuff, only ever done web design, so i can't figure out how to compile this with my own picture
smile.gif
would there be anyone willing to compile it with this new image below? i boot straight into wiiflow and don't even use the system menu anymore, but i still want it to show that it's a wii starting up
smile.gif


http://imgur.com/lg5rf.png
 

Narolez

Well-Known Member
OP
Member
Joined
Apr 10, 2009
Messages
369
Trophies
0
Location
<LAB#257>
XP
50
Country
Gambia, The
LyndonW said:
i'm no good at this programming stuff, only ever done web design, so i can't figure out how to compile this with my own picture would there be anyone willing to compile it with this new image below?
It's simple, here are some compiling instructions:

1. Download devkitPro Windows Installer here
2. Install devkitPro PPC with downloaded devkitProUpdater (only Minimal System, devkitPPC and Programmer's Notepad are needed)
3. Download required libogc from here
4. Extract the downloaded libogc to your devkitPro libogc directory (c:\devkitpro\libogc), overwrite existing files
5. Double click on NForwarder58.pnproj in the forwarder src directory
6. In Programmer's Notepad, run Tools > make or press Alt+1

Instructions for changing the picture:

1. Make a picture with a size of 640 x 480 pixel
2. Save it as /src/source/images/backround.png
3. Double click on NForwarder58.pnproj in the forwarder src directory
4. In Programmer's Notepad, run Tools > clean or press Alt+2
5. In Programmer's Notepad, run Tools > make or press Alt+1

Hope this helps,
Narolez
 

Yuan

Well-Known Member
Member
Joined
Oct 1, 2007
Messages
1,291
Trophies
0
XP
371
Country
Brazil
mgrimmenator said:
nice job, ? would this forwarder load faster than the nforwarder that we have been using for sometime now?

For SD and FAT32 HDD it is faster than the forwarder on wiiflow svn. Don't have a NTFS unit to test

Narolez said:
QUOTE(LyndonW @ Oct 17 2010, 05:26 AM) i'm no good at this programming stuff, only ever done web design, so i can't figure out how to compile this with my own picture would there be anyone willing to compile it with this new image below?
It's simple, here are some compiling instructions:

1. Download devkitPro Windows Installer here
2. Install devkitPro PPC with downloaded devkitProUpdater (only Minimal System, devkitPPC and Programmer's Notepad are needed)
3. Download required libogc from here
4. Extract the downloaded libogc to your devkitPro libogc directory (c:\devkitpro\libogc), overwrite existing files
5. Double click on NForwarder58.pnproj in the forwarder src directory
6. In Programmer's Notepad, run Tools > make or press Alt+1

Instructions for changing the picture:

1. Make a picture with a size of 640 x 480 pixel
2. Save it as /src/source/images/backround.png
3. Double click on NForwarder58.pnproj in the forwarder src directory
4. In Programmer's Notepad, run Tools > clean or press Alt+2
5. In Programmer's Notepad, run Tools > make or press Alt+1

Hope this helps,
Narolez

You need to edit the forwarder path too, on programmer's notepad, open main.c and search for %s:/apps/ and change the next text on both entries for the folder of your application.
 

Narolez

Well-Known Member
OP
Member
Joined
Apr 10, 2009
Messages
369
Trophies
0
Location
<LAB#257>
XP
50
Country
Gambia, The
Tueidj, that's right.

But, for my Buffalo Drivestation and Hitachi Simpledrive the libogc implementation doesn't work every time. Above all if I use forwarder with priiloader. My implementation works fine for me.
So, for me, the USB retry code is not pretty pointless. Especially there are no disadvantages.

However my WD Passport works fine with the libogc implementation.

Narolez
 

FIX94

Former Staff
Former Staff
Joined
Dec 3, 2009
Messages
7,284
Trophies
0
Age
30
Location
???
XP
11,248
Country
Germany
Thanks Narolez! Now I can update your old configurable usb loader forwarder and add USB 2.0 speed without the "path problem" from tantric's forwarder source!
 

Narolez

Well-Known Member
OP
Member
Joined
Apr 10, 2009
Messages
369
Trophies
0
Location
<LAB#257>
XP
50
Country
Gambia, The
Fine Fix94, the "path problem" is caused by the device number at the end of the mountpoint name. Some loaders, especially CFG Loader, can not handle it correctly. That's the reason i've fixed it.
 

FIX94

Former Staff
Former Staff
Joined
Dec 3, 2009
Messages
7,284
Trophies
0
Age
30
Location
???
XP
11,248
Country
Germany
Narolez said:
Fine Fix94, the "path problem" is caused by the device number at the end of the mointpointname. Some loaders, especially CFG Loader, can not handle it correctly. That's the reason i've fixed it.
Yes, I noticed that with the configurable usb loader debug mode and I'm not a coder, so I was not able to do this, thanks for fixing that
yaywii.gif
 

oggzee

Well-Known Member
Member
Joined
Apr 11, 2009
Messages
2,333
Trophies
0
XP
188
Country
Slovenia
Narolez: nice work.

I have added support for meta.xml to your forwarder.
Here is the source zip:
http://cfg-loader.googlecode.com/files/nfwd58meta.zip

And this is the diff:

CODEdiff -u -r nforwarder58//source/fileop.c nfwd58meta//source/fileop.c
--- nforwarder58//source/fileop.cÂÂÂÂ2010-10-16 20:25:17.396416900 +0200
+++ nfwd58meta//source/fileop.cÂÂÂÂ2010-10-17 17:27:10.900451100 +0200
@@ -167,7 +167,8 @@
ÂÂÂÂ}
ÂÂÂÂelse
ÂÂÂÂ{
-ÂÂÂÂÂÂÂÂif(!ntfsMount(mount, disc, sector, 256, 3, NTFS_DEFAULT | NTFS_RECOVER))
+ÂÂÂÂÂÂÂÂ//if(!ntfsMount(mount, disc, sector, 256, 3, NTFS_DEFAULT | NTFS_RECOVER))
+ÂÂÂÂÂÂÂÂif(!ntfsMount(mount, disc, sector, 256, 3, NTFS_DEFAULT | NTFS_READ_ONLY))
ÂÂÂÂÂÂÂÂÂÂÂÂreturn;

ÂÂÂÂÂÂÂÂconst char *name = ntfsGetVolumeName(mount);
diff -u -r nforwarder58//source/main.c nfwd58meta//source/main.c
--- nforwarder58//source/main.cÂÂÂÂ2010-10-16 21:02:16.017314700 +0200
+++ nfwd58meta//source/main.cÂÂÂÂ2010-10-17 17:28:18.630832100 +0200
@@ -37,6 +37,9 @@
#include
#include
#include
+#include
+#include
+#include

#include "pngu.h"
#include "fileop.h"
@@ -73,6 +76,119 @@
ÂÂ return 0;
}

+#define MAX_CMDLINE 4096
+#define MAX_ARGVÂÂÂÂ1000
+struct __argv args;
+char cmdline[MAX_CMDLINE];
+char *a_argv[MAX_ARGV];
+char *meta_buf = NULL;
+
+void arg_init()
+{
+ÂÂÂÂmemset(&args, 0, sizeof(args));
+ÂÂÂÂmemset(cmdline, 0, sizeof(cmdline));
+ÂÂÂÂmemset(a_argv, 0, sizeof(a_argv));
+ÂÂÂÂargs.argvMagic = ARGV_MAGIC;
+ÂÂÂÂargs.length = 1; // double
+ÂÂÂÂargs.argc = 0;
+ÂÂÂÂargs.commandLine = cmdline;
+ÂÂÂÂargs.argv = a_argv;
+ÂÂÂÂargs.endARGV = a_argv;
+}
+
+char* strcopy(char *dest, const char *src, int size)
+{
+ÂÂÂÂstrncpy(dest,src,size);
+ÂÂÂÂdest[size-1] = 0;
+ÂÂÂÂreturn dest;
+}
+
+int arg_addl(char *arg, int len)
+{
+ÂÂÂÂif (args.argc >= MAX_ARGV) return -1;
+ÂÂÂÂif (args.length + len + 1 > MAX_CMDLINE) return -1;
+ÂÂÂÂstrcopy(cmdline + args.length - 1, arg, len+1);
+ÂÂÂÂargs.length += len + 1; // 0 term.
+ÂÂÂÂcmdline[args.length - 1] = 0; // double
+ÂÂÂÂargs.argc++;
+ÂÂÂÂargs.endARGV = args.argv + args.argc;
+ÂÂÂÂreturn 0;
+}
+
+int arg_add(char *arg)
+{
+ÂÂÂÂreturn arg_addl(arg, strlen(arg));
+}
+
+int load_file(char *name, void *buf, int size)
+{
+ÂÂÂÂint fd;
+ÂÂÂÂint ret;
+ÂÂÂÂfd = open(name, O_RDONLY);
+ÂÂÂÂif (fd < 0) {
+ÂÂÂÂÂÂÂÂprintf("Error opening %s\n", name);
+ÂÂÂÂÂÂÂÂreturn -1;
+ÂÂÂÂ}
+ÂÂÂÂret = read(fd, buf, size);
+ÂÂÂÂclose(fd);
+ÂÂÂÂif (ret != size) {
+ÂÂÂÂÂÂÂÂprintf("Error reading %s\n", name);
+ÂÂÂÂÂÂÂÂreturn -2;
+ÂÂÂÂ}
+ÂÂÂÂreturn 0;
+}
+
+void load_meta(char *exe_path)
+{
+ÂÂÂÂchar meta_path[200];
+ÂÂÂÂchar *p;
+ÂÂÂÂstruct stat st;
+ÂÂÂÂstrcpy(meta_path, exe_path);
+ÂÂÂÂp = strrchr(meta_path, '/');
+ÂÂÂÂif (!p) return;
+ÂÂÂÂstrcpy(p+1, "meta.xml");
+ÂÂÂÂif (stat(meta_path, &st) != 0) {
+ÂÂÂÂÂÂÂÂ//dbg_printf("Not found: %s\n", meta_path);
+ÂÂÂÂÂÂÂÂreturn;
+ÂÂÂÂ}
+ÂÂÂÂ//dbg_printf("Found: %s\n", meta_path);
+ÂÂÂÂif (st.st_size > 64*1024) {
+ÂÂÂÂÂÂÂÂ//dbg_printf("meta.xml too big: %lld\n", st.st_size);
+ÂÂÂÂÂÂÂÂreturn;
+ÂÂÂÂ}
+ÂÂÂÂ// +1 so that the buf is 0 terminated
+ÂÂÂÂmeta_buf = calloc(st.st_size + 1, 1);
+ÂÂÂÂif (!meta_buf) {
+ÂÂÂÂÂÂÂÂ//printf("calloc(%lld)\n", st.st_size);
+ÂÂÂÂÂÂÂÂreturn;
+ÂÂÂÂ}
+ÂÂÂÂload_file(meta_path, meta_buf, st.st_size);
+}
+
+void parse_meta()
+{
+ÂÂÂÂchar *p;
+ÂÂÂÂchar *e, *end;
+ÂÂÂÂif (!strstr(meta_buf, "
 

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
13,979
Trophies
3
Age
38
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
10,110
Country
Cyprus
oggzee said:
Narolez: nice work.

I have added support for meta.xml to your forwarder.
Here is the source zip:
http://cfg-loader.googlecode.com/files/nfwd58meta.zip

**snip**

I hope you will include this functionality in your future releases.
(Unfortunately I haven't tested it yet, but will do so asap)
Oh and I also changed the ntfs mount flags to readonly, I think it's safer that way.
Let me know if you think it's fine!

oggzee, does this mean u r one step closer to implementing one version of cfg usb loader instead of 2 (ie. 249 vs 222)?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    T @ Texasauras: if i post it later will you guys help haha