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 

Kernel Memory Dumping Tool
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Jun 08, 2005 5:04 am    Post subject: Kernel Memory Dumping Tool Reply with quote

Seeing as someone has already posted a strings dump of the kernel I thought we should get out a tool so everyone with v1.0 can dump their kernel memory regions too. And lucky for you it comes with source as well (not that there is much of it :P)

have fun and don't do anything with it you shouldn't :)

http://ps2dev.org/kb.x?T=1154
Back to top
View user's profile Send private message
djhuevo



Joined: 10 Mar 2005
Posts: 47

PostPosted: Wed Jun 08, 2005 5:08 am    Post subject: Reply with quote

thanks for sharing TyRaNiD...

sometimes people forget to share this kind of stuff, and do thing in private form.
_________________
sobreviviendo en la tierra de los trolldev
Back to top
View user's profile Send private message
Sirwhizz



Joined: 08 Jun 2005
Posts: 16
Location: Melbourne, FL

PostPosted: Wed Jun 08, 2005 5:16 am    Post subject: Reply with quote

thanks to bad I don't have a 1.0 to try it out. Patience I feel is the way to go. I think in the long run all this work on the 1.0 will help out for later firmware out there.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Wed Jun 08, 2005 2:30 pm    Post subject: Re: Kernel Memory Dumping Tool Reply with quote

TyRaNiD wrote:
And lucky for you it comes with source as well (not that there is much of it :P)


I can't compile it. What is the PSPSDK? I hope it is not the official SDK.
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Wed Jun 08, 2005 3:23 pm    Post subject: Re: Kernel Memory Dumping Tool Reply with quote

Shine wrote:
I can't compile it. What is the PSPSDK? I hope it is not the official SDK.


Of course it's not the official SDK. pspsdk hasn't been released yet. But since you have source, you're sure to be able to get it to build another way.
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Wed Jun 08, 2005 6:52 pm    Post subject: Re: Kernel Memory Dumping Tool Reply with quote

mrbrown wrote:
Of course it's not the official SDK. pspsdk hasn't been released yet. But since you have source, you're sure to be able to get it to build another way.


Yes, finally I saw the two tricks :-) I'm not sure if the forum rules allow to post it, but would be more useful than the program, if someone else wants to built it without the PSPSDK or some other programs, like writing to kernel space.

PS: the temporary buffer is not necessary, sceIoWrite accesses the kernel space without problems with the two tricks on my PSP.
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 09, 2005 6:14 am    Post subject: Reply with quote

Where are the support headers required to compile it available from? Are you part of another application already released? I presume its a standards PS2DEV toolchain without need for the Sony SDK.

What is the trick here? Sorry for being dumb but the code looks normal. Is there something special about creating a thread called "update_thread", or is it something else.

This is a dev forum after all so it would be nice of the devs explained the example presented.

Steddy
Back to top
View user's profile Send private message
Vampire



Joined: 12 Apr 2005
Posts: 138

PostPosted: Thu Jun 09, 2005 6:27 am    Post subject: Reply with quote

steddy wrote:
What is the trick here?

the module flags is the key to getting into kmode:
Code:
        .section    ".xodata.sceModuleInfo","wa",@progbits
__moduleinfo:
        #.word  0x01011006
        .word   0x01011000
        .ascii  "PSPSDK"        #up to 28 char
        .align  5

the .word is important. if bit 12 is set to 1 it starts in kmode.
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 09, 2005 6:28 am    Post subject: Reply with quote

Thanks Vampire, appreciated.

Steddy
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Thu Jun 09, 2005 6:30 am    Post subject: Reply with quote

steddy wrote:
Is there something special about creating a thread called "update_thread", or is it something else.

The thread handling is some other nice work by TyRaNiD, which could be used to end programs like normal games, see http://forums.ps2dev.org/viewtopic.php?t=1723.
Back to top
View user's profile Send private message
fungus



Joined: 09 Jun 2005
Posts: 6

PostPosted: Thu Jun 09, 2005 3:03 pm    Post subject: Reply with quote

Vampire wrote:
steddy wrote:
What is the trick here?

the module flags is the key to getting into kmode:
Code:
        .section    ".xodata.sceModuleInfo","wa",@progbits
__moduleinfo:
        #.word  0x01011006
        .word   0x01011000
        .ascii  "PSPSDK"        #up to 28 char
        .align  5

the .word is important. if bit 12 is set to 1 it starts in kmode.


is this all there is to it ? - I'm getting 0x80020001 if I set the word at __moduleinfo to 0x01011000 - my app launches fine when I use the standard 0x01010000

I'm sure I'm missing something obvious - any help appreciated

fungus
Back to top
View user's profile Send private message
fungus



Joined: 09 Jun 2005
Posts: 6

PostPosted: Fri Jun 10, 2005 3:36 pm    Post subject: Reply with quote

fungus wrote:
Vampire wrote:
steddy wrote:
What is the trick here?

the module flags is the key to getting into kmode:
Code:
        .section    ".xodata.sceModuleInfo","wa",@progbits
__moduleinfo:
        #.word  0x01011006
        .word   0x01011000
        .ascii  "PSPSDK"        #up to 28 char
        .align  5

the .word is important. if bit 12 is set to 1 it starts in kmode.


is this all there is to it ? - I'm getting 0x80020001 if I set the word at __moduleinfo to 0x01011000 - my app launches fine when I use the standard 0x01010000

I'm sure I'm missing something obvious - any help appreciated

fungus


anyone ?
Back to top
View user's profile Send private message
konfig



Joined: 06 Jan 2005
Posts: 68

PostPosted: Sat Jun 11, 2005 3:06 pm    Post subject: So PSP's kernel memory content can be dumped now Reply with quote

Could this mean we can do homebrew on 1.5 soon?
Back to top
View user's profile Send private message MSN Messenger
Guest






PostPosted: Sat Jun 11, 2005 3:15 pm    Post subject: Re: So PSP's kernel memory content can be dumped now Reply with quote

konfig wrote:
Could this mean we can do homebrew on 1.5 soon?


Doesn't seem that way to me. Looks more like it will soon be possible to have nearly full control over PSP at 1.0, which is currently hampered by lack of access to kernel mode.
Back to top
konfig



Joined: 06 Jan 2005
Posts: 68

PostPosted: Sat Jun 11, 2005 4:57 pm    Post subject: Re: So PSP's kernel memory content can be dumped now Reply with quote

gorim wrote:
konfig wrote:
Could this mean we can do homebrew on 1.5 soon?


Doesn't seem that way to me. Looks more like it will soon be possible to have nearly full control over PSP at 1.0, which is currently hampered by lack of access to kernel mode.


If really full control over 1.0 is performed, how psp loads and decrypts the 1.5 update pbp will be known, and then the following: 1.5 psp's elf loader.

But as you said, "nearly full control". Seems something is missing.
Back to top
View user's profile Send private message MSN Messenger
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sat Jun 11, 2005 7:42 pm    Post subject: Re: So PSP's kernel memory content can be dumped now Reply with quote

konfig wrote:
If really full control over 1.0 is performed, how psp loads and decrypts the 1.5 update pbp will be known, and then the following: 1.5 psp's elf loader.


Maybe you are right, a loader could be written, which runs on 1.5 PSP's, but how do you start it? It must be itself an encrypted program and there is no way to encrypt it, because you need the private key, which only Sony has.

gorim wrote:
Looks more like it will soon be possible to have nearly full control over PSP at 1.0, which is currently hampered by lack of access to kernel mode.


Programs can read and write kernel memory with TyRaNiD's tricks, do we need some more access? In theory now you could disassemble all and could reverse engineering most of the low-level hardware registers, too (not all, because some might be used in games, only), for example for low level kernel drivers when porting Linux.
Back to top
View user's profile Send private message
konfig



Joined: 06 Jan 2005
Posts: 68

PostPosted: Sat Jun 11, 2005 8:39 pm    Post subject: Re: So PSP's kernel memory content can be dumped now Reply with quote

Shine wrote:
konfig wrote:
If really full control over 1.0 is performed, how psp loads and decrypts the 1.5 update pbp will be known, and then the following: 1.5 psp's elf loader.


Maybe you are right, a loader could be written, which runs on 1.5 PSP's, but how do you start it? It must be itself an encrypted program and there is no way to encrypt it, because you need the private key, which only Sony has.


There is no need to write a new elf loader for 1.5.


full control of 1.0 ----> disasmble the 1.0 elf loader ----> know how 1.0 loads the 1.5 updater ----> decrypt the 1.5 updater ----> know what the updater do to the 1.0 system ----> know what the 1.5 elf loader is ----> know how to encrypt elfs to fit the 1.5 elf loader

That is what I thought. Once knowing how to let code run on 1.5, there is no need to write new loader to replace the 1.5 official one.

edit and add:

There may be shortcuts. It is quite possible that 1.5 and the 1.0 use the same encrypt method, and 1.5 loader just does not let the unencrypted elf run.
Back to top
View user's profile Send private message MSN Messenger
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Jun 11, 2005 9:45 pm    Post subject: Reply with quote

As shine pointed out unless you can get the encrytion key (whether symmetric or asymmetric is doesn't really make a difference) then knowing how the psp loads a file is close to irrelevant.

It is certainly the case that with access the kernel mode you will be able decrypt existing PSP files (once you find the appropriate routines to do it) but that doesn't mean you will be any closer to encrypting your own file. But that said if that happened there would be little Sony could do to stop our software running on any PSP.

I would definetly say that the 1.5 uses the exact same encryption and the exact same key as it is going to be hardware based, no firmware update would change that, They also cannot (easily) just change it in later hardware revisions as that would break existing software on UMD.
Back to top
View user's profile Send private message
konfig



Joined: 06 Jan 2005
Posts: 68

PostPosted: Sat Jun 11, 2005 10:00 pm    Post subject: Reply with quote

edit:
I've carefully read the above again. I think I know what you means.
But I don't understand why symmetric/asymmetric makes no difference.
As the text referenced, is the decryption key also the encryption key?


original:
I am not an expert on AES encrypt method. But I read some basic matters about the AES. Here's some important words:


"AES is a symmetric encryption algorithm processing data in block of 128 bits. A bit can take the values zero and one, in effect a binary digit with two possible values as opposed to decimal digits, which can take one of 10 values. Under the influence of a key, a 128-bit block is encrypted by transforming it in a unique way into a new block of the same size. AES is symmetric since the same key is used for encryption and the reverse transformation, decryption. The only secret necessary to keep for security is the key."


So I think now if we can decrypt data, we can also encrypt it.
I don't know if it is right. Please tell me if I am wrong.


Last edited by konfig on Sat Jun 11, 2005 10:17 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sat Jun 11, 2005 10:06 pm    Post subject: Reply with quote

konfig wrote:
So I think now if we can decrypt data, we can also encrypt it.
I don't know if it is right. Please tell me if I am wrong.


You are wrong. Try Google for public/private key encryption and read something about this.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Jun 11, 2005 10:15 pm    Post subject: Reply with quote

Of course if you can get the key you can encrypt the file as well, but this is the point we are trying to make and I will only say it once ;)

If, as is very very likely, there is hardware in the psp to do the encryption then it is also likely that the key is stored in hardware. Now a simplistic interface sony could have provided is you send a block of data and it will process it. In the decryption case it will obviously decrypt the block and return it to the user. You never see the key itself just the end result. Now you can imagine that the likelyhood Sony would have also added an encrypt facility as well to be pretty low (though never say never).

Now these types of systems can be broken, I seem to recall a IBM ATM box being tricked into giving out it's keys, and it might be feasible to do similar here but I think it is unlikely. The other method some people like to talk about is taking the top off the chips and running they under a microscope to read out the key. While this is a relatively trivial process if you are talking about a few kb of rom (which is easily identifiable) a 256 bit key hidden inside some custom hardware would not be and might require extensive reverse engineering. Still not impossible but very very difficult.

Of course this is even supposing they are using a symmetric key :)
Back to top
View user's profile Send private message
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Sat Jun 11, 2005 10:20 pm    Post subject: Reply with quote

"Now you can imagine that the likelyhood Sony would have also added an encrypt facility as well to be pretty low (though never say never). "

Savegames?

0xdf
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Jun 11, 2005 10:26 pm    Post subject: Reply with quote

If you believe Sony would be stupid enough to use the same key for both executables and savegames then you must be slightly mad ;)

Of course would be amused if proven wrong.
Back to top
View user's profile Send private message
Danj



Joined: 15 May 2005
Posts: 70
Location: Peterlee, DURHAM, UK

PostPosted: Sat Jun 11, 2005 10:30 pm    Post subject: Reply with quote

0xdeadface wrote:
"Now you can imagine that the likelyhood Sony would have also added an encrypt facility as well to be pretty low (though never say never). "

Savegames?

0xdf


Has anyone actually found out how savegames are encrypted yet? It seems to me that this knowledge might not only be useful for homebrew (i.e. finding a savegame related exploit) but also for utilities on the PC to allow management and editing of save games.
_________________
Dan Jackson
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Sat Jun 11, 2005 10:33 pm    Post subject: Reply with quote

"If you believe Sony would be stupid enough to use the same key for both executables and savegames then you must be slightly mad ;) "

Maybe not same key, but it might tell more about the encryption in general?

I must admit I have no knowledge whatsoever about encryption.

0xdf
Back to top
View user's profile Send private message
konfig



Joined: 06 Jan 2005
Posts: 68

PostPosted: Sat Jun 11, 2005 10:49 pm    Post subject: Reply with quote

TyRaNiD wrote:
Of course if you can get the key you can encrypt the file as well, but this is the point we are trying to make and I will only say it once ;)

If, as is very very likely, there is hardware in the psp to do the encryption then it is also likely that the key is stored in hardware. Now a simplistic interface sony could have provided is you send a block of data and it will process it. In the decryption case it will obviously decrypt the block and return it to the user. You never see the key itself just the end result. Now you can imagine that the likelyhood Sony would have also added an encrypt facility as well to be pretty low (though never say never).

Now these types of systems can be broken, I seem to recall a IBM ATM box being tricked into giving out it's keys, and it might be feasible to do similar here but I think it is unlikely. The other method some people like to talk about is taking the top off the chips and running they under a microscope to read out the key. While this is a relatively trivial process if you are talking about a few kb of rom (which is easily identifiable) a 256 bit key hidden inside some custom hardware would not be and might require extensive reverse engineering. Still not impossible but very very difficult.

Of course this is even supposing they are using a symmetric key :)



Tnank you. I now understand the situation.

I've seen many threads here before about finding key in the software. So I thought key was stored in software.

As you said, if the key is stored in some hardware rom, it is hard to get. What's more, if sony put the encryption/decryption method and the key altogether, turn them into a custom chip(a full hardware chip, no rom needed. Or even not in the form of a chip, just some unshaped circuit), Could we never do homebrew on it?
Back to top
View user's profile Send private message MSN Messenger
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Jun 11, 2005 10:55 pm    Post subject: Reply with quote

Well because the encryption is still under software control as long as you can get code running in another way (game exploit or even kernel) then things like checking for encrypted executables can just be patched out.

But who knows what the future holds.
Back to top
View user's profile Send private message
konfig



Joined: 06 Jan 2005
Posts: 68

PostPosted: Sat Jun 11, 2005 11:21 pm    Post subject: Reply with quote

If sony really uses 128bit AES on elf, and we really take full control of the 1.0 psp. We can give the 1.0 psp an unencrypted elf and tell the psp it is an encrypted file, let psp 'decrypt' the file and write the data to ms for us.

Because encryption and decryption key is the same, 'decrypt' the original data is equal to encrypt it.

Maybe though this way we can let the 'decrypted' elf run on 1.5? -- if AES, and key not change from 1.0 to 1.5.

edit:
Key could not change due to backwards software compatibility.
Back to top
View user's profile Send private message MSN Messenger
Guest






PostPosted: Sat Jun 11, 2005 11:57 pm    Post subject: Reply with quote

If I remember correct with respect to symmetric encryption, that won't work.

decrypt(a) != encrypt(a)

Even though it is true that:
a == decrypt(a_encrypted) == encrypt(a_decrypted)

The reason being that though the encryption (here "decryption" is a synonym for encryption, just in the opposite direction) is symmetric both directions, the results of both directions of encryption are not the same.

What you are suggesting results in this when the psp tries to decrypt it
-- decrypt(decrypt(a))
rather than the
-- encrypt(decrypt(a))
you were hoping for.
Back to top
Marco_N



Joined: 29 May 2005
Posts: 46

PostPosted: Sun Jun 12, 2005 6:30 am    Post subject: Reply with quote

konfig wrote:
If sony really uses 128bit AES on elf, and we really take full control of the 1.0 psp. We can give the 1.0 psp an unencrypted elf and tell the psp it is an encrypted file, let psp 'decrypt' the file and write the data to ms for us.


So far, just feeding the PSP an encrypted prx to decrypt would be a major milestone IMHO.
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
Goto page 1, 2  Next
Page 1 of 2

 
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