{% extends "sega.html" %}
{% block title %}mxstartup{% endblock %}
{% block body %}
<h1>mxstartup</h1>

<p>mxstartup is responsible for some very initial system checks, loading the S: drive, and handing over to <a
        href="./mxmaster.html">mxmaster.exe</a>.</p>

<p>The S: drive is a TrueCrypt partition. Its keyfile is located in an ADS at
    <code>C:\System\Execute\DLL:SystemKeyFile</code>, and the password is <code>segahardpassword</code>.
</p>
<p>Micetools contains a bare-minim version of this file. <a
        href="https://gitea.tendokyu.moe/Bottersnike/micetools/src/branch/master/src/micetools/miceboot/mxstartup.c">It
        can be found on the micetools repository.</a> This shows, roughly, how the volume is mounted and prepared.</p>

<p>This is the first time anything other than the Windows XP boot screen will be shown.</p>

<img class="graphic" src="../../../images/mxstartup.png">

<p>mxstartup is responsible for a number of error codes, listed below. This table contains every error mxstartup can
    produce, to the best of my knowledge.</p>
<table>
    <thead>
        <tr>
            <td>Error code</td>
            <td>Message</td>
            <td>Meaning</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>0500</td>
            <td>SecurityCheck error</td>
            <td></td>
        </tr>
        <tr>
            <td>0501</td>
            <td>CheckEwfState error</td>
            <td></td>
        </tr>
        <tr>
            <td>0502</td>
            <td>GetSystemVersion error</td>
            <td></td>
        </tr>
        <tr>
            <td>0503</td>
            <td>GetsystemKeyFile</td>
            <td></td>
        </tr>
        <tr>
            <td>0504</td>
            <td>SetDiskAccessPrivilege</td>
            <td></td>
        </tr>
        <tr>
            <td>0505</td>
            <td>MountSystem</td>
            <td></td>
        </tr>
        <tr>
            <td>0506</td>
            <td>MountUpdate error</td>
            <td></td>
        </tr>
        <tr>
            <td>0507</td>
            <td>ExecuteMaMaster</td>
            <td></td>
        </tr>
        <tr>
            <td>0508</td>
            <td>GetOSUpdateKeyFile error</td>
            <td></td>
        </tr>
        <tr>
            <td>0509</td>
            <td>ExecuteMxOSUpdate error</td>
            <td></td>
        </tr>
        <tr>
            <td>0510</td>
            <td>ChangeEWFStateEnable error</td>
            <td></td>
        </tr>
        <tr>
            <td>0511</td>
            <td>GetSBRSlotOSState error</td>
            <td></td>
        </tr>
        <tr>
            <td>0512</td>
            <td>Deleate Key File error</td>
            <td></td>
        </tr>
        <tr>
            <td>0513</td>
            <td>MountDriver error</td>
            <td></td>
        </tr>
        <tr>
            <td>0514</td>
            <td>CheckPlatform error</td>
            <td></td>
        </tr>
        <tr>
            <td>0540</td>
            <td>Unmount error</td>
            <td></td>
        </tr>
        <tr>
            <td>0541</td>
            <td>MountRecoveryVolume error</td>
            <td></td>
        </tr>
        <tr>
            <td>0543</td>
            <td>MxChangeActivePartition error</td>
            <td></td>
        </tr>
        <tr>
            <td>0545</td>
            <td>osuSystemReboot error</td>
            <td></td>
        </tr>
        <tr>
            <td>0546</td>
            <td>GetSystemDiskNumber error</td>
            <td></td>
        </tr>
        <tr>
            <td>????</td>
            <td>SetBackupComputerName failed</td>
            <td></td>
        </tr>
    </tbody>
</table>
<p>These errors are also reported into the Application event log, under the source <code>mxstartup</code>.</p>

<h2>TrueCrypt Commands</h2>
<li>
    <ul><code>TrueCrypt /k Z:\UpdateKeyFile /v [...] \Device\Harddisk%d\Partition%d /l W: /s /q</code></ul>
    <ul><code>TrueCrypt /k Z:\UpdateKeyFile /v Z:\Minint\System32\DEFAULT_DRIVERS /l V: /s /q</code></ul>
    <ul><code>TrueCrypt /p segahardpassword /k Z:\SystemKeyFile /v C:\System\Execute\System /l S: /w /s /q</code></ul>
</li>

{% endblock %}