diff options
Diffstat (limited to 'Boot/Sources/ProgramLoader.cxx')
| -rw-r--r-- | Boot/Sources/ProgramLoader.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Boot/Sources/ProgramLoader.cxx b/Boot/Sources/ProgramLoader.cxx index 4ea0d4c6..fabd1c63 100644 --- a/Boot/Sources/ProgramLoader.cxx +++ b/Boot/Sources/ProgramLoader.cxx @@ -39,13 +39,13 @@ namespace Boot if (firstBytes[0] == kMagMz0 && firstBytes[1] == kMagMz1) { - writer.Write("newosldr: MZ executable detected.\r"); + writer.Write("newosldr: Windows executable detected.\r"); ExecHeaderPtr hdrPtr = (ldr_find_exec_header(firstBytes)); ExecOptionalHeaderPtr optHdr = (ldr_find_opt_exec_header(firstBytes)); // Parse PE32+ - fStartAddress = (VoidPtr)((UIntPtr)optHdr->mImageBase + optHdr->mBaseOfCode + optHdr->mAddressOfEntryPoint); + fStartAddress = (VoidPtr)(optHdr->mAddressOfEntryPoint); fStackPtr = new Char[optHdr->mSizeOfStackReserve]; writer.Write("newosldr: Major Linker: ").Write(optHdr->mMajorLinkerVersion).Write("\r"); @@ -112,4 +112,9 @@ namespace Boot { CopyMem(fBlobName, name, StrLen(name)); } + + bool ProgramLoader::IsValid() + { + return fStartAddress != nullptr; + } } // namespace Boot |
