Hacking NEW Wiigator Modified Loader

roy_hu

Active Member
Newcomer
Joined
Oct 21, 2008
Messages
29
Trophies
0
XP
28
Country
United States
requiem4d said:
diff -ruN = man's best friend.


Code:
--- Desktop/main-old.cÂÂÂÂ2008-10-30 17:20:00.000000000 -0400
+++ Desktop/main.cÂÂÂÂ2008-10-30 17:20:02.000000000 -0400
@@ -546,7 +546,7 @@
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂnowiird = 0;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmemset((void*)0x80001800,0,kenobiwii_size);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmemcpy((void*)0x80001800,kenobiwii,kenobiwii_size); 
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂfrozenvalue = *(u32*)0x80001808;
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂfrozenvalue = *(u32*)0x80001800;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*(u32*)frozenvalue = 1;ÂÂÂÂ
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂDCFlushRange((void*)0x80001800,kenobiwii_size);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂusb_recvbuffer_safe(EXI_CHANNEL_1,&configbytes,2);ÂÂÂÂ// Get config

Hey guys,

Do you really believe this change is going to speed up game loading? I know nothing about Geck OS, but from reading the source code, the original code seems to be correct.

The buffer kenobiwii is the raw binary generated from newasmpatch/kenobiwii.s. The first two words are filled with 0, and the third word stores the address of frozenvalue. So the original code loads the address of frozenvalue from *0x80001808, which seems correct to me. The change loads 0 into the pointer instead, and then dereferences the pointer for writing. This means we are writing something to address 0. I don't know about wii, but on PC writing to 0 will crash the program.

In summary, I think the change is incorrect. Besides, I don't think it's even relevant. The frozenvalue thing seems to be used for debugging with USB Gecko oS. I don't think this piece of code is executed in normal processes.

I got other two questions as well:
1. Why pad the first two words of kenobiwii with 0?
2. Why do we need memset before memcpy?

Of course, I could be sooo wrong because I'm an idiot. I'd appreciate your comments.
 

requiem4d

Well-Known Member
Member
Joined
Oct 25, 2008
Messages
181
Trophies
0
XP
54
Country
United States
Which is entirely my point, I don't understand why this speeds things up -- but it does, albeit not by much. If I can figure out why this has any effect at all that isn't detrimental to the program's operation, then maybe I can code up a more "proper" fix.
 

djtaz

PM's Full - Wadder Me
Member
Joined
Sep 21, 2008
Messages
2,997
Trophies
0
Age
51
Website
Visit site
XP
101
Country
requiem4d said:
I understand how this fix works, but not quite why.

QUOTE(requiem4d @ Oct 31 2008, 01:34 AM) Which is entirely my point, I don't understand why this speeds things up


So what your saying is you understand how it works but you dont understand ....erm.... how it works ?
tongue.gif
 

requiem4d

Well-Known Member
Member
Joined
Oct 25, 2008
Messages
181
Trophies
0
XP
54
Country
United States
Some discs are still failing with a disc read error. This does not fix it.
And while there is minuscule speedups, it is mostly a placebo effect. The idea is there that this should speed things up, so it "seems" to.

And I agree with roy_hu, this can't be a proper fix, but something is causing the slight performance gain, and I'm still very new at wii dev.

QUOTE said:
So what your saying is you understand how it works but you dont understand ....erm.... how it works ? tongue.gif

No, I'm stating that I understand that by changing the memory address something is happening that seems to cause a speedup. I don't have any debugging tools to know exactly what is causing it. But any programmer knows that an "accidental" improvement is almost never a good thing.
 

roy_hu

Active Member
Newcomer
Joined
Oct 21, 2008
Messages
29
Trophies
0
XP
28
Country
United States
requiem4d said:
Some discs are still failing with a disc read error. This does not fix it.
And while there is minuscule speedups, it is mostly a placebo effect. The idea is there that this should speed things up, so it "seems" to.

And I agree with roy_hu, this can't be a proper fix, but something is causing the slight performance gain, and I'm still very new at wii dev.

QUOTE said:
So what your saying is you understand how it works but you dont understand ....erm.... how it works ? tongue.gif

No, I'm stating that I understand that by changing the memory address something is happening that seems to cause a speedup. I don't have any debugging tools to know exactly what is causing it. But any programmer knows that an "accidental" improvement is almost never a good thing.
Did you say earlier that you were working on other changes? What are they? I'm looking forward to it.
 

requiem4d

Well-Known Member
Member
Joined
Oct 25, 2008
Messages
181
Trophies
0
XP
54
Country
United States
I'm desperately trying to fix the disc read errors, to attempt to contribute something to this project worth a look by it author. So far, I'm achieving small victories here and there, but nothing noteworthy just yet.

And before everybody gets too excited, I'm a PC developer, I work almost entirely with linux. I have very little experience with wii development, zero experience with the software this was originally based on, and no connection with the developers (yet).

I apologize for being stuck in my own "WTF is going on with this fix" mode, but as a PC developer I'm intrigued as to why this patch which "Should Not Work" ™ has any effect at all besides breaking compatibility with existing discs. Much less a performance gain.

So in the mean time, I'm investigating it in hopes I'll find something that may point me in the right direction of fixing the "disc read error" problem. Also my reasoning behind posting ONLY a diff (which is my intention) is to keep those who don't understand exactly what they're doing from making a paperweight out of their wii.
 

ebdynasty

Well-Known Member
Member
Joined
Oct 29, 2008
Messages
125
Trophies
0
XP
35
Country
Yeah certain games get an error that tells you to eject the disc and turn off the wii at a certain point, for example the new james bond game does it after the instruction/safety screen
 

knowitall599

Banned!
OP
Banned
Joined
Oct 1, 2008
Messages
213
Trophies
0
XP
36
Country
United States
It is a problem with the loader Mikey, yes. Some games will not work for some magically mysterious reason. Programmers like me are working hard to fix this. We need a tutorial for all of the Wii libraries to help with the development of the loader. Someone could do this because I certainly would appreiciate it.
 

roy_hu

Active Member
Newcomer
Joined
Oct 21, 2008
Messages
29
Trophies
0
XP
28
Country
United States
knowitall599 said:
It is a problem with the loader Mikey, yes. Some games will not work for some magically mysterious reason. Programmers like me are working hard to fix this. We need a tutorial for all of the Wii libraries to help with the development of the loader. Someone could do this because I certainly would appreiciate it.
Could you please explain why your patch works? My question is at page 3, post #43. Thanks!
 

requiem4d

Well-Known Member
Member
Joined
Oct 25, 2008
Messages
181
Trophies
0
XP
54
Country
United States
Let's not get ahead of ourselves just yet until myself, knowitall599, and/or anyone else can figure out exactly why this helps -- or what unintended side-effects it might cause.
 

requiem4d

Well-Known Member
Member
Joined
Oct 25, 2008
Messages
181
Trophies
0
XP
54
Country
United States
Thanks, I appreciate your input.
It doesn't fix anything of significance, (read noticeable, beyond placebo effect) but may cause other problems.

This is not the solution we're looking for.
 

knowitall599

Banned!
OP
Banned
Joined
Oct 1, 2008
Messages
213
Trophies
0
XP
36
Country
United States
I have another present for you guys:http://www.megaupload.com/?d=0LVAW410
For those of you that hadn't noticed the change in speed will notice it now!
yaynds.gif


I just made more memory changes.

BTW...I am very close to finding a solution for the stupid read error, I think. Depends on a question I asked Wiigator in a PM. Hope I get an answer so I can get to work. Cheers!
 

roy_hu

Active Member
Newcomer
Joined
Oct 21, 2008
Messages
29
Trophies
0
XP
28
Country
United States
knowitall599 said:
I have another present for you guys:http://www.megaupload.com/?d=0LVAW410
For those of you that hadn't noticed the change in speed will notice it now!
yaynds.gif


I just made more memory changes.
Source code please! And please explain why your change works
 

zapu

Well-Known Member
Member
Joined
Jul 27, 2006
Messages
182
Trophies
0
XP
103
Country
Poland
People, don't download until source code is presented and commented by an experienced person. Claims that 'errors are fixed!' 'oh and the speed is better cause I discovered something' sound fake. Make sure you always know what are you going to run on your Wii.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
    K3Nv2 @ K3Nv2: Floridawoman is the only thing that can ruin Floridaman +1