Hacking WiiFlow - an open source GUI USB-Loader

fledge68

Well-Known Member
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,964
Country
United States
Question for fellow Devs.
so i was looking at the code for the wiiflow stub found here - https://github.com/FIX94/open-wiiflow-mod/tree/WiiFlowStub
and was wondering in main.c if i change this line

#define TITLE_UPPER 0x57494948 (WIIH)

to some other channel ID then when apps or emus exit they will launch that channel?
or do i have to change more than just that line?

and what is this line for

#define TITLE_LOWER 0x00010008
 

Larsenv

Dr. Wii, Ph.D
Member
Joined
Sep 28, 2013
Messages
871
Trophies
2
Website
larsenv.xyz
XP
3,285
Country
United States
So I've noticed that the DUTag updating's broken on WiiFlow.

After Wiresharking and loading a game, I see the User Agent is set to this on WiiFlow...

Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0

I believe that it's looking for this...

WiiFlow 2.1

I'm not sure if this is the problem or if it's really set to this, but I know the DUTag checks the User Agent to prevent cheating.

Would someone please look into this?

Thanks.
 
Last edited by Larsenv,

fledge68

Well-Known Member
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,964
Country
United States
So I've noticed that the DUTag updating's broken on WiiFlow.

After Wiresharking and loading a game, I see the User Agent is set to this on WiiFlow...

Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0

I believe that it's looking for this...

WiiFlow 2.1

I'm not sure if this is the problem or if it's really set to this, but I know the DUTag checks the User Agent to prevent cheating.

Would someone please look into this?

Thanks.
couple of quick questions.

1. are you the only one from DU that's having this issue?
2. did DU change anything related to gamer tags recently?
3. What version of wiiflow are you using? Abz's mastermod?
4. is this dutag_url=http://tag.darkumbra.net/{KEY}.update={ID6} set in wiiflow.ini
5. can you download cheats via wiiflow?

saw the line you mentioned in the code but don't notice anything wrong with it.
 

Larsenv

Dr. Wii, Ph.D
Member
Joined
Sep 28, 2013
Messages
871
Trophies
2
Website
larsenv.xyz
XP
3,285
Country
United States
  1. I don't know. We tested this a while back, it worked, but the site admin's busy all the time and it should be reaching DU.
  2. Yes, I started using USB Loader GX after this wouldn't update. It works great there.
  3. Yes, the Abz MasterMod.
  4. Yes.
  5. Yes.
Where's the source code at now since you can't update stuff on Google Code anymore?
 

fledge68

Well-Known Member
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,964
Country
United States
  1. I don't know. We tested this a while back, it worked, but the site admin's busy all the time and it should be reaching DU.
  2. Yes, I started using USB Loader GX after this wouldn't update. It works great there.
  3. Yes, the Abz MasterMod.
  4. Yes.
  5. Yes.
Where's the source code at now since you can't update stuff on Google Code anymore?
WiiFlow source code is now here - https://github.com/FIX94/open-wiiflow-mod

Abz gave me his 1076 and 1054 patches. looking at his 1076 patch i think i see a problem.
in source/network/http.c he changed this line
char* headerformat = "GET %s HTTP/1.0\r\nHost: %s\r\nUser-Agent: WiiFlow 2.1\r\n\r\n";;

to this
char* headerformat = "GET %s HTTP/1.0\r\nHost: %s\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0\r\n\r\n";;

not sure why. hey @AbdallahTerro why did you change that line of code? something to do with banner downloads? or is it somehow related to the private server option?
ok i found this on the masterpiece thread here - https://gbatemp.net/threads/wiiflow-4-the-masterpiece-pack-by-abz.336543/page-50
it appears Abz and greywolf tried to get copy.com links working for banners but it didn't work so changing it back should be fine.

So i changed it back and recompiled. here's the boot dol - http://www.mediafire.com/download/c622amogp2kdyd4/boot.dol

try it.
 
Last edited by fledge68,

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,399
Trophies
0
Age
54
XP
1,516
Country
United States
Yeah that was because of copy.com restricting connections. It identifies WiiFlow as Firefox but it shouldn't be causing problems unless the site it's trying to connect to is filtering connections for that browser.

The current version's UA is "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0" if you want to try that one. If Firefox can connect to that URL then WiiFlow should be able to with that agent.
 

fledge68

Well-Known Member
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,964
Country
United States
Yeah that was because of copy.com restricting connections. It identifies WiiFlow as Firefox but it shouldn't be causing problems unless the site it's trying to connect to is filtering connections for that browser.

The current version's UA is "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0" if you want to try that one. If Firefox can connect to that URL then WiiFlow should be able to with that agent.
the reason it doesn't work is because like larsenv said - the DUTag checks the User Agent to prevent cheating. so using a fake user agent normally isn't a problem but in this case it is.
 

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,399
Trophies
0
Age
54
XP
1,516
Country
United States
the reason it doesn't work is because like larsenv said - the DUTag checks the User Agent to prevent cheating. so using a fake user agent normally isn't a problem but in this case it is.

Yea I saw that just now. :P It could easily be modified to use a different UA string for the tag connections. It isn't going to prevent a whole lot since you can just change the agent in a browser and send updates all day manually.
 

fledge68

Well-Known Member
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,964
Country
United States
Yea I saw that just now. :P It could easily be modified to use a different UA string for the tag connections. It isn't going to prevent a whole lot since you can just change the agent in a browser and send updates all day manually.
ya, i thought about that. like adding bool dutag and if its true use user-agent: wiiflow 2.1 otherwise use the firefox one.
 

fledge68

Well-Known Member
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,964
Country
United States
@GreyWolf
maybe you can help me understand this.
in wiiflow coverflow code there's this
Code:
void CCoverFlow::setRange(u32 rows, u32 columns)
{
    rows = rows < 3u ? 1u : min(rows | 1u, 9u) + 2u;
    columns = min(max(3u, columns | 1u), 21u) + 2u;
    u32 range = rows * columns;
    if (rows == m_rows && columns == m_columns && range == m_range)
        return;
    if (m_covers != NULL)
    {
        stopCoverLoader();
        CCover *tmpCovers = (CCover*)MEM2_alloc(sizeof(CCover) * range);
        for(size_t i = 0; i < range; ++i)
            tmpCovers[i] = *(new(tmpCovers+i) CCover);
        if (rows >= 3)
            for (u32 x = 0; x < columns; ++x)
                for (u32 y = 1; y < rows - 1; ++y)
                    _transposeCover(tmpCovers, rows, columns, x * rows + y);
        else
            for (u32 x = 0; x < range; ++x)
                _transposeCover(tmpCovers, rows, columns, x);
        m_rows = rows;
        m_columns = columns;
        m_range = range;
        MEM2_free(m_covers);
        m_covers = tmpCovers;
        _loadAllCovers(m_covers[m_range / 2].index);
        _updateAllTargets();
        startCoverLoader();
    }
I see he allocates mem2 memory and sets tmpCovers pointing to it and later sets the pointer m_covers pointing to the same address. when this function is called again i assume tmpCovers is set to point to a new allocated mem2 memory and the MEM2_free(m_covers); free's both m_covers and the old tmpCovers?

Also in this line - tmpCovers = *(new(tmpCovers+i) CCover);
i see he uses new but why when you just allocated mem2?
and i thought any time you used new to allocate memory you have to use delete to de-allocate memory?
have i stumbled upon a possible memory leak?
 
Last edited by fledge68,

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,399
Trophies
0
Age
54
XP
1,516
Country
United States
tmpCovers is allocated and the old m_Covers is freed then the newly-allocated tmpCovers replaces it, so m_Covers is now in a different section of memory. Since that section will be freed the next time setRange() is called it shouldn't cause any leaks.

"malloc/free" only allocates and frees memory. They don't call the constructor/destructor. "new/delete" does both but a "new[]" for an array can't be resized so that's probably why the function is using a combination.
 
  • Like
Reactions: fledge68

Larsenv

Dr. Wii, Ph.D
Member
Joined
Sep 28, 2013
Messages
871
Trophies
2
Website
larsenv.xyz
XP
3,285
Country
United States
Thanks @fledge68 and @AbdallahTerro, it updates now.

The only problem is that it takes me to Priiloader when I launch a game and this didn't happen before I updated this?

By the way there's one I wanted to ask while I'm at it, for anything that uses WiiConnect24 (which I'm bringing back) returns 10X031 which means Network error during task setup. I know this isn't a lot of information but this happens with the other USB Loaders too.

Anyone willing to take a look?
 

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,399
Trophies
0
Age
54
XP
1,516
Country
United States
Thanks @fledge68 and @AbdallahTerro, it updates now.

The only problem is that it takes me to Priiloader when I launch a game and this didn't happen before I updated this?

By the way there's one I wanted to ask while I'm at it, for anything that uses WiiConnect24 (which I'm bringing back) returns 10X031 which means Network error during task setup. I know this isn't a lot of information but this happens with the other USB Loaders too.

Anyone willing to take a look?

Nintendo WFC is shut down so WiiConnect24 won't work anymore.
 

fledge68

Well-Known Member
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,964
Country
United States
Thanks @fledge68 and @AbdallahTerro, it updates now.

The only problem is that it takes me to Priiloader when I launch a game and this didn't happen before I updated this?

By the way there's one I wanted to ask while I'm at it, for anything that uses WiiConnect24 (which I'm bringing back) returns 10X031 which means Network error during task setup. I know this isn't a lot of information but this happens with the other USB Loaders too.

Anyone willing to take a look?
If you mean when you exit a game it takes you to priiloader then go to main settings pg 4 and change return to to wiiflow
 

Larsenv

Dr. Wii, Ph.D
Member
Joined
Sep 28, 2013
Messages
871
Trophies
2
Website
larsenv.xyz
XP
3,285
Country
United States
Nintendo WFC is shut down so WiiConnect24 won't work anymore.

Yeah blahblahblah, we're trying to make everything to work with RiiConnect24, it's our own server where you change the DNS to access everything. :) It's just that it gives me this error unlike when I load whatever on the Wii Menu.

It's like how Wiimmfi replaced Nintendo Wi Fi Connection, but still that and WiiConnect24 are totally different.

If you mean when you exit a game it takes you to priiloader then go to main settings pg 4 and change return to to wiiflow

No, when I load the game it takes me to Priiloader instead of the game, this never happened before.

It's already set to return to Priiloader when exiting a game.
 

fledge68

Well-Known Member
Member
Joined
Jan 30, 2012
Messages
2,438
Trophies
2
XP
4,964
Country
United States
Yeah blahblahblah, we're trying to make everything to work with RiiConnect24, it's our own server where you change the DNS to access everything. :) It's just that it gives me this error unlike when I load whatever on the Wii Menu.

It's like how Wiimmfi replaced Nintendo Wi Fi Connection, but still that and WiiConnect24 are totally different.



No, when I load the game it takes me to Priiloader instead of the game, this never happened before.

It's already set to return to Priiloader when exiting a game.
ok my logical guess is you are using Abz's mastermod which defaults to using the r1054 boot.dol and the boot.dol i posted is for r1076.
they each have their own bin files in the bins folder. so when you launch a game it can't find the right loader bin and just returns you to Priiloader cuz that's what you have it set to.

so you either need to get r1054 boot.dol fixed or get the bin files that go with r1076.
in Abz's mastermod full pack is a folder named Alternate Stuff. open it and extract wiiflow_1076_mod.7z
now open that and copy the bins folder to your app/wiiflow folder and everything should be fine.
 
  • Like
Reactions: bostonBC

Larsenv

Dr. Wii, Ph.D
Member
Joined
Sep 28, 2013
Messages
871
Trophies
2
Website
larsenv.xyz
XP
3,285
Country
United States
ok my logical guess is you are using Abz's mastermod which defaults to using the r1054 boot.dol and the boot.dol i posted is for r1076.
they each have their own bin files in the bins folder. so when you launch a game it can't find the right loader bin and just returns you to Priiloader cuz that's what you have it set to.

so you either need to get r1054 boot.dol fixed or get the bin files that go with r1076.
in Abz's mastermod full pack is a folder named Alternate Stuff. open it and extract wiiflow_1076_mod.7z
now open that and copy the bins folder to your app/wiiflow folder and everything should be fine.

Thanks, it works now.

Does anyone want to look in the 10X031 error or into parsing CHANS Scripts (they are present in some channels to do certain tasks for example, view the image the Photo Channel loads if it's present on the Wii Menu)?
 

posthum

Member
Newcomer
Joined
Feb 3, 2016
Messages
21
Trophies
0
Age
38
XP
119
Country
I've tried some time ago. No success either from what I remember. Impossible to compile a wii build with last source. The app was a bit buggy too so i gave up...

Here are a few things that I've done recently though.

Scummvm-mod14
Sync with Github. New games : Labyrinth of time, Sherlock Holmes(Rose tatoo is crashing) etc. See ScummVM website.

Source code


DosBox_Wii_R1
It's based on 1.7 with a few changes:
* GameCube pad support in-game : add joystick=fcs in Dosbox .conf file.
* Navigate menu with GC pad, open it with Start+Z.
* Mapper button to remap keyboard/controllers(same as CTRL-F1).
* New top menu buttons, from left to right: cycles, frameskip, scaler.
Push + or - to increase/decrease cycles/frameskip. Push the tv button to change the filter.
* Conf file saved automatically when exiting if values have been modified("config -wc").

I find it more convenient to able to change cpu cycles, and frameskip directly without exiting the game.
It's the 2 options I change the most frequently.

Source code
Hi Wiimpathy! I tried out your ScummVM mod14 build but cannot get it to start at all from mastermod Wiiflow or HBC (just goes straight to a black screen and my Wii becomes unresponsive). The mastermod included scummvm mod11 works just fine and I have fired up a few nightly builds as well that sort of work so I think my Wii is fine (I say sort of - the nightlies don't seem to work well when receiving path arguments from Wiiflow, I was hoping your mod14 build might not have resolved that).

Ultimately I'm hoping for a build of ScummVM that includes support for Myst/Riven (as mentioned here: https://www.scummvm.org/news/20160327/) while still supporting autoboot from Wiiflow. But I can only seem to get one or the other (the nightly builds run Myst/Riven nicely but won't autoboot).

Hoping you or another clever/generous soul on here might be able to point me in the right direction? :)

Many thanks!
 

Wiimpathy

Well-Known Member
Member
Joined
Mar 3, 2010
Messages
1,013
Trophies
2
XP
3,127
Country
France
It's strange, it should at least go to the ScummVM menu from HBC. If you've copied all the files correctly, and the scummvm.ini is ok, I've no idea... Have you tried games other than Myst?
You're right, this one's crashing with a jpeg error(build mistake or scumm fault?).
You can test the previous build : Scummvm-mod13 The myst series was already playable.
 
  • Like
Reactions: fledge68

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://stockanalysis.com/stocks/ntdoy/market-cap/ I think they'll be alright