Hacking Tutorial: Compile your own USB Loader!

  • Thread starter Thread starter JussiPik
  • Start date Start date
  • Views Views 21,072
  • Replies Replies 86
substring said:
Guyz, do you all understand what you are doing ? We are talking here about recompiling a software. That means to have a little understanding about what compiling and setting up a compiler means. So when I see how you all don't understand why you have linking errors once you run "make", I really wonder if you know what you are doing.

If you don't know what it does, and how to do it, don't use it, and that's all ...

I actually have a good amount of experience in coding but I decided to follow the first post in this thread to the letter anyway. At the very least I could then make sure that those that are complete noobs could still follow it and get the right result. It worked perfectly, following every instruction he gave.

How these other people, with less or no knowledge of coding are getting these errors then are a bit strange. Some of it may be down to running Vista and not having turned off UAC or used Run as adminstrator. Others may have simply got a bit too carried away in the source code adjustments and accidentally deleted some other lines of code when the were told to alter or comment out others.

What needs to be done to avoid all of this is for Waninkoko to simply add support for choosing an alternate background from within the program itself, without the need for end users to recompile the source code. Much like how changing XP/Vista desktop wallpaper is, simply find the file, click ok and it's done.
 
WiiPower said:
To me it looks like there's something wrong with your devkit installation. Are you sure there aren't any spaces in any filepath and you did restart your pc after the installation?
I'm SURE there are not spaces in the filepaths. After the installation of devkitpro, it did not ask me to reboot. I have not tried that; I will.


Thanks!
unsure.gif
 
u4Wii said:
substring said:
Guyz, do you all understand what you are doing ? We are talking here about recompiling a software. That means to have a little understanding about what compiling and setting up a compiler means. So when I see how you all don't understand why you have linking errors once you run "make", I really wonder if you know what you are doing.

If you don't know what it does, and how to do it, don't use it, and that's all ...

I actually have a good amount of experience in coding but I decided to follow the first post in this thread to the letter anyway. At the very least I could then make sure that those that are complete noobs could still follow it and get the right result. It worked perfectly, following every instruction he gave.

How these other people, with less or no knowledge of coding are getting these errors then are a bit strange. Some of it may be down to running Vista and not having turned off UAC or used Run as adminstrator. Others may have simply got a bit too carried away in the source code adjustments and accidentally deleted some other lines of code when the were told to alter or comment out others.

What needs to be done to avoid all of this is for Waninkoko to simply add support for choosing an alternate background from within the program itself, without the need for end users to recompile the source code. Much like how changing XP/Vista desktop wallpaper is, simply find the file, click ok and it's done.
I agree with you. 100%. Someone could even modify trhe source so that USB Loader loads a background from the SD card.

Actually, I think the second choice is the best one. Reading from the SD is not such a big problem for someone who knows C and knows how to read a little doc about libfat or whichever library available for the Wii.

But what I point at is :
- don't know what running "make" means ? Don't run it
- Don't know what a compiler is ? don't touch it
- heard about devkit for the tirst time on the post ? don't install it

tbh, i installed devkit because my usb HDD aren't detected, and I decided to find out where the problem could be. I set up devkit ppc a few days ago (w/o that tutorial), and could compile the USB loader like a big boy, without any help, but only because I know C, I know how to edit a makefile, and what you should write, and where ...

Giving the good tools to the wrong hands will surely give more problems than solutions
smile.gif
I agree that setting up devkit, changing the background image and compiling usbloader doesn't require any coding skill. It wall works like a charm ... until some people who don't know what they do try to give it a shot !

Hopefully, no one should be able to brick their wii with usb loader, which is the most important
wink.gif
 
TiMeBoMb4u2 said:
substring said:
Guyz, do you all understand what you are doing ? We are talking here about recompiling a software. That means to have a little understanding about what compiling and setting up a compiler means. So when I see how you all don't understand why you have linking errors once you run "make", I really wonder if you know what you are doing.

If you don't know what it does, and how to do it, don't use it, and that's all ...
I compiled MANY times in the past (not recently)! Normally, I would compile from a Linux command-line, though. So, I understand I'm getting errors, but I don't know why?! Below is the error I'm getting:

Code:
> "make"
apploader.c
powerpc-gekko-gcc.exe: CreateProcess: No such file or directory
make[1]: *** [apploader.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:01

wacko.gif


How come you compile an apploader.c whereas there is no such file in the source code
wtf.gif


Are you running make from the usbloader dir ? Are you sure your makefile is correct ? here's mine :
CODE
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC")
endif

include $(DEVKITPPC)/wii_rules

#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGETÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(notdir $(CURDIR))
BUILDÂÂÂÂÂÂÂÂ:=ÂÂÂÂbuild
SOURCESÂÂÂÂÂÂÂÂ:=ÂÂÂÂsource source/libpng/pngu source/libwbfs
DATAÂÂÂÂÂÂÂÂ:=ÂÂÂÂdataÂÂ
INCLUDESÂÂÂÂ:=

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGSÂÂÂÂ= -g -O2 -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGSÂÂÂÂ=ÂÂÂÂ$(CFLAGS)

LDFLAGSÂÂÂÂ=ÂÂÂÂ-g $(MACHDEP) -Wl,-Map,$(notdir $@).map

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBSÂÂÂÂ:=ÂÂÂÂ-lpng -lwiiuse -lbte -logc -lm -lz

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRSÂÂÂÂ:=ÂÂÂÂ$(DEVKITPPC)/lib $(CURDIR)

#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUTÂÂÂÂ:=ÂÂÂÂ$(CURDIR)/$(TARGET)

export VPATHÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(foreach dir,$(DATA),$(CURDIR)/$(dir))

export DEPSDIRÂÂÂÂ:=ÂÂÂÂ$(CURDIR)/$(BUILD)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILESÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILESÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILESÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILESÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILESÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
ÂÂÂÂexport LDÂÂÂÂ:=ÂÂÂÂ$(CC)
else
ÂÂÂÂexport LDÂÂÂÂ:=ÂÂÂÂ$(CXX)
endif

export OFILESÂÂÂÂ:=ÂÂÂÂ$(addsuffix .o,$(BINFILES)) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(sFILES:.s=.o) $(SFILES:.S=.o)

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDEÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ-I$(CURDIR)/$(BUILD) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ-I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHSÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ-L$(LIBOGC_LIB)

export OUTPUTÂÂÂÂ:=ÂÂÂÂ$(CURDIR)/$(TARGET)
.PHONY: $(BUILD) clean

#---------------------------------------------------------------------------------
$(BUILD):
ÂÂÂÂ@[ -d $@ ] || mkdir -p $@
ÂÂÂÂ@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile

#---------------------------------------------------------------------------------
clean:
ÂÂÂÂ@echo clean ...
ÂÂÂÂ@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol

#---------------------------------------------------------------------------------
run:
ÂÂÂÂwiiload $(TARGET).dol


#---------------------------------------------------------------------------------
else

DEPENDSÂÂÂÂ:=ÂÂÂÂ$(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

#---------------------------------------------------------------------------------
# This rule links in binary data with the .jpg extension
#---------------------------------------------------------------------------------
%.jpg.oÂÂÂÂ:ÂÂÂÂ%.jpg
#---------------------------------------------------------------------------------
ÂÂÂÂ@echo $(notdir $
 
OKAY... After a reboot, it was still not working on Vista.

I tried installing on XP... BINGO!! It works like a charm!!
yay.gif



Please change your tutorial to say "DOES NOT WORK ON VISTA!!"



Thanks, for everyones' help!

rolleyes.gif
 
sorry lil bit confusing question, does anyone know which part of coding that related to usb hdd/flashdrive? I want to do some edit in it. TQ
 
When I try to compile/make I get a error:
Code:
> "make" 
apploader.c
In file included from c:/USBLoader/source/apploader.c:1:
c:/devkitPro/libogc/include/stdio.h:46:27: warning: crtdll/stddef.h: No such file or directory
In file included from c:/USBLoader/source/apploader.c:1:
c:/devkitPro/libogc/include/stdio.h:176: error: expected declaration specifiers or '...' before 'size_t'
c:/devkitPro/libogc/include/stdio.h:198: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:198: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:212: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:212: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:213: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:213: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:214: error: expected ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:215: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:215: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:216: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:216: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:217: error: expected ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:228: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:228: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:229: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:229: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:230: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:230: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:250: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fgetwc'
c:/devkitPro/libogc/include/stdio.h:251: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fputwc'
c:/devkitPro/libogc/include/stdio.h:252: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getwc'
c:/devkitPro/libogc/include/stdio.h:253: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ungetwc'
c:/devkitPro/libogc/include/stdio.h:255: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_filwbuf'
c:/devkitPro/libogc/include/stdio.h:256: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_flswbuf'
c:/devkitPro/libogc/include/stdio.h:278: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
c:/devkitPro/lib> "make" 
apploader.c
In file included from c:/USBLoader/source/apploader.c:1:
c:/devkitPro/libogc/include/stdio.h:46:27: warning: crtdll/stddef.h: No such file or directory
In file included from c:/USBLoader/source/apploader.c:1:
c:/devkitPro/libogc/include/stdio.h:176: error: expected declaration specifiers or '...' before 'size_t'
c:/devkitPro/libogc/include/stdio.h:198: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:198: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:212: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:212: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:213: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:213: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:214: error: expected ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:215: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:215: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:216: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:216: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:217: error: expected ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:228: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:228: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:229: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:229: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:230: warning: type defaults to 'int' in declaration of 'wchar_t'
c:/devkitPro/libogc/include/stdio.h:230: error: expected ';', ',' or ')' before '*' token
c:/devkitPro/libogc/include/stdio.h:250: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fgetwc'
c:/devkitPro/libogc/include/stdio.h:251: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fputwc'
c:/devkitPro/libogc/include/stdio.h:252: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getwc'
c:/devkitPro/libogc/include/stdio.h:253: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ungetwc'
c:/devkitPro/libogc/include/stdio.h:255: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_filwbuf'
c:/devkitPro/libogc/include/stdio.h:256: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_flswbuf'
c:/devkitPro/libogc/include/stdio.h:278: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
c:/devkitPro/libogc/include/stdio.h:280: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite'
make[1]: *** [apploader.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:00ogc/include/stdio.h:280: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite'
make[1]: *** [apploader.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:01
What is this?

I've placed it all in: C:\USBLoader...
(Yes, only the Build , Makefile , Data etc folders/files in there...)

Thanks
smile.gif
 
Did you install your libogc manually? Maybe you are missing libfat which has to be in the same folder as libogc.
 
c:/devkitPro/libogc/include/stdio.h:46:27: warning: crtdll/stddef.h: No such file or directory

That means you are missing the header file Adr90. No wonder nothing works. You need to install it again

Regarding devkitpro and vista :
I downloaded devKitPro to test it on Vista and it works fine. Just make sure you add a make clean at the Makefile or if you don't know how, delete the build folder (so you can recompile again and not get the warning that there is nothing to build because the dol is upto date).
 
The title of this thread is very misleading I came in expecting somthing more in depth than just changing the backround Image which I don't even care about
 
wiiztec said:
The title of this thread is very misleading I came in expecting somthing more in depth than just changing the backround Image which I don't even care about

The title is perfect it is a tutorial on how to compile your own usb loader and thats what it says. It does not say compile your own usb loader with different features
 
The term compile covers a broader spectrum than just changing the backround image
 
To me compile is just: source --> executable. So for me the title is correct, you expected "customize your own USB Loader" or even "create your own USB Loader"?

lol ccc
 
"Compile the USB loader with your own custom backround image" would have been a better title IMO
 
wiiztec said:
"Compile the USB loader with your own custom backround image" would have been a better title IMO

I think the background image change was added after the thread was already made but that does not matter all the thread promises to do is make an executive
 
For those people that are having the error with Programmer's Notepad in Vista, try going to your control panel=> System=> Change Settings=> click Advanced tab=> and click Environment Variables. Once in there, scroll down on system variables to find Path. Edit the path and make sure that these are included:

c:\devkitpro\devkitppc\powerpc-gekko\bin
c:\devkitpro\msys\bin
c:\devkitpro\devkitppc\libexec\gcc\powerpc-gekko\4.2.4

Remember to put a ; after eachline with no space. ie: c:\devkitpro\devkitppc\powerpc-gekko\bin;c:\devkitpro\msys\bin;c:\devkitpro\devkitppc\libexec\gcc\powerpc-gekko\4.2.4

Hope that this helps.
 
Do not comment out the path variables like the original poster said to do...simply do this:

DEVKITPRO = /c/devkitpro/
DEVKITPPC = /c/devkitpro/devkitPPC

where the "c" is the drive you have devkit installed on...assuming you used "c:\devkitpro" thus the reason for the /c/ ... if you used "d:\devkitpro" you would use ...etc

DEVKITPRO = /d/devkitpro/
DEVKITPPC = /d/devkitpro/devkitPPC

and there is no need to edit anything else in the makefile for it to compile. It will already output a .dol and .elf automatically. Making un-needed changes to the makefile will cause lots of problems.
 
You only need those 2 lines if your devkitpro isn't properly installed or you want the ability to switch between different versions of it.
 

Site & Scene News

Popular threads in this forum