Advertising (This ad goes away for registered users. You can Login or Register)

Proposal for reducing configuration troubles

This is the development forum of the half-byte loader project. For general Half Byte Loader questions, visit the Half Byte Loader forum.
Forum rules
This forum is for HBL Development discussions ONLY. For User support or HBL general discussions, go to viewforum.php?f=3 . Messages that are not development related will be deleted.
Post Reply
wololo
Site Admin
Posts: 3619
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Proposal for reducing configuration troubles

Post by wololo » Sat Oct 16, 2010 11:38 am

the current import_config files in HBL contain 2 "parts"
One is the addresses of stubs (specific to each game and each firmware), the second is the nids needed by HBL (common to all games and all firmwares).

I'm suggesting 2 things here, inspired by discussions we've already had in the past:

1) get rid of the stubs in the config files, and have HBL search for them dynamically.
There's a concern with time here, so I suggest we to cache the result in a file. When HBL runs, if the cached file exists, load the stubs addresses from there, otherwise search for the stubs in user memory.

2) move the rest of the import_config as well as sdk_hbl.S to the eLoader folder instead of each exploit subfolder

This should improve the porting speed
Advertising
If you need US PSN Codes, this technique is what I recommend.

Looking for guest bloggers and news hunters here at wololo.net, PM me!

cscash241
Banned
Posts: 105
Joined: Mon Sep 27, 2010 6:52 pm

Re: Proposal for reducing configuration troubles

Post by cscash241 » Thu Oct 21, 2010 12:13 am

would option 1 mean one version of the exploit that would auto detect what game you are using??? if so that i like that idea :D
Advertising

wololo
Site Admin
Posts: 3619
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: Proposal for reducing configuration troubles

Post by wololo » Thu Oct 21, 2010 1:40 am

Not entirely, but it would easy the porting process, by having HBL do more things automatically. I think it would require less memory dumps from users, and in theory we should be able to release a working version without requiring any memory dump (which is currently the longest part of the process)
If you need US PSN Codes, this technique is what I recommend.

Looking for guest bloggers and news hunters here at wololo.net, PM me!

User avatar
m0skit0
Guru
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: Proposal for reducing configuration troubles

Post by m0skit0 » Thu Oct 21, 2010 6:46 am

Wololo wrote:1) get rid of the stubs in the config files, and have HBL search for them dynamically.
I already tried that some time ago. The problem is actually detecting the stub's descriptors correctly. It's not as easy as it seems and you will get a lot of false positives. Also parsing the whole p2 and p5 will slow down HBL quite a bit.
cscash241 wrote:one version of the exploit that would auto detect what game you are using??? if so that i like that idea
This is a good idea, but it involves a lot more work that what you might think.

Another good idea would be having HBL as a PRX (or another relocatable format we can discuss) and relocated by the loader itself. This would rid of having to compile HBL for each exploit, since it can be loaded anywhere. The loader would detect the game, check what syscalls are resolved (it already does this) and load, relocate and resolve known syscalls for HBL. The main problem here is to load a PRX or create a design for a custom relocation format (which is not a good idea IMHO since we already have the PRX relocation coded).
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"

JJS
Big Beholder
Posts: 1416
Joined: Mon Sep 27, 2010 2:18 pm
Contact:

Re: Proposal for reducing configuration troubles

Post by JJS » Thu Oct 21, 2010 7:07 am

The way p5 stubs are searched now is by a semi-automatic process. For each module a memory address is given that is just below the actual address of the stub for all firmwares. This minimizes the search times.

I think the same could be doable with the main user memory addresses. Either give approximate start addresses and the module name in exploit_config.h or just give the module names and search the whole memory. Then cache the results in a file.
The libraries are also always(?) in a certain memory region, there is sceKernelLibrary loaded at the bottom of user memory, the main game module gets always relocated to the same address which puts the stub somewhere around 0x08A00000 and the additional libraries must be at the top of user memory (0x09D0000+). So even on the first run, not all of user memory has to be searched.

User avatar
m0skit0
Guru
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: Proposal for reducing configuration troubles

Post by m0skit0 » Thu Oct 21, 2010 8:26 am

I agree JJS, but that way you would still need to reference memory addresses, which would likely not be universal for any game, specially on p2, but also for newer firmware versions on p5.
JJS wrote:he main game module gets always relocated to the same address which puts the stub somewhere around 0x08A00000 and the additional libraries must be at the top of user memory (0x09D0000+)
That might be true for new games, but not for old ones which are all static (main game module), thus loaded at 0x08900000.

But yes, I do agree that you won't have to search the whole user memory (p2+p5) but it would be close to the whole thing IMHO. The more you narrow it, the most likely it will eventually fail with a given game.

Also an idea to detect stub descriptors more correctly: implementing a method that checks whether the library name pointed by the supposed stub descriptor is actually a valid string, something fast (and ugly) like

Code: Select all

// p = pointer_to_library_name_found_on_supposed_stub_descriptor
int is_libname(char* p)
{
	return (p[0] >= 'A' && p[0] <= 'Z' && p[1] >= 'a' && p[1] <= 'z');
}
Of course we should check if other elements of the stub descriptors are valid as well (e.g. pointers can be masked with 0x0FFFFFFF if I'm not mistaken).

The main problem is recognizing a valid NID, since they're random (i know they're mostly SHA-1 of the original SCE function name, but this counts as good as random).
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"

coyotebean
Guru
Posts: 96
Joined: Mon Sep 27, 2010 3:22 pm

Re: Proposal for reducing configuration troubles

Post by coyotebean » Thu Oct 21, 2010 9:40 am

I usually start my search for module by using the module_info NID 0xF01D73A7
GBASP x1, GBM x2, NDSL x2, PSP 100X x3, PSP 200X x6, PSP 300X x5, PSP Go x4, Wii x1

Post Reply

Return to “Half Byte Loader Development”