forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Breakpoint on hardware functions possible?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
CrazyT



Joined: 23 Dec 2006
Posts: 18

PostPosted: Tue Aug 04, 2009 10:59 pm    Post subject: Breakpoint on hardware functions possible? Reply with quote

Hi, i just downloaded http://my.malloc.us/silverspring/files/2007/10/ipl-decrypt-sample.rar wich is an example of how they decrypt the ipl.
I was wondering if it would be possible to watch/log the calls of such hardware functions with the help of breakpoints.
Because it is not a normal call to such a function you can not simply say: "stop at offset xy"
The reason i ask is some idea about this crypto chip.
Cos nobody knows what code it uses to crypt/decrypt stuff ... why not just generate a file that stores the encrypted and decrypted buffer.
That way emulators might be possible in future ...
(of course only if the buffer that needs to get decrypted does not change every time)
Back to top
View user's profile Send private message
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Tue Aug 04, 2009 11:40 pm    Post subject: Reply with quote

Im not 100% sure, but does PSPLink do that? I dont use the darn thing (for it wont even do anything).
_________________
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
Back to top
View user's profile Send private message AIM Address
CrazyT



Joined: 23 Dec 2006
Posts: 18

PostPosted: Wed Aug 05, 2009 1:45 am    Post subject: Reply with quote

PSPLink has an option for breakpoints, but the problem is that the actual function is called by the chip.
All you change is a register/memory part, so i wonder if it is somehow possible to break on the change of a special register/memory part.
For better understanding thats some part they use to decrypt stuff:

PspKirkRegs *const crypt = KIRK_HW_REGISTER_ADDR;
crypt->command = 1;
crypt->src_addr = MAKE_PHYS_ADDR(src);
crypt->dst_addr = MAKE_PHYS_ADDR(dst);
crypt->proc_phase = 1;
while((crypt->status & 0x11) == 0);

See?
There is no function call like for example "decrypt()" at all.
Question is, how the chip knows when it should process the command.(maybe just checks the field proc_phase?)
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Wed Aug 05, 2009 3:04 am    Post subject: Reply with quote

CrazyT wrote:
I was wondering if it would be possible to watch/log the calls of such hardware functions with the help of breakpoints.

Yes you can. First coprocessor CP0 has a couple of registers called WatchHi and WatchLo, which will generate an exception if the address specified on them is accessed. Check a MIPS CPU reference for further details.

CrazyT wrote:
Cos nobody knows what code it uses to crypt/decrypt stuff

Sure about that?

http://hitmen.c02.at/files/yapspd/psp_doc/chap8.html#sec8.7

Afaik, Kirk doesn't do encryption as it only has the public key (for decrypting). But don't quote me on this, and correct me if i'm wrong.

EDIT: ok, you mean the algorithm for decryption, I understood otherwise :P
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Tue Aug 11, 2009 1:07 pm    Post subject: Reply with quote

It's a hardware crypto engine. There's no crypto code executing on the MIPS CPU while it's waiting for the Kirk to come up with a result, so there's nothing that a CPU breakpoint could possibly see.
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Tue Aug 11, 2009 7:31 pm    Post subject: Reply with quote

Yes, if you see my EDIT, I finally understood that ;)
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group