<!--
 Copyright (c) 2019 Emilian Roman
 
 This software is provided 'as-is', without any express or implied
 warranty. In no event will the authors be held liable for any damages
 arising from the use of this software.
 
 Permission is granted to anyone to use this software for any purpose,
 including commercial applications, and to alter it and redistribute it
 freely, subject to the following restrictions:
 
 1. The origin of this software must not be misrepresented; you must not
    claim that you wrote the original software. If you use this software
    in a product, an acknowledgment in the product documentation would be
    appreciated but is not required.
 2. Altered source versions must be plainly marked as such, and must not be
    misrepresented as being the original software.
 3. This notice may not be removed or altered from any source distribution.
-->

PATCHING
========

The HXE can conditionally patch the HCE executable it will invoke with
the LAA flag:

  Offset   Value
  -------- -------
  0x136    0x2F

For context on what this means, review:

    https://en.wikipedia.org/wiki/2_GB_limit

> The 2 GB limit refers to a physical memory barrier for a process
> running on a 32-bit operating system, which can only use a maximum of
> 2 GB of memory. The problem mainly affects 32-bit versions of
> operating systems like Microsoft Windows and Linux, although some
> variants of the latter can overcome this barrier. It is also found in
> servers like FTP servers or embedded systems like Xbox. The use of
> Physical Address Extension (PAE) can help overcome this barrier.

> While Linux, FreeBSD, and most Unix-Likes support PAE so long as the
> hardware does, Windows needs this boot option enabled manually. This
> is known as 4-gigabyte tuning (4GT), or the /3GB switch. Once enabled,
> executables can have the "large address aware" flag set to increase
> their memory limit to 3GB. 32-bit processes on 64-bit Windows are also
> limited to 2GB. However, they can use the "large address aware" flag
> as well, except that it doesn't require the /3GB switch and increases
> the limit to 4GB.
