- Timestamp:
- Oct 16, 2024 8:53:42 PM (6 weeks ago)
- Location:
- trunk/src/bldprogs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bldprogs/VBoxEditCoffLib.cpp
r106061 r106398 333 333 return error("member too small for COFF\n"); 334 334 if ( pHdr->Machine != IMAGE_FILE_MACHINE_AMD64 335 && pHdr->Machine != IMAGE_FILE_MACHINE_I386) 335 && pHdr->Machine != IMAGE_FILE_MACHINE_I386 336 && pHdr->Machine != IMAGE_FILE_MACHINE_ARM64 337 && pHdr->Machine != IMAGE_FILE_MACHINE_ARM) 336 338 return error("Unsupported COFF machine: %#x\n", pHdr->Machine); 337 339 if ( pHdr->PointerToSymbolTable >= g_cbMember -
trunk/src/bldprogs/VBoxPeSetVersion.cpp
r106061 r106398 273 273 return Error("Invalid PE signature: %#x", NtHdrs.x32.Signature); 274 274 uint32_t cbNewHdrs; 275 if (NtHdrs.x32.FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64) 275 if (NtHdrs.x32.FileHeader.Machine == IMAGE_FILE_MACHINE_ARM64) 276 { 277 if (NtHdrs.x64.FileHeader.SizeOfOptionalHeader != sizeof(NtHdrs.x64.OptionalHeader)) 278 return Error("Invalid optional header size: %#x", NtHdrs.x64.FileHeader.SizeOfOptionalHeader); 279 if (NtHdrs.x64.OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) 280 return Error("Invalid optional header magic: %#x", NtHdrs.x64.OptionalHeader.Magic); 281 if (!uNtVersion) 282 uNtVersion = MK_VER(10, 0); 283 else if (uNtVersion < MK_VER(10, 0)) 284 return Error("Selected version is too old for ARM64: %u.%u", uNtVersion >> 8, uNtVersion & 0xff); 285 cbNewHdrs = sizeof(NtHdrsNew.x64); 286 } 287 else if (NtHdrs.x32.FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64) 276 288 { 277 289 if (NtHdrs.x64.FileHeader.SizeOfOptionalHeader != sizeof(NtHdrs.x64.OptionalHeader)) … … 286 298 } 287 299 else if (NtHdrs.x32.FileHeader.Machine != IMAGE_FILE_MACHINE_I386) 288 return Error("Not I386 or AMD64 machine: %#x", NtHdrs.x32.FileHeader.Machine);300 return Error("Not I386, AMD64 or ARM64 machine: %#x", NtHdrs.x32.FileHeader.Machine); 289 301 else 290 302 {
Note:
See TracChangeset
for help on using the changeset viewer.