Hacking Loadstructor

jj69

New Member
Newbie
Joined
Jun 25, 2009
Messages
2
Trophies
0
XP
1
Country
France
TeenTin said:
Would you please implement the new 002 fix in the dol ? Thanks !

I think you meen the Anti 002 fix which is nécessary to run Indiana Jones & others with cIOS249r10->12

I would also like to have this patch in cLoader.

I actually compiled a modified dol for myself (runs Indiana Jones perfectly) but I'd prefer it to be "official"
biggrin.gif
 

TeenTin

Well-Known Member
Member
Joined
Jun 20, 2007
Messages
1,256
Trophies
1
XP
853
Country
Hong Kong
jj69 said:
TeenTin said:
Would you please implement the new 002 fix in the dol ? Thanks !

I think you meen the Anti 002 fix which is nécessary to run Indiana Jones & others with cIOS249r10->12

I would also like to have this patch in cLoader.

I actually compiled a modified dol for myself (runs Indiana Jones perfectly) but I'd prefer it to be "official"
biggrin.gif

NO! I mean the 002b fix. NOT the Anti one.
 

jj69

New Member
Newbie
Joined
Jun 25, 2009
Messages
2
Trophies
0
XP
1
Country
France
<!--quoteo(post=2077073:date=Jun 25 2009, 11:32 AM:name=Cluster)--><div class='quotetop'>QUOTE(Cluster @ Jun 25 2009, 11:32 AM) <a href="index.php?act=findpost&pid=2077073"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I can join you to my project. Do you have account on google? Or just post your changes here.<!--QuoteEnd--></div><!--QuoteEEnd-->

See codebox below for my changes (look for "/** Anti 002 fix for cIOS 249 rev < 12 thanks to WiiPower **/"), credits goes to WiiCrazy & the USB Loader GX team.
It's quick & dirty, and doesn't read any parameter, using one byte in the parameter's array would make it configurable (I had no time left to go further, plus I can't compile the Delphi stuff)

<!--quoteo(post=2077132:date=Jun 25 2009, 12:02 PM:name=TeenTin)--><div class='quotetop'>QUOTE(TeenTin @ Jun 25 2009, 12:02 PM) <a href="index.php?act=findpost&pid=2077132"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->NO! I mean the <b>002b fix</b>. NOT the Anti one.<!--QuoteEnd--></div><!--QuoteEEnd-->

I don't know about this one ...

<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:Pre;overflow:auto'>
file='apploader.c'


#include <stdio.h>
#include <ogcsys.h>
#include <string.h>

#include "apploader.h"
#include "wdvd.h"
#include "video.h"
#include "cfg.h"
#include "patchcode.h" /*FISHEARS*/
#include "kenobiwii.h" /*FISHEARS*/

/*KENOBI! - FISHEARS*/
extern const unsigned char kenobiwii[];
extern const int kenobiwii_size;

/* Apploader function pointers */
typedef int (*app_main)(void **dst, int *size, int *offset);
typedef void (*app_init)(void (*report)(const char *fmt, ...));
typedef void *(*app_final)();
typedef void (*app_entry)(void (**init)(void (*report)(const char *fmt, ...)), int (**main)(), void *(**final)());

/* Apploader pointers */
static u8 *appldr = (u8 *)0x81200000;


/* Constants */
#define APPLDR_OFFSET 0x2440

/* Variables */
static u32 buffer[0x20] ATTRIBUTE_ALIGN(32);


static void __noprint(const char *fmt, ...)
{
}

bool compare_videomodes(GXRModeObj* mode1, GXRModeObj* mode2)
{
if (mode1->viTVMode != mode2->viTVMode || mode1->fbWidth != mode2->fbWidth || mode1->efbHeight != mode2->efbHeight || mode1->xfbHeight != mode2->xfbHeight ||
mode1->viXOrigin != mode2->viXOrigin || mode1->viYOrigin != mode2->viYOrigin || mode1->viWidth != mode2->viWidth || mode1->viHeight != mode2->viHeight ||
mode1->xfbMode != mode2->xfbMode || mode1->field_rendering != mode2->field_rendering || mode1->aa != mode2->aa || mode1->sample_pattern[0][0] != mode2->sample_pattern[0][0] ||
mode1->sample_pattern[1][0] != mode2->sample_pattern[1][0] || mode1->sample_pattern[2][0] != mode2->sample_pattern[2][0] ||
mode1->sample_pattern[3][0] != mode2->sample_pattern[3][0] || mode1->sample_pattern[4][0] != mode2->sample_pattern[4][0] ||
mode1->sample_pattern[5][0] != mode2->sample_pattern[5][0] || mode1->sample_pattern[6][0] != mode2->sample_pattern[6][0] ||
mode1->sample_pattern[7][0] != mode2->sample_pattern[7][0] || mode1->sample_pattern[8][0] != mode2->sample_pattern[8][0] ||
mode1->sample_pattern[9][0] != mode2->sample_pattern[9][0] || mode1->sample_pattern[10][0] != mode2->sample_pattern[10][0] ||
mode1->sample_pattern[11][0] != mode2->sample_pattern[11][0] || mode1->sample_pattern[0][1] != mode2->sample_pattern[0][1] ||
mode1->sample_pattern[1][1] != mode2->sample_pattern[1][1] || mode1->sample_pattern[2][1] != mode2->sample_pattern[2][1] ||
mode1->sample_pattern[3][1] != mode2->sample_pattern[3][1] || mode1->sample_pattern[4][1] != mode2->sample_pattern[4][1] ||
mode1->sample_pattern[5][1] != mode2->sample_pattern[5][1] || mode1->sample_pattern[6][1] != mode2->sample_pattern[6][1] ||
mode1->sample_pattern[7][1] != mode2->sample_pattern[7][1] || mode1->sample_pattern[8][1] != mode2->sample_pattern[8][1] ||
mode1->sample_pattern[9][1] != mode2->sample_pattern[9][1] || mode1->sample_pattern[10][1] != mode2->sample_pattern[10][1] ||
mode1->sample_pattern[11][1] != mode2->sample_pattern[11][1] || mode1->vfilter[0] != mode2->vfilter[0] ||
mode1->vfilter[1] != mode2->vfilter[1] || mode1->vfilter[2] != mode2->vfilter[2] || mode1->vfilter[3] != mode2->vfilter[3] || mode1->vfilter[4] != mode2->vfilter[4] ||
mode1->vfilter[5] != mode2->vfilter[5] || mode1->vfilter[6] != mode2->vfilter[6] )
{
return false;
} else
{
return true;
}
}


void patch_videomode(GXRModeObj* mode1, GXRModeObj* mode2)
{
mode1->viTVMode = mode2->viTVMode;
mode1->fbWidth = mode2->fbWidth;
mode1->efbHeight = mode2->efbHeight;
mode1->xfbHeight = mode2->xfbHeight;
mode1->viXOrigin = mode2->viXOrigin;
mode1->viYOrigin = mode2->viYOrigin;
mode1->viWidth = mode2->viWidth;
mode1->viHeight = mode2->viHeight;
mode1->xfbMode = mode2->xfbMode;
mode1->field_rendering = mode2->field_rendering;
mode1->aa = mode2->aa;
mode1->sample_pattern[0][0] = mode2->sample_pattern[0][0];
mode1->sample_pattern[1][0] = mode2->sample_pattern[1][0];
mode1->sample_pattern[2][0] = mode2->sample_pattern[2][0];
mode1->sample_pattern[3][0] = mode2->sample_pattern[3][0];
mode1->sample_pattern[4][0] = mode2->sample_pattern[4][0];
mode1->sample_pattern[5][0] = mode2->sample_pattern[5][0];
mode1->sample_pattern[6][0] = mode2->sample_pattern[6][0];
mode1->sample_pattern[7][0] = mode2->sample_pattern[7][0];
mode1->sample_pattern[8][0] = mode2->sample_pattern[8][0];
mode1->sample_pattern[9][0] = mode2->sample_pattern[9][0];
mode1->sample_pattern[10][0] = mode2->sample_pattern[10][0];
mode1->sample_pattern[11][0] = mode2->sample_pattern[11][0];
mode1->sample_pattern[0][1] = mode2->sample_pattern[0][1];
mode1->sample_pattern[1][1] = mode2->sample_pattern[1][1];
mode1->sample_pattern[2][1] = mode2->sample_pattern[2][1];
mode1->sample_pattern[3][1] = mode2->sample_pattern[3][1];
mode1->sample_pattern[4][1] = mode2->sample_pattern[4][1];
mode1->sample_pattern[5][1] = mode2->sample_pattern[5][1];
mode1->sample_pattern[6][1] = mode2->sample_pattern[6][1];
mode1->sample_pattern[7][1] = mode2->sample_pattern[7][1];
mode1->sample_pattern[8][1] = mode2->sample_pattern[8][1];
mode1->sample_pattern[9][1] = mode2->sample_pattern[9][1];
mode1->sample_pattern[10][1] = mode2->sample_pattern[10][1];
mode1->sample_pattern[11][1] = mode2->sample_pattern[11][1];
mode1->vfilter[0] = mode2->vfilter[0];
mode1->vfilter[1] = mode2->vfilter[1];
mode1->vfilter[2] = mode2->vfilter[2];
mode1->vfilter[3] = mode2->vfilter[3];
mode1->vfilter[4] = mode2->vfilter[4];
mode1->vfilter[5] = mode2->vfilter[5];
mode1->vfilter[6] = mode2->vfilter[6];
}

GXRModeObj* vmodes[] = {
&TVNtsc240Ds,
&TVNtsc240DsAa,
&TVNtsc240Int,
&TVNtsc240IntAa,
&TVNtsc480IntDf,
&TVNtsc480IntAa,
&TVNtsc480Prog,
&TVMpal480IntDf,
&TVPal264Ds,
&TVPal264DsAa,
&TVPal264Int,
&TVPal264IntAa,
&TVPal524IntAa,
&TVPal528Int,
&TVPal528IntDf,
&TVPal574IntDfScale,
&TVEurgb60Hz240Ds,
&TVEurgb60Hz240DsAa,
&TVEurgb60Hz240Int,
&TVEurgb60Hz240IntAa,
&TVEurgb60Hz480Int,
&TVEurgb60Hz480IntDf,
&TVEurgb60Hz480IntAa,
&TVEurgb60Hz480Prog,
&TVEurgb60Hz480ProgSoft,
&TVEurgb60Hz480ProgAa
};

GXRModeObj* PAL2NTSC[]={
&TVMpal480IntDf, &TVNtsc480IntDf,
&TVPal264Ds, &TVNtsc240Ds,
&TVPal264DsAa, &TVNtsc240DsAa,
&TVPal264Int, &TVNtsc240Int,
&TVPal264IntAa, &TVNtsc240IntAa,
&TVPal524IntAa, &TVNtsc480IntAa,
&TVPal528Int, &TVNtsc480IntAa,
&TVPal528IntDf, &TVNtsc480IntDf,
&TVPal574IntDfScale, &TVNtsc480IntDf,
&TVEurgb60Hz240Ds, &TVNtsc240Ds,
&TVEurgb60Hz240DsAa, &TVNtsc240DsAa,
&TVEurgb60Hz240Int, &TVNtsc240Int,
&TVEurgb60Hz240IntAa, &TVNtsc240IntAa,
&TVEurgb60Hz480Int, &TVNtsc480IntAa,
&TVEurgb60Hz480IntDf, &TVNtsc480IntDf,
&TVEurgb60Hz480IntAa, &TVNtsc480IntAa,
&TVEurgb60Hz480Prog, &TVNtsc480Prog,
&TVEurgb60Hz480ProgSoft,&TVNtsc480Prog,
&TVEurgb60Hz480ProgAa, &TVNtsc480Prog,
0,0
};

GXRModeObj* NTSC2PAL[]={
&TVNtsc240Ds, &TVPal264Ds,
&TVNtsc240DsAa, &TVPal264DsAa,
&TVNtsc240Int, &TVPal264Int,
&TVNtsc240IntAa, &TVPal264IntAa,
&TVNtsc480IntDf, &TVPal528IntDf,
&TVNtsc480IntAa, &TVPal524IntAa,
&TVNtsc480Prog, &TVPal528IntDf,
0,0
};

GXRModeObj* NTSC2PAL60[]={
&TVNtsc240Ds, &TVEurgb60Hz240Ds,
&TVNtsc240DsAa, &TVEurgb60Hz240DsAa,
&TVNtsc240Int, &TVEurgb60Hz240Int,
&TVNtsc240IntAa, &TVEurgb60Hz240IntAa,
&TVNtsc480IntDf, &TVEurgb60Hz480IntDf,
&TVNtsc480IntAa, &TVEurgb60Hz480IntAa,
&TVNtsc480Prog, &TVEurgb60Hz480Prog,
0,0
};
bool Search_and_patch_Video_Modes(void *Address, u32 Size, GXRModeObj* Table[])
{
u8 *Addr = (u8 *)Address;
bool found = 0;
u32 i;

while(Size >= sizeof(GXRModeObj))
{



for(i = 0; Table; i+=2)
{


if(compare_videomodes(Table, (GXRModeObj*)Addr))

{
found = 1;
patch_videomode((GXRModeObj*)Addr, Table[i+1]);
Addr += (sizeof(GXRModeObj)-4);
Size -= (sizeof(GXRModeObj)-4);
break;
}
}

Addr += 4;
Size -= 4;
}


return found;
}

/** Anti 002 fix for cIOS 249 rev < 12 thanks to WiiPower **/
void Anti_002_fix(void *Address, int Size)
{
u8 SearchPattern[12] = { 0x2C, 0x00, 0x00, 0x00, 0x48, 0x00, 0x02, 0x14, 0x3C, 0x60, 0x80, 0x00 };
u8 PatchData[12] = { 0x2C, 0x00, 0x00, 0x00, 0x40, 0x82, 0x02, 0x14, 0x3C, 0x60, 0x80, 0x00 };

void *Addr = Address;
void *Addr_end = Address+Size;

while(Addr <= Addr_end-sizeof(SearchPattern))
{
if(memcmp(Addr, SearchPattern, sizeof(SearchPattern))==0)
{
memcpy(Addr,PatchData,sizeof(PatchData));
}
Addr += 4;
}
}

s32 Apploader_Run(entry_point *entry)
{
app_entry appldr_entry;
app_init appldr_init;
app_main appldr_main;
app_final appldr_final;

u32 appldr_len;
s32 ret;

/* Read apploader header */
ret = WDVD_Read(buffer, 0x20, APPLDR_OFFSET);
if (ret < 0)
return ret;

/* Calculate apploader length */
appldr_len = buffer[5] + buffer[6];

/* Read apploader code */
ret = WDVD_Read(appldr, appldr_len, APPLDR_OFFSET + 0x20);
if (ret < 0)
return ret;

/* Set apploader entry function */
appldr_entry = (app_entry)buffer[4];

/* Call apploader entry */
appldr_entry(&appldr_init, &appldr_main, &appldr_final);

/* Initialize apploader */
appldr_init(__noprint);

/*HOOKS STUFF - FISHEARS*/
if (CFG.ocarina) {
memset((void*)0x80001800,0,kenobiwii_size);
memcpy((void*)0x80001800,kenobiwii,kenobiwii_size);
DCFlushRange((void*)0x80001800,kenobiwii_size);
hooktype = 1;
memcpy((void*)0x80001800, (char*)0x80000000, 6); // For WiiRD
}
/*HOOKS STUFF - FISHEARS*/

for (;;) {
void *dst = NULL;
s32 len = 0, offset = 0;

GXRModeObj** table = NULL;
/* Run apploader main function */
ret = appldr_main(&dst, &len, &offset);
if (!ret)
break;

/* Read data from DVD */
WDVD_Read(dst, len, (u64)(offset << 2));

if (CFG.video == CFG_VIDEO_PATCH) // patch auto
{
switch(CONF_GetVideo())
{
case CONF_VIDEO_PAL:
if(CONF_GetEuRGB60() > 0)
{
table = NTSC2PAL60;
}
else
{
table = NTSC2PAL;
}
break;

case CONF_VIDEO_MPAL:
table = NTSC2PAL;
break;

default:
table = PAL2NTSC;
break;
}
Search_and_patch_Video_Modes(dst, len, table);
}

// force PAL50 (Narolez)
if (CFG.video == CFG_VIDEO_PAL50) {
Search_and_patch_Video_Modes(dst, len, NTSC2PAL);
}
if (CFG.video == CFG_VIDEO_PAL60) {
Search_and_patch_Video_Modes(dst, len, NTSC2PAL60);
}
if (CFG.video == CFG_VIDEO_NTSC) {
Search_and_patch_Video_Modes(dst, len, PAL2NTSC);
}

if (CFG.ocarina) {
dogamehooks(dst,len);
}
if (CFG.vidtv) {
vidolpatcher(dst,len);
}
/*LANGUAGE PATCH - FISHEARS*/
if (CFG.language != CFG_LANG_CONSOLE) {
langpatcher(dst,len);
}

if (1 == 1) {
Anti_002_fix(dst, len);
}

DCFlushRange(dst, len);
}

/* Set entry point from apploader */
*entry = appldr_final();

return 0;
}
</div>
 

IchigoZX

Well-Known Member
Newcomer
Joined
Jun 19, 2009
Messages
52
Trophies
0
XP
20
Country
United States
[+] ERROR: Could not initialize SD/USB subsystem! (ret=1)

wth is this?

what can i do to get it to work?
i used usb on wii music
BUT
when i used animal crossing on SD
IT FRIKKEN WORKS!!!
WTH
 

IlluminiX

Well-Known Member
Member
Joined
Feb 3, 2009
Messages
203
Trophies
0
XP
51
Country
United States
Finally figured out why I couldn't get opening.bnr to extract!

I wasn't using a common-key.bin from Wiiscrubber 1.3/1.4, but rather another utility I use for making channels and managing WBFS. Once I replaced the common-key, the opening.bnr extracted and the wad was made SUCCESSFULLY!
 

djricekcn

Well-Known Member
Member
Joined
May 29, 2009
Messages
1,100
Trophies
1
XP
838
Country
United States
TeenTin said:
jj69 said:
TeenTin said:
Would you please implement the new 002 fix in the dol ? Thanks !

I think you meen the Anti 002 fix which is nécessary to run Indiana Jones & others with cIOS249r10->12

I would also like to have this patch in cLoader.

I actually compiled a modified dol for myself (runs Indiana Jones perfectly) but I'd prefer it to be "official"
biggrin.gif

NO! I mean the 002b fix. NOT the Anti one.


what is this 002b fix and how different is it from 002fix/anti002
 

justjack

Well-Known Member
Member
Joined
Feb 10, 2009
Messages
268
Trophies
0
XP
1,422
Country
Chile
Please Cluster check the game language setting
frown.gif
it seems it doesn't work, I've tried choosing spanish but games will still play in english :/
 

IchigoZX

Well-Known Member
Newcomer
Joined
Jun 19, 2009
Messages
52
Trophies
0
XP
20
Country
United States
NVM
i got it to work. You need USB Loader GX to use the USB. If you are using the the USB, and it say

wait for device..........30

use the SD slot (I used Micro SD to use for my USB AND SD Slot)
 

erolz

Well-Known Member
Member
Joined
Jul 22, 2008
Messages
468
Trophies
0
XP
606
Country
Belgium
Hi,

As you (might) all know, Mario Galaxy needs the IOS 223 to run without any problems.
Also Mortal Combat and The Conduit have "special needs".

Is it possible to make channels for these games? and how?
thanx!
 

alucard77

Well-Known Member
Member
Joined
Jul 20, 2006
Messages
501
Trophies
1
XP
491
Country
United States
I have to say, this thing plays pretty much anything I throw at it. Ghostbusters, Conduit, and everything else. I haven't tried galaxy yet though.

Rev13a
3.2U
 

Majin Vegeta

Well-Known Member
Member
Joined
Jul 12, 2008
Messages
159
Trophies
0
XP
100
Country
Gambia, The
I would also like to request a 002 fix.
One Piece UC1 gives a 002 error if using cIOS rev13a. Dunno why other 002 protected games even work as rev13a doesn't have the 002 fix.

Except this: Really great app
wink.gif
Created a lot of channels already.
 

Bladexdsl

fanboys triggered 9k+
Member
Joined
Nov 17, 2008
Messages
21,150
Trophies
2
Location
Queensland
XP
12,247
Country
Australia
this is my fav loader (if it is a loader?) no having to browse through menus, fast loading, no fiddling with extra settings and the chans looks great on the wii menu.
 

alucard77

Well-Known Member
Member
Joined
Jul 20, 2006
Messages
501
Trophies
1
XP
491
Country
United States
Majin Vegeta said:
I would also like to request a 002 fix.
One Piece UC1 gives a 002 error if using cIOS rev13a. Dunno why other 002 protected games even work as rev13a doesn't have the 002 fix.

Except this: Really great app
wink.gif
Created a lot of channels already.

This already contrains the 002 fix. Try the newest version.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=pCYyXcb_pJk Lol spiderman dong