Skip to content

Commit

Permalink
[NTOS:FSTUB] Test
Browse files Browse the repository at this point in the history
  • Loading branch information
binarymaster committed Feb 7, 2024
1 parent 7dd3308 commit 1053f0e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ntoskrnl/fstub/fstubex.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef struct _EFI_PARTITION_HEADER
ULONG SizeOfPartitionEntry; // 84
ULONG PartitionEntryCRC32; // 88
} EFI_PARTITION_HEADER, *PEFI_PARTITION_HEADER;
C_ASSERT(sizeof(EFI_PARTITION_HEADER) == 92);
#include <poppack.h>

typedef struct _EFI_PARTITION_ENTRY
Expand All @@ -52,6 +53,7 @@ typedef struct _EFI_PARTITION_ENTRY
ULONGLONG Attributes; // 48
WCHAR Name[0x24]; // 56
} EFI_PARTITION_ENTRY, *PEFI_PARTITION_ENTRY;
C_ASSERT(sizeof(EFI_PARTITION_ENTRY) == 128);

typedef struct _PARTITION_TABLE_ENTRY
{
Expand All @@ -66,7 +68,9 @@ typedef struct _PARTITION_TABLE_ENTRY
ULONG SectorCountBeforePartition;
ULONG PartitionSectorCount;
} PARTITION_TABLE_ENTRY, *PPARTITION_TABLE_ENTRY;
C_ASSERT(sizeof(PARTITION_TABLE_ENTRY) == 16);

#include <pshpack1.h>
typedef struct _MASTER_BOOT_RECORD
{
UCHAR MasterBootRecordCodeAndData[0x1B8]; // 0
Expand All @@ -75,6 +79,8 @@ typedef struct _MASTER_BOOT_RECORD
PARTITION_TABLE_ENTRY PartitionTable[4]; // 446
USHORT MasterBootRecordMagic; // 510
} MASTER_BOOT_RECORD, *PMASTER_BOOT_RECORD;
C_ASSERT(sizeof(MASTER_BOOT_RECORD) == 512);
#include <poppack.h>

/* Partition entry size (bytes) - FIXME: It's hardcoded as Microsoft does, but according to specs, it shouldn't be */
#define PARTITION_ENTRY_SIZE 128
Expand Down

0 comments on commit 1053f0e

Please sign in to comment.