Go Back  
Reply
 
Thread Tools
Old 01-27-2013   #91
anaria
Homebrew Developer
 
anaria's Avatar
 
Join Date: Feb 2009
Posts: 80
Likes: 34
Liked 93 Times in 27 Posts
Mentioned: 16 Post(s)
Tagged: 0 Thread(s)
Originally Posted by jamesst20 View Post
I will also provide you something to byte reverse the dump

Edit : There you go : http://pastebin.com/QfKc12s3 (I'm not the author, I don't do C but C++). It's poorly written but works
Edit 2 : Cleaned a bit the code and made it easier to use. Works with C/C++ by now http://pastebin.com/y20HuRAZ but still dirty
Edit 3 : Rewrote it entirely, didn't like the old dirty way. I don't think it's gonna work in C but yeah should be pretty easy to port it for you : http://pastebin.com/6mjZBSWJ

Edit 4: On what Platform are you codding for ? I have no such include #include <unistd.h> in Windows
I've started coding on a Mac but my screen is dead so I'm also using cygwin to debug it on a PC, if I've not coded it too badly it should compile easily on any POSIX like platfrom, you may find short notes in earliest posts.
The only thing I've done to have it compile and run easily under windows and not only with cygwin was to redefine the mkdir so it can be built with MinGW32.

Last edited by anaria; 01-27-2013 at 08:22 PM. Reason: Typo
anaria is offline   Reply With Quote
Old 01-27-2013   #92
jamesst20
Member
 
Join Date: Jan 2011
Posts: 224
Likes: 24
Liked 27 Times in 20 Posts
Mentioned: 10 Post(s)
Tagged: 0 Thread(s)
Originally Posted by anaria View Post
I've started coding on a Mac but my screen is dead so I'm also using cygwin to debug it on a PC, if I've not coded it too badly it should compile easily on any POSIX like platfrom, you may find short notes in earliest posts.
The only thing I've done to have it compile and run easily under windows nad not only with cygwin was to redefine the mkdir so it can be built with MinGW32.
Alright Have you seen my last edit for the byte reversing? Should be easy for you (hopefully) to port it.

Also, i'm trying to avoid modifying all you have done on NorDumpTool.c. The way I would like it is that everytime you update it, I just need to fully copy/paste your new code from github and if needed I will fix my work wheter you have changed something that require some changes. From that said, would you mind making your code in a way that I just need to call some functions to get the Nor informations? Like a getStatistics() that would return an array [0] --> Bytes '00', [1] --> Bytes 'FF' etc.. or do it the way you wish :P, a isByteReversed(), something for the generic data (a boolean?), anything else needed so I only need to create a header file (.h) to use your class

Thanks you sir and if you disagree, I would understand but keep in mind that would just make everything else simplier after
jamesst20 is offline   Reply With Quote
Old 01-27-2013   #93
anaria
Homebrew Developer
 
anaria's Avatar
 
Join Date: Feb 2009
Posts: 80
Likes: 34
Liked 93 Times in 27 Posts
Mentioned: 16 Post(s)
Tagged: 0 Thread(s)
@jamesst20 , Yep I saw your post and codes, I'll give it a shot a bit later.

I'm in pain reading again and again all NOR offsets and checking if each areas are variable/static data or empty (00 or FF), and make sure the code covers as much as possible of the 16777216 bytes of the NOR, for now even if it checks the most important parts, it in fact checks only 31.81% of pure bytes.

I'll then include a byte swapping routine later but may not include it in the 0.9.6, don't know yet.

And as for the integration of this code in your own, I will not take time to introduce this changes for now, what I was thinking of, was more about having a GUY which knows each options (-P, -F and so on) execute the binary and then parse the output to eventually fill up some fields in the GUI itself, similar to what have been done with the scetool or some others.

I know that I've been too lazy to make it more flexible and only wrote one big C file instead of splitting it in headers and C, I'll do that later which will help you if you want to have only one app instead of a gui calling a binary.

Also if you use GitHub and fork the project you'll get all diff each time I do some changes which will make it definitely easier for you to build your code. Finaly as you can see my app is very basic (read file->do something->printf whatever) and so very simple to adapt those printf into sprintf or anything nicer

Last edited by anaria; 01-27-2013 at 08:27 PM. Reason: Ahhhhh Frenchies writing English... a big moment in your life :P
anaria is offline   Reply With Quote
Old 01-27-2013   #94
zecoxao
Member
 
zecoxao's Avatar
 
Join Date: Oct 2011
Posts: 718
Likes: 396
Liked 720 Times in 279 Posts
Mentioned: 116 Post(s)
Tagged: 0 Thread(s)
if i'm not mistaken, the type of byteswap used is byteswap 16 (16 bytes) in that case, naehrwert has published his ps3_hdd POC tool which includes the function in a clean and tidy way of his

lemme see if i can fetch it.

https://dl.dropbox.com/u/35197530/types.h

Code:
#include "types.h"

/*! Swap u16 endianness. */
static void _es16_buffer(u8 *buf, u32 length)
{
	u16 *ptr = (u16 *)buf;
	u32 i;

	for(i = 0; i < length/2; i++)
		ptr[i] = _ES16(ptr[i]);
}
__________________
"Whoever has ears, let them hear."

Last edited by zecoxao; 01-27-2013 at 08:59 PM.
zecoxao is online now   Reply With Quote
Likes: (2)
Old 01-27-2013   #95
jamesst20
Member
 
Join Date: Jan 2011
Posts: 224
Likes: 24
Liked 27 Times in 20 Posts
Mentioned: 10 Post(s)
Tagged: 0 Thread(s)
Originally Posted by anaria View Post
@jamesst20 , Yep I saw your post and codes, I'll give it a shot a bit later.

I'm in pain reading again and again all NOR offsets and checking if each areas are variable/static data or empty (00 or FF), and make sure the code covers as much as possible of the 16777216 bytes of the NOR, for now even if it checks the most important parts, it in fact checks only 31.81% of pure bytes.

I'll then include a byte swapping routine later but may not include it in the 0.9.6, don't know yet.

And as for the integration of this code in your own, I will not take time to introduce this changes for now, what I was thinking of, was more about having a GUY which knows each options (-P, -F and so on) execute the binary and then parse the output to eventually fill up some fields in the GUI itself, similar to what have been done with the scetool or some others.

I know that I've been too lazy to make it more flexible and only wrote one big C file instead of splitting it in headers and C, I'll do that later which will help you if you want to have only one app instead of a gui calling a binary.

Also if you use GitHub and fork the project you'll get all diff each time I do some changes which will make it definitely easier for you to build your code. Finaly as you can see my app is very basic (read file->do something->printf whatever) and so very simple to adapt those printf into sprintf or anything nicer
Alright for this alternative too That would be a lot easier I guess
When you say it only checks for 31.81% of pure bytes, you mean that the rest is what is determined by all of your struct which are assumed ?
jamesst20 is offline   Reply With Quote
Old 01-28-2013   #96
anaria
Homebrew Developer
 
anaria's Avatar
 
Join Date: Feb 2009
Posts: 80
Likes: 34
Liked 93 Times in 27 Posts
Mentioned: 16 Post(s)
Tagged: 0 Thread(s)
@jamesst20 , this current % represent for today what is really read from the dump and checked.
The missing 68.xx % are all part for which I did not finish to write offsets length and so on, like in ros0/1 you have a lot of data but depending if you get a dump from a PS3 under OFW or CFW all can change, and then you can analyse by many ways like doing MD5 if you have a database for each OFW, but for CFW that's no use, so what I'm doing for this is adding routines to read the each ros TOC so I can analyse each files in it or eventually just their MD5 (bad idea if CFW), at least I need to check if there are data where they're supposed to be, it will then increase the % of bytes covered, it may be quite impossible to reach 100%, but what I'm work on is to be sure to meet as close as possible all what guys gave us on the ps3devwiki.

Last edited by anaria; 01-28-2013 at 03:22 AM. Reason: Typo and re-phrase
anaria is offline   Reply With Quote
Likes: (1)
Old 01-28-2013   #97
guerrierodipace
Member
 
Join Date: Mar 2008
Location: Italy
Posts: 97
Likes: 38
Liked 15 Times in 10 Posts
Mentioned: 7 Post(s)
Tagged: 0 Thread(s)
Send a message via Skype™ to guerrierodipace
Originally Posted by anaria View Post
@guerrierdipace, below words are not aimed against you, it's a general way of speaking.

CUT
I am not sure to understand...english isn't my native language. That code is reversed for my knowledge and published not by me. I just reported here.
guerrierodipace is offline   Reply With Quote
Old 01-28-2013   #98
anaria
Homebrew Developer
 
anaria's Avatar
 
Join Date: Feb 2009
Posts: 80
Likes: 34
Liked 93 Times in 27 Posts
Mentioned: 16 Post(s)
Tagged: 0 Thread(s)
Originally Posted by guerrierodipace View Post
I am not sure to understand...english isn't my native language. That code is reversed for my knowledge and published not by me. I just reported here.
What I was trying to say is that even if I appreciate your report and I'm happy you did, I'm just worry about seeing a source code if the author did not publish it himself, in other words I do not want to use some code if there is a risk for it to be stolen.

But reverse Engineering is a different thing, if it's the case it can considered differently.

And so as I knew I would write a lot of stuff I wanted first to ensure that you do not take it for yourself, I just got upset after finding some thread in that other forum...
anaria is offline   Reply With Quote
Old 01-28-2013   #99
Dartban214
Member
 
Join Date: Dec 2012
Posts: 160
Likes: 45
Liked 17 Times in 17 Posts
Mentioned: 10 Post(s)
Tagged: 0 Thread(s)
I know I sound like an ass but I'd try to create a header file or two(Keeps it nice and neat in my opinion). But VERY interesting....

You have a very good code process(VERY neat). I'm not very good at C but I can understand it with the C++ I know. May have to see if I can convert it later.
__________________
Noobs Look here for downgrade help:Ultimate Fool Proof Guide: Ps3 Hardware downgrading

NOTE: READ THE WARNING! THIS GUIDE IS CURRENT AS OF 12/23/2012
Dartban214 is offline   Reply With Quote
Old 01-28-2013   #100
anaria
Homebrew Developer
 
anaria's Avatar
 
Join Date: Feb 2009
Posts: 80
Likes: 34
Liked 93 Times in 27 Posts
Mentioned: 16 Post(s)
Tagged: 0 Thread(s)
Originally Posted by Dartban214 View Post
I know I sound like an ass but I'd try to create a header file or two(Keeps it nice and neat in my opinion). But VERY interesting....

You have a very good code process(VERY neat). I'm not very good at C but I can understand it with the C++ I know. May have to see if I can convert it later.
No pb, I welcome all comments.

That's quite interesting, I've always been thinking of C being ten times easier to read than C++, even if you may need more lines in C than C++ to do the same thing!?

I agree that it may be better to split it into .h and .c, but I did not put that on my priority list
anaria is offline   Reply With Quote
Likes: (1)
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



PS3Hax.net is Copyright © 2010-2013.
Use of this site is governed by our Terms of Use and Privacy Policy. All Trademarks and images are owned by their respected owners.
Posts and links are subject to each author on this forum and are no way affiliated with the operations and/or opinions of ps3hax.net
All times are GMT -5. The time now is 06:33 PM.