PSX-SCENE Forum Discussion for Sony PlayStation/PsOne/PS2/PS3/PSP/PS VITA
  • Slynk’s: PS3 IDA Tutorial + NPDRM Basic Info

    Slynk, the developer who has been working on QA Flagging, has released some interesting info this weekend. He has released some info regarding NPDRM, which is the security employed on PSN content. In addition he has posted a tutorial regarding IDA, which is software used in reverse engineering.

    Attachment 1284

    NPDRM Basic Info


    I’d like to begin this post with a few comments.

    1. Only a little bit of this is my own findings, a lot of this info was found from other sources.
    2. NPDRM discussion does not have to be a topic of piracy, it can be used in conjunction with signing/encrypting homebrew if it is fully documented one day.
    3. This is mostly to bring together the bits of info scattered across the interwebs.


    NPDRM Types

    NP 3 is a free licensed app. It has no license check. No edata/riff. Just install and use. This can be trial software as well.

    NP 2 is a locally licensed app. First time activation must take place online. After which you’ll have an edata/riff for that app and somehow this is connected to your act.dat.

    NP1 is a network licensed app. It requires network authentication every time it is launched.

    The offset for determining the NPDRM type of a self is at the NPDRM Header offset + 0x1C.



    NPDRM Security

    NPDRM as well as edata use AES, ECDSA, and CMAC for authenticity. These keys, with the exception of the CMAC key, are out there in the ether and can be found without much effort for someone who knows what they’re doing. The specifics of the algorithm are still being researched but a few people have already figured it out; but of course they won’t share their info.

    AES and ECDSA are handle by appldr like always. CMAC is handle by one of vsh’s modules. (Don’t know which one, just adding it for completeness.)

    Another form of security used in NPDRM is called a k_license. This is a 16 byte key that the developer makes that functions as sort of a “project key”. It’s used in all npdrm encrypted files within the project to prevent one of the files from being replaced by another project’s file. It is also referred to as an SCE NPDRM Key.



    NPDRM Header

    The current known structure of the NPDRM Header:

    Code:
    typedef struct
    {
        byte[4] block_type;  // this is 3(NPDRM)
        byte[4] block_size;  // this is 0x90(sizeof(Self_NPDRM))
        byte[4] unknown1;    // So far always 0
        byte[4] unknown2;    // So far always 0
        byte[4] magic;       // 0x4E504400(NPD)
        byte[4] unknown3;    // So far always 1
        byte[4] license;     // 1 Network License, 2 Local License, 3 Free
        byte[4] type;        // 1 Executable, 21 Update for Disc Based Game
        byte[2] titleid[0x30];
        byte[2] hash_unknown[0x10];
        byte[2] hash1[0x10];
        byte[2] hash2[0x10];
        byte[2] padding[0x10];
    ** Self_NPDRM
    I hear there’s plenty of more info in the official sdk for anyone who legally owns it as well. Anyway, I’ll post more if anything else comes to light. ^^

    PS3 IDA Tutorial

    First off, will not help you obtain a copy of IDA. Go buy it.


    http://www.mediafire.com/?kb3s14zi6hramrx


    Extract the contents into your IDA folder. I don’t take credit for these plugins and loaders.



    Loading a File

    There are two file types I’ll teach you to load. SPU and ELF files.
    SPU files can only loaded in IDA 32bit mode. When you load IDA choose “Go” and drag the file onto IDA. Make sure elf is highlighted at the top. In processor type, choose “IBM SPU Cell Processor: spu.” Click set. Click OK. “Undefined or unknown…blabla” yes. You should be good to go.

    Elf files can be loaded in either 32 or 64 bit mode. When you load IDA choose “Go” and drag the file onto IDA. Make sure PlayStation 3 ELF is highlighted at the top. Don’t mess with the processor type. Kernel option 1 check “Create function if data xref data-> code32 exists.

    Optional: I don’t know what these do but I turn them on anyways XD In kernel option 2 choose “Coagulate data segments in the final pass”, “Perform ‘no-return’ analysis”, and “Perform full stack pointer analysis.”

    Click OK. Sometimes you get a better result from running the analyze_self script. (File->IDC File->C:/Program Files/IDA/idc/analyze_self.idc) Hit yes, copy the TOC Address it shows you and click OK. Go to Options->General->Analysis->Processor specific analysis options. Type the TOC address in (I use 0: instead of 0x to be safe. No clue if it makes a difference.) While you’re at it click “Create subi instructions. Click OK. Click Reanalyze Program. Click OK. And wait.

    You’ll know when a script is done because at the bottom left it’s say “AU: idle”.



    IDA Basics

    Just a few things. The program is expansive and I’d love to get to know more about it but here’s a few things I know. Hex view and IDA view are connected. That means if you find a string in hex view, you can see it in IDA view. This won’t show you magically where it’s used at but sometimes, that string is xrefed. If under the string you see “# DATA XREF: ” you can right click the “:off_XXXX” at the end, and choose XREF To or From. To, will give you a graph of any functions that have a call “to” that offset. From give’s a graph of offset’s called “from” that offset (mostly only useful for viewing a graph of where all a function leads to.)


    In IDA view, you can search for either an immediate value, a string, or a byte sequence. I’ve never “not” checked “find all occurrences.” Don’t know why you wouldn’t want to. It’ll return a list of occurrences in its own window.
    If you’re lucky, the file you scanned will have some of the functions named (something other than sub_, nullsub_, or start). These are known functions that are defined in the ps3 sdk.

    When exiting, always make sure, unless you WANT to re analyze the whole file again, to choose one of the Pack database options and Collect garbage.


    Comments 21 Comments
    1. BobTheTroll's Avatar
      BobTheTroll -
      First. I'm not 12 years old but it is fun to be 1st. LOL.
    1. One2thr456svn's Avatar
      One2thr456svn -
      Ok this looks to be good (a little bit beyond my area of expertise) anything that can progress the movement
    1. alrod62's Avatar
      alrod62 -
      Quote Originally Posted by BobTheTroll View Post
      First. I'm not 12 years old but it is fun to be 1st. LOL.
      You are The First *********!!!

      Anyone can explain me this post???
    1. badkiller2-PSG's Avatar
      badkiller2-PSG -
      I don't care if people will use this for Piracy or not, Just keep this scene active people!!

      This news might lead to us Having access to PS Store I presume??
    1. TWITDADDY's Avatar
      TWITDADDY -
      Quote Originally Posted by BobTheTroll View Post
      First. I'm not 12 years old but it is fun to be 1st. LOL.
      your not 12 YET i presume
    1. god-PSG's Avatar
      god-PSG -
      Quote from article, "The specifics of the algorithm are still being researched but a few people have already figured it out; but of course they won’t share their info."

      BS, if someone figured it out, it'd be out, this is what is wrong with this scene, they are way over their head with Sony's security that they need to lie to keep hope alive. Here's what I figured out, you amateurs haven't figured out sh*t in months.
    1. kootari's Avatar
      kootari -
      BobTheTroll - 1 Hour Ago 10:32 AM

      First. I'm not 12 years old but it is fun to be 1st. LOL.

      No your not twelve but your not helping the thread either. DONT quote unless its valid info or at least a question.

      Like mine.... What is all this and what does it mean. Seems like its a program that can derypt the ps3 and its usages? being able to read calls and see where they go. IE for making Homebrew or figuring ways around DRM? am i close.?
    1. badkiller2-PSG's Avatar
      badkiller2-PSG -
      Quote Originally Posted by god View Post
      Quote from article, "The specifics of the algorithm are still being researched but a few people have already figured it out; but of course they won’t share their info."

      BS, if someone figured it out, it'd be out, this is what is wrong with this scene, they are way over their head with Sony's security that they need to lie to keep hope alive. Here's what I figured out, you amateurs haven't figured out sh*t in months.
      O Lord of us humble servants, please teach us then, how to open and utilize thy mystery known as thy PS3!....

      Just because you nicknamed yourself God, It doesn't give you right to badmouth hardworking developers. Besides, people do figure out how to beat SONY, some are probably already online on PSN with CFW but refuse to show the method as to not to lose their loophole. People like Mathieulth, Who likes to show off but not do Crapdung to help others.
    1. wearhat4life's Avatar
      wearhat4life -
      thank you slynks, its about time somebody made some kind of tutorial.

      Thanks for Keep the Community Open!
    1. god-PSG's Avatar
      god-PSG -
      Quote Originally Posted by badkiller2 View Post
      O Lord of us humble servants, please teach us then, how to open and utilize thy mystery known as thy PS3!....

      Just because you nicknamed yourself God, It doesn't give you right to badmouth hardworking developers. Besides, people do figure out how to beat SONY, some are probably already online on PSN with CFW but refuse to show the method as to not to lose their loophole. People like Mathieulth, Who likes to show off but not do Crapdung to help others.
      Proof? You're just like them, you're blowing air and when you do it smells. Whatever you do, when the top spot is empty and there is an opportunity to take it, you take it. With Hotz gone, the belt is there for the taking, everyone says Mathieulth is a contender but he's been trash talking this whole time, he's contributing to hacking the PS3 as much as I am right now, but there you are on the corner of the street calling me wrong and praising his truth (actually, your subjective truth, objectively a lie). I don't believe without proof, that's why my name is God, I don't exist. Everything you say is hearsay and belief based, don't bring me into the equation, I'm irrelevant, and it doesn't change the fact that those devs haven't found the 3.60 keys and hereby "haven't done sh*t in months", 'cuz trying isn't enough.
    1. laylow2828-PSG's Avatar
      laylow2828-PSG -
      all this is great news!! but unfortunately theres not alot of devs working on stuff like this because if there were there would have been alot more findings. and maybe even an answer to this problem already. if Math wasn't such a c o c k ... this seen would be rockin n rollin!!! but as it stands he's not for the people. he's all about self!!! kudo's to the devs that are still doing something...
    1. alzaabi-PSG's Avatar
      alzaabi-PSG -
      this is good news but it is difficult for ordinary people to understand how to use it
      any help ,,
    1. medi01-PSG's Avatar
      medi01-PSG -
      IDA with Cell support costs about 10 000$.
      Guess how many devs have actually bought it.
    1. CoModA's Avatar
      CoModA -
      Quote Originally Posted by TWITDADDY View Post
      your not 12 YET i presume
      hehehe! thats a good 1
    1. stussy's Avatar
      stussy -
      Quote Originally Posted by CoModA View Post
      hehehe! thats a good 1

      +1 that is a good one
    1. videogamerevie81's Avatar
      videogamerevie81 -
      3.65 CFW please............................................ ....
    1. BobTheTroll's Avatar
      BobTheTroll -
      Quote Originally Posted by TWITDADDY View Post
      your not 12 YET i presume
      LOL. Naw I'm 30. Good dis though dude.
    1. zxz0O0's Avatar
      zxz0O0 -
      How would we need this for piracy? We don't even know the NPDRM key
    1. Blade86-PSG's Avatar
      Blade86-PSG -
      Great work!! These devs today are awesome.

      We finally could reactivate our DLC and a LOT more
      (I dont think I'm the only one who lost all contents after hdd-swap)

      Cheers
      Blade

      P.S.:

      Quote Originally Posted by zxz0O0 View Post
      How would we need this for piracy? We don't even know the NPDRM key
      My english is too bad, but I think its the right word would be "discretion".
      This is not the right place for piracy...
    1. hfm's Avatar
      hfm -
      Quote Originally Posted by medi01 View Post
      IDA with Cell support costs about 10 000$.
      Guess how many devs have actually bought it.
      Where does this figure come from? The price on IDA site is 1059 USD for the advance version with support for all processors covered by IDA.
  • Daily Digest


    Want to receive the latest PSX info in your email?

    Sign up for our Daily Digest!



    Want to learn more about the team keeping you up to date with the latest scene news?

    Read about them now!

    Check out our Developer bios, too!

  • Recent Threads

    lordsnipe

    Free MC Boot 1.8b - 75004 PAL - Black Screen

    Thread Starter: lordsnipe

    Hi all,

    I'm new to this Free MC Boot, but have come across an issue that hopefully someone can help out with.

    I have two PS2s

    Last Post By: lordsnipe Today, 08:24 PM Go to last post
    DaBOSS54320

    Tutorial for using E3 flasher without limited edition.

    Thread Starter: DaBOSS54320

    I have necessary items to use the flasher, however tutorials i found used the limited edition, with the station thing you put your hard drive into. i

    Last Post By: DaBOSS54320 Today, 08:09 PM Go to last post
    DSAPSX

    Backwards compatibility for Xbox One is a waste?

    Thread Starter: DSAPSX

    I don't understand the choice of words that Microsoft used regarding backwards compatibility. I understand what they are saying but doesn't it just seem

    Last Post By: tthousand Today, 08:30 PM Go to last post
    ANTZ7

    my ps3 is sort of stuck on bluescreen

    Thread Starter: ANTZ7

    i bought a ps3 that when turned on just shows blue screen on both hdmi/scart

    so took it apart and installed e3 flasher did all the usual

    Last Post By: ANTZ7 Today, 06:24 PM Go to last post
    Villsson

    Problems with multiman 4.40

    Thread Starter: Villsson

    Hello everybody.

    First of all SORRY MY BAD ENGLISH!

    And second: I don't know is this the right place for this.

    Last Post By: Villsson Today, 06:19 PM Go to last post
    classified

    resident evil 6 cheat save patch help

    Thread Starter: classified

    im looking for information on how to get the cheats from bruteforce save data patch on resident evil 6 to work.
    Every time I try it says damaged

    Last Post By: classified Today, 05:31 PM Go to last post
  • Recent Comments

    STLcardsWS

    {Guide} Install multiMAN Themes via a PKG File

    condorstrike.

    There is nothing new about this. Sometime its good for a refresher or good for... Go to last post

    STLcardsWS Today 08:13 PM
    Jay-Jay

    {Guide} Install multiMAN Themes via a PKG File

    @condostrike, perhaps because you are way ahead of everyone else, they are barely getting to that... Go to last post

    Jay-Jay Today 07:51 PM
    condorstrike

    {Guide} Install multiMAN Themes via a PKG File

    I don't get this, what's new about it?, theme Pkgs have been around since i used to make them, and... Go to last post

    condorstrike Today 07:39 PM
    jamile131

    {Guide} Install multiMAN Themes via a PKG File

    Thank you all'm from Brazil, so I got to thank accompany the forum awhile sorry my English... Go to last post

    jamile131 Today 06:39 PM
    makaveli07

    PSChannel v1.10 Released - Added Language Support

    Hey guys im on Rogero 4.40 V1.3 and i was wondering if anyone can help me out i keep getting... Go to last post

    makaveli07 Today 04:15 PM
    BahumatLord

    Sony's Testing a Better, Faster Video Streaming Technology.

    I never said they should do it for free. I said they should either use newer movies for the test... Go to last post

    BahumatLord Today 02:49 PM
    barelynotlegal

    {Guide} How to make themes for multiMAN

    cant wait to have some time to try. essentially we could mix n match themes and icons? Go to last post

    barelynotlegal Today 02:28 PM
    krytonic

    Sony's Testing a Better, Faster Video Streaming Technology.

    I have to say that his entire point stands. It's not free on Comedy Central and you can't just turn... Go to last post

    krytonic Today 10:25 AM
    RandQalan

    English Patch version for Dynasty Warriors Strikeforce 2 PSP.

    Remember the rules this can get you in trouble :mad: Go to last post

    RandQalan Today 08:02 AM
    Staylecrate

    English Patch version for Dynasty Warriors Strikeforce 2 PSP.

    It is on my dropbox account, PM or email me your email and I will share the folder, it's 1.5 gigs. Go to last post

    Staylecrate Today 07:51 AM