Update FAT32.py

main
Younes Tasra 2023-04-16 05:18:32 +00:00 committed by GitHub
parent e615c6a26b
commit 36d9255294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 12 deletions

View File

@ -113,9 +113,9 @@ def raw2hex(image_path, data=None, start=None):
return raw_data.hex() return raw_data.hex()
# ---------------------------------------- # ----------------------------------------- #
# Analysis of the Master Boot Record - MBR # Analysis of the Master Boot Record - MBR #
# ---------------------------------------- # ----------------------------------------- #
# Checking the state of partitions (Bootable/Non-Bootable) # Checking the state of partitions (Bootable/Non-Bootable)
def bootable(hex_image, partition_counter): def bootable(hex_image, partition_counter):
@ -171,9 +171,9 @@ def MBRSignature(hex_image):
return value return value
# ---------------------------- # ----------------------------- #
# Analysis of the Boot Sector # Analysis of the Boot Sector #
# ---------------------------- # ----------------------------- #
def jumpCode(hex_image) : def jumpCode(hex_image) :
# Size: 3 Bytes # Size: 3 Bytes
@ -293,9 +293,9 @@ def totalNumberOfSectors(hex_image) : # Number of Sectors in the entire disk
return int(value, 16) # Apply some checks on this value return int(value, 16) # Apply some checks on this value
# --------------------------------------------------------------- # --------------------------------------------------------------- #
# Analysis of what's after the first 36 bytes of the boot sector: # Analysis of what's after the first 36 bytes of the boot sector #
# --------------------------------------------------------------- # --------------------------------------------------------------- #
def numOfSectorsPerFAT(hex_image): def numOfSectorsPerFAT(hex_image):
# Size: 4 bytes # Size: 4 bytes
start = 36*2 # JumpCode + OEM + BytesPerSector + SectorsPerCluster + reservedArea + numberOfFATs + NumberOfRootDirectoryEntries + NumberOfSectors + MediaType + FatSize + NumberOfSectorsPerTrack + NumberOfHeads + NumberOfHiddenSectors + NumberOfSectorsInPartition start = 36*2 # JumpCode + OEM + BytesPerSector + SectorsPerCluster + reservedArea + numberOfFATs + NumberOfRootDirectoryEntries + NumberOfSectors + MediaType + FatSize + NumberOfSectorsPerTrack + NumberOfHeads + NumberOfHiddenSectors + NumberOfSectorsInPartition
@ -413,9 +413,9 @@ def BootRecordSignature_1(hex_image):
value = big_endian[::-1].hex() value = big_endian[::-1].hex()
return value # Apply some checks on this value.(Always == 55 AA) return value # Apply some checks on this value.(Always == 55 AA)
# --------------------------------------------------- # --------------------------------------------------- #
# Analysis of File System Information Sector (FSINFO) # Analysis of File System Information Sector (FSINFO) #
# --------------------------------------------------- # --------------------------------------------------- #
def FSINFOSignature_1(hex_image): def FSINFOSignature_1(hex_image):
# Size: 4 bytes # Size: 4 bytes