m0skit0 wrote:Nice job again! And nice idea to make open-sourced stuff. I just hope you won't change your mind like dridri![]()
On the technical side, that C code can be improved, for example removing all the gotos, which are just horrible. On the other side, if you write your own strncmp() (which is very easy) it should work.
For people who aren't going to enter technical discussion, please abstain putting useless posts, let's keep this thread clean
I don't know the story of dridri but I would never change the licence (GPLv2) of project hen. And I would appreciate anyone who like to join so that it won't die soon.
The code is not so clean and has room for improve. Pls feel free to give more advices.
The strncmp is really sth. I don't understand. The scenario is as the following.
If this code is inserted before calling sceUtility_private_2DC8380C:
- Code: Select all
do {
strncmp("sceVshVH", s, 8);
s++;
} while (s < 0x0A000000);
This is OK. Note that we don't check return value of strncmp. It's just a useless loop. (Certainly then we need to calculate the routine address with JSS's code)
However, if we check the return value:
- Code: Select all
do {
if (!strncmp("sceVshVH", s, 8))
break;
s++;
} while (s < 0x0A000000);
Now we check the return value of strncmp and debug log shows that we get the correct address. But then PSP crashed - even if we still use JSS's code to calculate routine address!
I also tried replacing it with built-in strncmp, same thing happens. As long as we don't check return value, it's fine; otherwise crash. WTF?
PS: I personally like to replace while/for loop with goto when possible. It's all over kernel's code, isn't it.


