Page 1 of 1

sdloader.bin start address?

Posted: Tue Aug 17, 2010 8:14 pm
by Samson
I'm sorry that this is slightly off-topic, but this seems to be the best place: Does anyone remember what the start address for SDLoader.bin is? I'd like to convert it into a DOL to launch with a max drive pro...

Re: sdloader.bin start address?

Posted: Thu Aug 26, 2010 10:41 pm
by WinterMute
Sorry to take so long, I think it's either 0x81300000 or 0x81200000 - Costis can't remember either :roll:

The stage 2 loader is in the sdpatch source code if you still have that, could always run it through objdump & figure it that way.

Re: sdloader.bin start address?

Posted: Fri Aug 27, 2010 1:17 pm
by Samson
I should say sorry for not RTFM... I just remembered that I still have the installer on my HD and the readme even mentions the start address for people who want to replace sdloader.bin: 0x81700000
This small python script will slurp in sdloader.bin and produce a shiny sdloader.dol:

Code: Select all

import struct

f = open("sdloader.bin", "rb")
dol = f.read()
f.close()

text_file_pos = [0x100] + [0] * 6
data_file_pos = [0] * 11
text_mem_pos = [0x81700000] + [0] * 6
data_mem_pos = [0] * 11
text_size = [len(dol)] + [0] * 6
data_size = [0] * 11
bss_mem_pos = 0
bss_size = 0
entry = 0x81700000

f = open("sdloader.dol", "wb")
f.write(struct.pack(">IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIxxxxxxxxxxxxxxxxxxxxxxxxxxxx", *(text_file_pos + data_file_pos + text_mem_pos + data_mem_pos + text_size + data_size + [bss_mem_pos, bss_size, entry])))
f.write(dol)
f.close()
I was a bit afraid that sdloader conflicts with the max drive software, but I just tried it and it works! The software is confused if the sd card is in a slot during startup, but you can put the card in once the menu is drawn.