<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Redump Forum — UmdImageCreator]]></title>
	<link rel="self" href="http://forum.redump.org/feed/atom/topic/18432/" />
	<updated>2024-06-01T13:45:17Z</updated>
	<generator version="1.4.4">PunBB</generator>
	<id>http://forum.redump.org/topic/18432/umdimagecreator/</id>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/118008/#p118008" />
			<content type="html"><![CDATA[<p><a href="https://github.com/saramibreak/UmdImageCreator/releases/tag/v1.7">https://github.com/saramibreak/UmdImage … s/tag/v1.7</a><br />## v1.7 (2024-06-01)<br />- added: creating iso directory automatically<br />- changed: PATH_TABLE_RECORD_SIZE<br />- fixed: the memory stick size is overflowed</p>]]></content>
			<author>
				<name><![CDATA[sarami]]></name>
				<uri>http://forum.redump.org/user/12356/</uri>
			</author>
			<updated>2024-06-01T13:45:17Z</updated>
			<id>http://forum.redump.org/post/118008/#p118008</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/113506/#p113506" />
			<content type="html"><![CDATA[<p><a href="https://github.com/saramibreak/UmdImageCreator/releases/tag/v1.6">https://github.com/saramibreak/UmdImage … s/tag/v1.6</a><br />## v1.6 (2023-12-01)<br />- added: support to dump PFI.bin</p>]]></content>
			<author>
				<name><![CDATA[sarami]]></name>
				<uri>http://forum.redump.org/user/12356/</uri>
			</author>
			<updated>2023-12-01T14:38:56Z</updated>
			<id>http://forum.redump.org/post/113506/#p113506</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112600/#p112600" />
			<content type="html"><![CDATA[<p>Nice, works well for me so far.</p>]]></content>
			<author>
				<name><![CDATA[Edness]]></name>
				<uri>http://forum.redump.org/user/63195/</uri>
			</author>
			<updated>2023-10-12T10:16:00Z</updated>
			<id>http://forum.redump.org/post/112600/#p112600</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112596/#p112596" />
			<content type="html"><![CDATA[<p><a href="https://www.mediafire.com/file/905y99zq4ad5vzp/UmdImageCreator_test.7z/file">https://www.mediafire.com/file/905y99zq … st.7z/file</a><br />Added: support to dump PFI.bin</p>]]></content>
			<author>
				<name><![CDATA[sarami]]></name>
				<uri>http://forum.redump.org/user/12356/</uri>
			</author>
			<updated>2023-10-12T02:28:03Z</updated>
			<id>http://forum.redump.org/post/112596/#p112596</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112435/#p112435" />
			<content type="html"><![CDATA[<p>I&#039;m not sure, your guess is as good as mine.&nbsp; It could be one of the 0xF0 commands, or it could be something completely different.</p><p>Another note, I noticed the SCSI command whitelist in older FW revisions normally has 3 x int32 values per element, the 3rd one always seemingly being null.&nbsp; However FW 1.50 actually uses that 3rd value as a pointer to a string with the original command name.&nbsp; (In newer FW like 6.60 the array is 2x int8.)&nbsp; The command names for 0x00-0xC0 are pretty standard besides DVD-&gt;UMD replacements, but the 0xF0 command names without any associated function/NID could be useful too.<br /></p><div class="codebox"><pre><code>    {0x00, 0x01}, // TEST_UNIT_READY
    {0x03, 0x02}, // REQUEST_SENSE
    {0x12, 0x02}, // INQUIRY
    {0x1B, 0x01}, // START_STOP_UNIT
    {0x1E, 0x01}, // PREVENT_ALLOW_MEDIA
    {0x23, 0x02}, // READ_FORMAT_CAPACITIES
    {0x25, 0x02}, // READ_UMD_CAPACITY
    {0x28, 0x08}, // READ10
    {0x2B, 0x01}, // SEEK
    {0x34, 0x01}, // PREFETCH10
    {0x46, 0x02}, // GET_CONFIGURATION
    {0x4A, 0x02}, // GET_STAT_EVENT
    {0x55, 0x04}, // MODE_SELECT10
    {0x5A, 0x02}, // MODE_SENSE10
    {0xAD, 0x02}, // READ_UMD_STRUCTURE
    {0xB6, 0x04}, // SET_STREAMING
    {0xBB, 0x01}, // SET_SPEED
    {0xBD, 0x02}, // MECHANISM_STATUS

    {0xF0, 0x02}, // DETECT_UMD_PSP
    {0xF1, 0x08}, // READ_UMD_MKI
    {0xF2, 0x02}, // REPORT_CACHE
    {0xF3, 0x01}, // CLEAR_CACHE_INFO
    {0xF4, 0x02}, // GET_MEDIA_INFO
    {0xF5, 0x02}, // TEST
    {0xF6, 0x01}, // SET_ACCESS_LIMIT
    {0xF7, 0x01}, // SET_LOCK_LENGTH
    {0xF8, 0x01}, // SET_AREA_LIMIT
    {0xF9, 0x02}, // GET_ERROR_LOG
    {0xFA, 0x02}, // TEST_PI
    {0xFB, 0x04}, // TEST_PO
    {0xFC, 0x02}, // GET_ADJUST_DATA
    {0xFD, 0x04}, // SET_ADJUST_DATA</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Edness]]></name>
				<uri>http://forum.redump.org/user/63195/</uri>
			</author>
			<updated>2023-10-07T12:29:48Z</updated>
			<id>http://forum.redump.org/post/112435/#p112435</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112433/#p112433" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Edness wrote:</cite><blockquote><p>On PS2 the (DNAS) Disc ID is also 5 bytes long. </p></blockquote></div><div class="quotebox"><cite>Edness wrote:</cite><blockquote><p>PS3&#039;s Disc ID being 16 bytes long</p></blockquote></div><p>How do we get it?</p>]]></content>
			<author>
				<name><![CDATA[sarami]]></name>
				<uri>http://forum.redump.org/user/12356/</uri>
			</author>
			<updated>2023-10-07T09:52:55Z</updated>
			<id>http://forum.redump.org/post/112433/#p112433</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112406/#p112406" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>sarami wrote:</cite><blockquote><p>5 bytes = 40 bits. DVD has 40 bits key of CSS, so I&#039;ve expected that UMD also has some kind of 40 bits key (media key?).</p><p>SPK is SPecial Key? SPecific Key?</p></blockquote></div><p>Possible.</p><p>Another guess I have could be it&#039;s some form of Disc ID - Sony already has a unique ID for every disc on PS2 and PS3.&nbsp; (If not from the MKI command, maybe from another one.)<br />On PS2 the (DNAS) Disc ID is also 5 bytes long.&nbsp; And while currently on Redump only the first two bytes are removed due to being serialized/random, from my observations I&#039;m pretty sure it&#039;s supposed to be the first three bytes (see <a href="http://redump.org/disc/1097/">[PS2] <strong>Burnout Revenge (Europe, Australia) (En,Fr,De)</strong></a> as an example) followed by the region on the 4th byte (0x20 = Asia, 0x30 = USA, 0x40 = Europe etc.), making it 16.7 million unique Disc IDs for each game on PS2.<br />Likewise, PS3&#039;s Disc ID being 16 bytes long, the last 4 bytes are also removed for each entry, also followed by the region on the 5th byte (0x01 = Asia, 0x03 = USA, 0x04 = Europe etc.), making it theoretically 4.2 billion unique IDs per game.</p><p>With this in mind, I wouldn&#039;t be surprised if Sony also had some form of unique Disc ID for PSP, too.&nbsp; Although wouldn&#039;t the 0x08 written at buf[2] interfere with it?</p>]]></content>
			<author>
				<name><![CDATA[Edness]]></name>
				<uri>http://forum.redump.org/user/63195/</uri>
			</author>
			<updated>2023-10-06T15:04:29Z</updated>
			<id>http://forum.redump.org/post/112406/#p112406</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112400/#p112400" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>unsigned char bufSPK[0x4000] = {};
void* p1 = _sceUmdManSPKGetMKI();
memcpy(bufSPK, p1, 0x4000);</code></pre></div><p>It crashed by memcpy.</p><div class="quotebox"><cite>Edness wrote:</cite><blockquote><p>Normally it&#039;s supposed to just be a separate 5 byte buffer that&#039;s passed to the ReadMKI function anyway, so I&#039;m not expecting much to be written there.</p></blockquote></div><p>5 bytes = 40 bits. DVD has 40 bits key of CSS, so I&#039;ve expected that UMD also has some kind of 40 bits key (media key?).</p><p>SPK is SPecial Key? SPecific Key?</p>]]></content>
			<author>
				<name><![CDATA[sarami]]></name>
				<uri>http://forum.redump.org/user/12356/</uri>
			</author>
			<updated>2023-10-06T13:06:18Z</updated>
			<id>http://forum.redump.org/post/112400/#p112400</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112375/#p112375" />
			<content type="html"><![CDATA[<p>Hmm, can you memcpy the 0x4000 or 0x8000 bytes of data back from the SPKGetMKI address?&nbsp; It likely wrote something there and left the buffer for the function arg alone.&nbsp; Normally it&#039;s supposed to just be a separate 5 byte buffer that&#039;s passed to the ReadMKI function anyway, so I&#039;m not expecting much to be written there.</p><p>For good measure maybe also copy the data from the MKI address before memset&#039;ing it to 00, to see if there&#039;s already something there.</p>]]></content>
			<author>
				<name><![CDATA[Edness]]></name>
				<uri>http://forum.redump.org/user/63195/</uri>
			</author>
			<updated>2023-10-05T15:31:33Z</updated>
			<id>http://forum.redump.org/post/112375/#p112375</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112374/#p112374" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Edness wrote:</cite><blockquote><p>I am probably overthinking it, but do try the ReadMKI function with the SPKGetMKI address (if it allows you to write to kernel memory like that).  At worst it&#039;ll just blank out assembly instructions of the module and crash</p></blockquote></div><p>The result is no error and no crash but buffer is all zero bytes except buffer[2].</p>]]></content>
			<author>
				<name><![CDATA[sarami]]></name>
				<uri>http://forum.redump.org/user/12356/</uri>
			</author>
			<updated>2023-10-05T15:25:25Z</updated>
			<id>http://forum.redump.org/post/112374/#p112374</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112373/#p112373" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>sarami wrote:</cite><blockquote><div class="codebox"><pre><code>    void* p = _sceUmdManSPKGetMKI();</code></pre></div><p>p is 0x880f1240</p></blockquote></div><p>Looks like that is in kernel module address space 0x88000000-0x8837FFFF, <a href="https://hitmen.c02.at/files/yapspd/psp_doc/chap7.html#sec7.3">per documentation</a>.<br />This does make more sense than just plain 0x1C0, but now part of me wonders if this is a valid region of data that can be overwritten, or if this is just the offset of the module itself, indicating its base is at 0x880F1080.&nbsp; I am probably overthinking it, but do try the ReadMKI function with the SPKGetMKI address (if it allows you to write to kernel memory like that).&nbsp; At worst it&#039;ll just blank out assembly instructions of the module and crash <img src="http://forum.redump.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><p>Also, at first I couldn&#039;t find any mention of this MKI thing anywhere on the internet, but I just now stumbled upon <a href="http://uofw.github.io/upspd/docs/software/IdStorage%20keys%20and%20their%20uses%20+%20regeneration%20%5BTECHNICAL%20DISCUSSION%5D.html">an archived thread</a> that mentions &quot;UMD MKI&quot; once.&nbsp; Doesn&#039;t say what it stands for, but it&#039;s something.</p>]]></content>
			<author>
				<name><![CDATA[Edness]]></name>
				<uri>http://forum.redump.org/user/63195/</uri>
			</author>
			<updated>2023-10-05T13:59:47Z</updated>
			<id>http://forum.redump.org/post/112373/#p112373</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112372/#p112372" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Edness wrote:</cite><blockquote><p>could you try calling sceUmdManSPKGetMKI() on its own and print out what address it returns?</p></blockquote></div><div class="codebox"><pre><code>    void* p = _sceUmdManSPKGetMKI();</code></pre></div><p>p is 0x880f1240</p><div class="quotebox"><cite>Edness wrote:</cite><blockquote><p>sceUmdExecReadCapacityCmd() seems to be the only function that allows putting your own command as arg0, followed by the UMD drive as arg1 of course.</p></blockquote></div><p>Yes. I&#039;ve already comfirmed that this func can be called and succeeded.</p><div class="codebox"><pre><code>    unsigned char bufCapa[8] = {};
    res = _sceUmdExecReadCapacityCmd(0x25, pUmdDrive, 8, bufCapa);</code></pre></div><p>The result is here. (Dissidia 012: Duodecim Final Fantasy)<br /></p><div class="codebox"><pre><code> 00 0D 2C B0 00 00 08 00</code></pre></div><p>1st 4 bytes show total sectors. It matches redump db. 2nd 4 bytes show the block size in bytes. It&#039;s always 0x800.</p>]]></content>
			<author>
				<name><![CDATA[sarami]]></name>
				<uri>http://forum.redump.org/user/12356/</uri>
			</author>
			<updated>2023-10-05T13:30:59Z</updated>
			<id>http://forum.redump.org/post/112372/#p112372</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112369/#p112369" />
			<content type="html"><![CDATA[<p>I think the address has to be 0x1C0, it seems to be firmware hardcoded.&nbsp; <strong>sceUmdExecReadMKICmd()</strong> (and also <strong>sceUmdExecRead10Cmd()</strong>) both call a subroutine which contains a function named <strong>sceUmdManSPKGetMKI()</strong> - this always returns <strong>0x1C0</strong>.&nbsp; And after that, it calls another d-cache function <strong>sceKernelDcacheWritebackInvalidateRange(0x1C0, 0x4000)</strong>, arg0 coming from SPKGetMKI, and arg1 coming from 8 &lt;&lt; 11, the 8 coming from ReadMKI&#039;s arg2.</p><p>Without a debugger to see what exactly it&#039;s doing, it&#039;s hard to know if those addresses are relocated by the system or not.&nbsp; However, could you try calling <strong>sceUmdManSPKGetMKI()</strong> on its own and print out what address it returns?&nbsp; Maybe this will give an answer whether you truly have to put 0x1C0 or not.&nbsp; (And you could likely use the output of that to set up the ReadMKI call.)</p><p>----------</p><p>This is unrelated, but I did a bit more research about the SCSI commands that <strong>umdman.prx</strong> has functions for.&nbsp; Some firmware revisions have functions that send the commands <strong>0xA3</strong> and <strong>0xA4</strong>, but neither of them have any NIDs associated.&nbsp; And today I noticed what looks to be an array of whitelisted commands it can send.&nbsp; In addition to the FW NID map function I wrote a few replies back, it looks like it would allow commands <strong>0x00</strong>, <strong>0x23</strong>, <strong>0x25</strong>, <strong>0xA3</strong>, <strong>0xA4</strong>, <strong>0xB6</strong>, <strong>0xBB</strong>, and vendor specific commands <strong>0xF5</strong>, <strong>0xF9</strong>, <strong>0xFA</strong>, <strong>0xFB</strong>, <strong>0xFC</strong>, <strong>0xFD</strong>.&nbsp; None of these also have a specific NID-hashed function.</p><p>However, <strong>sceUmdExecReadCapacityCmd()</strong> seems to be the only function that allows putting your own command as arg0, followed by the UMD drive as arg1 of course.&nbsp; While I assume this is where you would normally put 0x23/0x25, I wonder if it would be possible to exploit and take advantage of this function to send other commands.&nbsp; Though there is no function that calls it in any firmware it looks like (checked 1.50, 3.52, 6.60), so knowing that it wants for arg2 and arg3 will need guesswork.<br />I&#039;ve edited the 3.70-6.60 NID map to also include this function commented with &quot;Any?&quot;</p>]]></content>
			<author>
				<name><![CDATA[Edness]]></name>
				<uri>http://forum.redump.org/user/63195/</uri>
			</author>
			<updated>2023-10-05T09:59:02Z</updated>
			<id>http://forum.redump.org/post/112369/#p112369</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112368/#p112368" />
			<content type="html"><![CDATA[<p>I tried it. _sceUmdExecReadMKICmd() succeeded but bufMKI is all zero bytes except bufMKI[2].<br /></p><div class="codebox"><pre><code>    unsigned char bufMKI[448] = {};
    bufMKI[2] = 8;
    
    char* p = (char*)(0x08800000);
    memset(p, 0x00, 0x8000);
    sceKernelDcacheInvalidateRange(p, 0x4000);
    
    res = _sceUmdExecReadMKICmd(pUmdDrive, bufMKI, 8, p);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[sarami]]></name>
				<uri>http://forum.redump.org/user/12356/</uri>
			</author>
			<updated>2023-10-05T09:31:24Z</updated>
			<id>http://forum.redump.org/post/112368/#p112368</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: UmdImageCreator]]></title>
			<link rel="alternate" href="http://forum.redump.org/post/112332/#p112332" />
			<content type="html"><![CDATA[<p>The ReadMKI function itself seems pretty large, and the preceding functions that call it are a bit all over the place too.&nbsp; It seems to take values from 2 functions above, the 1st of which calls the lower function that contains the ReadMKI call with (UMD drive, 0, 8, 0)</p><p>A 5 byte buffer is created on the stack, arg1 and arg2 being stored as int16s at 0x00 and 0x02, and arg3 as an int8 to 0x04.<br />If I am reading it correctly, you can just write <strong>0x08</strong> at buffer[0x2] and that&#039;s it.</p><p><strong>sceUmdExecReadMKICmd()</strong> is called with 4 arguments:<br /></p><ul><li><p><strong>$a0</strong> - UMD drive (as always)</p></li><li><p><strong>$a1</strong> - Pointer to the buffer</p></li><li><p><strong>$a2</strong> - Number 8 (from buffer[0x2])</p></li><li><p><strong>$a3</strong> - Number 448 (0x1C0)</p></li></ul><p>Overall, I would say this is it, if it weren&#039;t for some unusual calls between the buffer creation and the actual ReadMKI call.&nbsp; It calls <strong>memset(0x1C0, 0x00, 0x8000)</strong> - I&#039;m not sure if 0x1C0 a valid address.<br />And right after that, it calls <strong>sceKernelDcacheInvalidateRange(0x1C0, 0x4000)</strong>, (the 2nd arg being 8 (from arg2) &lt;&lt; 11 = 0x4000), implying the address 0x1C0 is somewhere in the CPU data cache region?&nbsp; No idea.<br />Does that also mean it expects you to get the output back from d-cache too?</p>]]></content>
			<author>
				<name><![CDATA[Edness]]></name>
				<uri>http://forum.redump.org/user/63195/</uri>
			</author>
			<updated>2023-10-03T15:33:58Z</updated>
			<id>http://forum.redump.org/post/112332/#p112332</id>
		</entry>
</feed>
