+ // If the address is not aligned, or the page is not full
+ // sized, copy part of it
+ if( (dest & 0xFFF) > 0 || pBinary->Pages[i].Size < 0x1000)
+ {
+ // Validate the size to prevent Kernel page faults
+ // Clips to one page and prints a warning
+ if( pBinary->Pages[i].Size + (dest & 0xFFF) > 0x1000) {
+ Log_Warning("Binary", "Loader error: Page %i (%p) of '%s' is %i bytes (> 4096)",
+ i, pBinary->Pages[i].Virtual, truePath,
+ (dest&0xFFF) + pBinary->Pages[i].Size);
+ pBinary->Pages[i].Size = 0x1000 - (dest & 0xFFF);
+ }